[Uml-devel] kdesdk/umbrello/umbrello/codegenerators

Andrew Sutton asutton at cs.kent.edu
Thu Feb 5 10:28:05 UTC 2004


On Thursday 05 February 2004 12:33 pm, Brian Thomas wrote:
> On Thursday 05 February 2004 12:27 pm, Jonathan Riddell wrote:
>
> > On Thu, Feb 05, 2004 at 06:00:18PM +0100, Brian Thomas wrote:
> >
> > > CVS commit by thomas:
> > >
> > > minor bug fix: add 'string' datatype to java/cpp code generators
> >
> >
> > I think I left it out because String is an object in java rather than
> > anything build in, but essentially it can be treated as a datatype.
> >
> > But shouldn't it be "String" with a capital?
>
> 	
> 	I disagree. Remember that we want to create UML diagrams
> 	that can be used to generate more than one type of language
> 	code. This is why I like "string" which can be a 'universal' datatype,
> 	shown in the UML,  and the individual code generator can interpret this, 
> 	as desired. 
> 	
> 	In the case of Java, 'string' should be converted to "String" in 
> 	generated code. In the case of CPP, it depends on the user configuration,
> 	(see the configuration for the langauge, but it defaults to std::string
> as
 the class type).

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...

andy




More information about the umbrello-devel mailing list