homepage › Forums › BridgePoint/xtUML Usage and Training › Reusable Components and Instantiation of Internal Classes
- This topic has 2 replies, 2 voices, and was last updated 6 years, 11 months ago by
cort.
-
AuthorPosts
-
January 9, 2014 at 3:50 pm #1294
Dennis Tubbs
ParticipantIs there a good method to instantiate the classes within a reusable component? I would like to be able to have some simple OAL within the component, or at least scoped to be within the component, like the following:
create object instance
relate object instance
etc.However, once this OAL is placed within the component the component is no longer reusable in a different application. For example, a component that handles IO. One option is to copy and paste but I do not consider that reuse. Another option would be to create an interface and serialize the commands to instantiate the class diagram for any particular use, but this seems cumbersome.
Has anyone considered this and found a good solution? Are components really reusable?
Thanks,
DennisJanuary 10, 2014 at 7:43 pm #1295Dennis Tubbs
ParticipantI found the answer in the “BridgePoint Model Compiler – User’s Guide”.
February 11, 2014 at 7:09 pm #1311cort
KeymasterDear Dennis,
Sorry for not responding to this post right away. Hopefully, what you found in the manual is sufficient. But here are some additional thoughts.
The manual describes an “initialization function”. Such a function can be marked to run at system start. Your model can contain more than one initialization function. Different markings can enable/disable the various initialization sequences. This allows the same model to be used in various configurations.
Another option is to use messaging. You can have “start” messages that are received by the component from another component responsible for sequencing initialization. To reuse initialization functions, the message can invoke your initialization functions.
Just some options.
Regards,
Cort -
AuthorPosts
- You must be logged in to reply to this topic.