|
|
|
Re: EMF model to Property bag [message #890860 is a reply to message #890725] |
Sat, 23 June 2012 08:42 |
Ed Merks Messages: 33142 Registered: July 2009 |
Senior Member |
|
|
Aditya,
Comments below.
On 23/06/2012 1:11 AM, Aditya Wagle wrote:
> Here is an example of a sample model:
>
> SampleHTTPActivity
> -httpURL (type:HTTPURL)
> -timeout(int)
> -closeOnTimeout(boolean)
>
> HTTPURL
> -hostName(String)
> -port(long)
> -------------------------
> Here's how it could possibly look like after conversion
>
> SampleHTTPActivityProperties
> -(httpURL, propertiesObject)
> -(timeout, 10)
> -(closeOnTimeout, true) (or 0/1)
>
> propertieObject would be again a bag of properies
What if the property is multi-valued? I guess it would be a list of bags...
>
> HTTPURLPropertiesObject
> -(hostname,"localhost")
> -(port, 8080)
>
> The keys would always be the EAttributes for the model (as you can see
> above). The values would come from the UI.
>
> Any reference should automatically again be converted to a reference
> properties object.
>
> The consumer of the object would know the data type for each of the
> model elements. So that's not a worry.
So it would be good to define a class that extends EObjectImpl or
MinimalEObjectImpl that implements your bag interface and use it as the
Root Extends Class for your model. Then any of your modeled objects can
be cast to a bag and used directly.
>
> Thanks,
> -Aditya
>
Ed Merks
Professional Support: https://www.macromodeling.com/
|
|
|
Powered by
FUDForum. Page generated in 0.03137 seconds