Reputation: 6756
I have splitted my application into two main areas.
The content of A should be set based on what user wants.
So basically i can have 1..N classes which could be used in Class URI of Part in application model.
I don't know if i should replace the whole Part(A) with new dynamically created Part(C) which has content i want, or i should somehow to modify the existing Part (call setContributionURI, or setObject methods on Part object?).
It does make more sense to me to modify the existing Part, because it is defined in Application model and therefore already describing the location where the content should be.
Possible solutions:
Upvotes: 0
Views: 62
Reputation: 111142
If you want to reuse the Part then do something like:
MPart part = find or inject your part
MyClass myClass = (MyClass)part.getObject();
... call a method of MyClass to change the contents
MyClass
is the class you specify for the object in the application model. You should add a method to that to let you change the contents.
Don't try to call setObject
, this is really only for use by Eclipse. I don't think setContributionURI
would do anything after the part is created (but I am not sure).
If you want to use different classes for the different data then you really should use different Parts.
Upvotes: 1