![]() |
Telelogic Rhapsody (steve huntington) | ![]() |
Topic Title: Help me with Components and package reuse Topic Summary: Need assistance with package reuse Created On: 20-Jan-2009 20:02 Status: Read Only |
Linear : Threading : Single : Branch |
![]() |
![]()
|
![]() |
|
This seems like a simple topic, but I find that after trying a few times to explain my plight, I don't like my own explanations. Regardless, I'll try again.
For good or bad, the following is how my project is organized: I have several packages of classes. Each package has a container class called packagename_subsystem. Within the packages everything is events and statemodels. Outside, the package looks like a functional subsystem, its API exported via the container class. I have one large OMD that associates the containers to one another based on usage. So, if lets say my package that handles calculations wants to talk to the GUI, it does so via the GUI package as such: itsGUI_Subsystem->functionname(xyz). This has served me well. Now, I am looking to make a new component, that uses all of the packages but one. So I add a new component, and uncheck the unwanted package. I like the package API, so I copy the old package to a new name and include the new one. I want to edit the guts of the new package and just build and go. I don't want to change my old packages, as I still need to build that other component from time to time for maintenance and want to use the same code. However, the OMD diagrams know that my other packages want that old package specifically. Even if my new package has the same class names, the other packages "know" about the old package name and refuse to work. I basically had: an old package X with a class within it called Y. a new package called Z with the same class Y (modified) I want to be able to make - one component that uses all my stuff + X/Y (my existing build) - one component that uses all my stuff + Z/Y (new new build) Basically, I am replicating a package and want to pick the original one or the new one in the component/scope. How can I do this, when inter-package associations keep the package name? I know I could just copy the whole project and do what I want, but I'd like to maintain both components with common code. |
|
![]() |
|
![]() |
|
Hi Paul
That's a very clear description. Thankyou. The problem you're describing is fairly common, and it's what Object-Oriented programmers call "polymorphism". In other words, you want AllYourStuff to be able to talk to any one of a number of components having a common API. Let's call the API "YInterface". My assumptions:
So, one way to solve your problem is:
Before I go on (I could create a demo model, if that would help) I want to check in with you:
best regards, Simon ------------------------- Simon Morrish simon.morrish@eu.panasonic.com http://panasonic.co.uk Panasonic ideas for life Edited: 21-Jan-2009 at 09:50 by Simon Morrish |
|
![]() |
|
![]() |
|
Thanks. That is very clear. I may try that our in a week or two. In the meantime I actually found a different, but less useful (long term) solution. All of my interface classes were all inside one container class. I utilized the container's pointer to the class I wanted and got rid of the inter-interface class relationship. This worked for now, but I think I will try what you said when I move forward.
I'm running 7.1, CPP. Thanks |
|
![]() |
Telelogic Rhapsody
» Rhapsody Category » Rhapsody
»
Help me with Components and package reuse
|
![]() |
FuseTalk Standard Edition v3.2 - © 1999-2009 FuseTalk Inc. All rights reserved.