Hello, Manuael and everybody,
I have the question regarding how to set up classes relationship.
I'm designing the system that must provide to end user the capabilities to
describe and create custom object types.
Such objects may have custom variables, validators, behaviour etc.
I have 2 components named 'Object_prototypes' and 'Object_instances' (verbose
names here for simplicity).
Object_prototypes contains metadata for future object that will be created by
end user.
Among of all this component contains class called 'Properties' that describes
properties of certain object (created by end user).
Fragment of 'Object_prototypes' definition:
<component>
<name>Object_prototypes</name>
...
<class>
<name>Objects</name>
...
<variable>
<name>title</name>
<type>text</type>
</variable>
<collection>
<name>properties</name>
<class>Properties</class>
<reference>title</reference>
</collection>
</class>
...
<class>
<name>Properties</name>
<variable>
<name>title</name>
<type>text</type>
</variable>
<collection>
<name>type</name>
<class>property_type</class> <!-- the type class not shown -->
<reference>type</reference>
</collection>
<variable>
<name>value</name>
<type>text</type>
</variable>
<variable>
<name>default_value</name>
<type>text</type>
</variable>
</class>
...
</component>
Further, the component 'Object_instances' will contains object instances created
by end user based on one of 'Object_prototypes' class object.
Each object must have its own set of properties regarding to template this
object based on.
The instance of object of certain type may have 'private' value of any property
either must take default value from 'prototype' if private value not specified.
Fragment of 'Object_instances' definition:
<component>
<name>Object_instances</name>
...
<class>
<name>Instance</name>
<variable>
<name>title</name>
<type>text</type>
</variable>
<variable>
<name>template</name>
<component>Object_prototypes</component>
<class>Objects</class>
</variable>
<collection>
<name>properties</name>
<class>instance_properties</class>
<reference>title</reference>
</collection>
</class>
<class>
<name>instance_properties</name>
<!-- below I'm stuck -->
<variable>
<name>property</name>
<component>Object_prototypes</component>
<class>Properties</class>
</variable>
<variable>
<name>value</name>
<type>text</type>
</variable>
</class>
...
</component>
I feel like I'm inventing a wheel because it seems I'm trying to do the thing
that is always done.
I see that it will be meta meta system, but how to handle my needs in more
effective way?
Maybe the way I'm trying to solve this problem now is fundamentaly mistaken and
I have to use native metastorage capabilities to achieve end user fuctionality?
In short, I'm stuck.
Besr regards,
Sergey Klenin
[Non-text portions of this message have been removed]