Object Oriented Property Stream Library
(OopsLib)

OopsLib provides the best solution for the well-known problem of persistency in C++. It is also known as serialization. Above of that OopsLib makes possible to add a public interface, called Property Interface to any C++ class or class hierarchy. Other programs such as the Property Editor can connect to this interface, iterate through the properties of the application for getting and setting the values of its properties. The Property Editor can do this without knowing anything about the application. This opens new dimensions in component based program development in C++.

Persistency

Persistent objects are C++ classes having some knowledge to save themselves to data streams and load themselves back. Other programming languages (Java) have been built in support for persistency, but C++ has almost nothing. The common solution for persistency is writing a Load() and Save() virtual method for every class, which can load and save all data of the object. These methods are implemented by the programmer of the given class and it has a lot of disadvantages. Most large projects would need persistent data sooner or later, therefore a lot of companies and programmers provide different tools (MFC, Object Oriented Databases, ...), but none of them gives the perfect solution. All of them has certain limitations (e.g. multiple inheritance is not supported).

The proper solution should fulfil the following requirements:

C++
The library must support all possible C++ language elements including multiple and virtual inheritence and standard containers.
Easy to implement
Adding persistency to a class or hierarchy of classes should not require any programming. It would be better just marking the member variables of functions for saving and loading.
Removable
When persistency is not required in an application, it should be removed.
Scalable
Only those class should have the code necessary for persistency, which really needs it.
Dynamic
When the application loads itself to the memory, the code impementing the persistency should be removed from the memory.
Platform independent
The library providing the persistent storage should work on different platforms and it should be able to read streams created on other platforms.
Flexible
The properties should have some kind of sorting, such as read-only, write-only and streamable properties.
Separated layers
The property and streaming layers should be separated for making possible to use different stream formats (text, XML, binary, Base64) for the same application.
Editable
ASCII or text streams should be editable by hand. This means that the program must tolerate if some properties are missing and should except them in any order.
Different Program Versions
Unknown properies should be preserved. This is important, if a data file is edited with an older version of the same application.

rOopsLib fulfils most of these requirements, while the competitors generally cannot fulfil any of them.

How is it possible?

C++ is a very powerful programming language. While other languages require special support for persistency C++ makes possible to implement it with standard language elements. OopsLib implements a new run-time type identification system and adds a description table to every class, called Property Descriptor Table, which defines the properties and their attributes. Properties are methods and data members available through the Property Interface. The Property Interface is also added to classes having properties. This interface makes possible to create an iterator, which can iterate through all properties of an object, get the name and type of the selected property and set and get its value.

The Property Interface is used in different stream objects for saving and loading object. Above of solving the problem of persistent classes the Property Interface has some other advantages. It can be used to monitor and change the state of a program with the Property Editor, which is very useful for debugging applications even in embedded environment or can be used for generating applications.

OopsLib supports all features of C++ language with very few exceptions, therefore it can be added to existing object libraries quickly. Using OopsLib and adding the Property Interface to classes does not require programming. Most of the jobs are to create a table called Property Descriptor Table wich defines the properties and attribute of properties for the class it belongs to.

OopsLib has several components and all of these components have their specific task:

Type Identification
The RTTI (Run Time Type Identification) system of the language does not provide relevant information for persistency. (It was designed for dynamic casting.) Therefore OopsLib has its own powerful RTTI. It is absolutely independent of the standard RTTI and works when RTTI is switched off, when the application is compiled. Based on its own RTTI, OopsLib provides dynamic casting similar to the standard dynamic_cast<> operator. <
Property Description
Above of the RTTI system a Property Descriptor Table is defined for classes having properties. This table stores all necessary information of properties, such as their name, type, flags and the reference to the member function or variable it belongs to. <
Property Iterators
Property Iterators can be used as pointers to properties. They can be incremented and decremented for iterating through the hierarchy of the classes and properties. <
Stream Classes
Stream classes are used to save and load objects through the Property Interface. They are independent of the class, but they are able to create polimorph objects based on the input information. Only the Property Iterators are used. <
TCP/IP Interface
The Property Interface and all functionality of the Property Iterators are available for other applications through TCP/IP connection. Applications can be investigated through this interface and their variables can be modified with programs like the Property Editor. <
Property Editor
Property Editor is a very powerful tool for debugging or editing applications using OopsLib. It can be used as an Application Generator and opens new dimensions of component based programming in C++. The Property Editor knows absolutely nothing about the application and its components, its editing. It only uses the Property Interface through TCP/IP, but this is enough to collect a lot of information, to create new objects, investigate, get and set the properties of the application. Thanks to the platform independent design and the TCP/IP standard the application and the Property Editor may run on different computers with architecture and operating systems.

Properties

Property is a common expression for variables of objects available externally from Application Generator programs or high level program development tools. Some good examples are the Resource Editors, the Delphi from Borland or Visual Basic from Microsoft, but properties are also used for widgets in X Window or QNX Photon.

Classes and structures have member functions and member variables, but the C++ language does not provide any interface for accessing the members from other programs. In most cases only some of the variables are "properties". Providing an interface for accessing properties could be a very powerful tool for presistency and component based program development. The OopsLib provides this interface.

What kind of members can be properties? The short answer is, that any simple or complex member variable or member function can be property. The OopsLib supports:

There are only a few restrictions, but they are used very rarely:

Streams

Stream classes are using the Property Interface for accessing the objects. Their source is independent of the property layer and the application. This makes possible to easily change the stream format and making conversion utilities between different formats.

OopsLib streams have some important advantages:

For more iformation, please, refer the documention of OopsLib.


[ Home | RCS | rIDE | SIMM-Sys | SC | Site-map | Help | Feedback ]

Robot Control Software Ltd. Úrbéres u. 62/A., Budapest, 1028 Hungary; Tel:+36-1 398-0200 Fax:+36-1 398-0202