|Re: Creating centralised datatypes model [message #629855 is a reply to message #629843]
||Wed, 29 September 2010 18:35
| Ed Merks
Registered: July 2009
> Hi all,
> I am looking to create a centralised datatypes model that can be
> shared by different models across the toolsuite we are creating. So
> for example we need the simple types like Bool, Int etc
EcorePackage and XMLTypePackage both provides those already.
> but also the more complex types like arrays.
There are many types of arrays. Things like EByteArray are provided by
EcorePackage and XMLTypePackage...
> With the simple types its pretty straightforward as they cannot be
> configured and as such can be shared by everyone who needs a bool.
By configured you mean they are immutable...
> The model is saved in its own resource with the Datatypes container
> having datatypes in it (containment= true) and all referencing objects
> from other models having references to these types (containment=false).
So you want to have objects that contain your values?
> So if two models used a bool they'd both point to the same object (via
> a href) in this central resource.
You'd want, for example, a single EObject to represent a wrapper for the
boolean value true?
> So far so good. But when it comes to arrays for example we have an
> issue. These are configured with contained types (arrays of bools,
> ints etc) and also with bounds (0..10, 0..100 etc) so in this case
> having them centrally contained is a little less clear to me. I tried
> to have the create methods on the factory take parameters but this
> caused an issues on loading of resources when the create(ECLass)
> method of the factory is used as I cannot see how this can pass the
> parameters I need to the constructor.
Deserialization generally creates empty instances which are then
populated as the information about them is deserialized...
> I could have simple types contained centrally and complex types
> contained by the seperate models but I would need two attrs for this
> then surely ? (simpleDatatype, complexDatatype when I can only have
> one datatype) .
I'm having a hard time trying to figure out what's motivating this. I
can't imagine it's a good thing for there to be a central place that
stores all integer values being used, and all floats, and so on. I
imagine it's generally good to store that information about the value at
the point it's used.
> Has anyone built such a model and if so got any advice ?
It's a little hard to imagine why you'd want this.
> Also can EDatatype help me in this ?
How come you can't use reuse EMF existing data types and define new ones
for the types not already supported? What's the purpose of this
centralized place to store wrappers for all values?
Powered by FUDForum
. Page generated in 0.02034 seconds