[Uml-devel] Universal Model DataTypes in umbrello

Brian Thomas thomas at mail630.gsfc.nasa.gov
Thu Feb 5 10:39:01 UTC 2004


On Thursday 05 February 2004 01:26 pm, Andrew Sutton wrote:
> UML doesn't really define any built in types... at least not like "int" or
> "bool". Ideally, those should be defined by a model library that is
> imported based on the type of project you're working. Actually, Visio works
> this way. by default you have three datatype packages available: C++, Java
> and C# (although they managed to leave "string" out of C++). These data
> types actually show up as "C++::int" or something like that.
>
> This is how the OMF works too. types are imported (just like profiles) into
> the model you're working on. Of course you'll get the choice of C/C++
> types, the STL, Java types, C# types, Qt types, ACE types - actually
> whatever model libraries anybody feels like building.
>
> Ideally, you'd want to create data types specific to the language and have
> the developers use those. Since umbrello doesn't actually have an import
> feature, you could scope the data types by packages (like Java::String) or
> something like that. just a suggestion...

	I accept that UML has no universal datatypes per se, but its a problem.

	Again, the problem I have with all this is that I want to create  UML class 
	diagrams that can be used to generate both java and C++ code. I dont see 
	how you can put "Java::String" for an attribute in one class in the diagram, 
	and then expect umbrello to  correctly generate "C++::std::string" when you 
	change over to C++ code generation from Java code generation (which you 
	_should_ be able to do).

	Perhaps the model library should be scoped as "umbrello:<datatype>", then
	we have a list that looks like:

	umbrello:string
	umbrello:integer
	umbrello:boolean
	...

	and so on. When a particular code generator is selected, it will map from these
	"universial" types to the code/language specific ones. Would that work for
	you better?

	=b.t.


	




More information about the umbrello-devel mailing list