Login | Register
My pages Projects Community openCollabNet

Discussions > modules-dev > What is the proper way to build stereotype?

argouml
Discussion topic

Back to topic list

What is the proper way to build stereotype?

Author wkl
Full name Ken W K Lee
Date 2005-10-16 19:27:19 PDT
Message Hi,

I'm writing an external module that will provide a list of stereotypes
when the module is enabled (i.e. the project is empty). The following
code is written, first to find the namespace of the current project,
then build a new object and set its base class to "classifier":

Object ns =
ProjectManager.getMa​nager().getCurrentPr​oject().getCurrentNa​mespace();
Object s =
Model.getExtensionMe​chanismsFactory().bu​ildStereotype("my_st​ereotype", ns);
Model.getExtensionMe​chanismsHelper().set​BaseClass(s, "Classifier");

But seem to me that hard-coding the base class name is not proper to the
design philosophy. I have tried
Model.getMetaTypes()​.getClassifier().toS​tring() and
Model.getFacade().getName( Model.getMetaTypes()​.getClassifier() ) but
seems not right. Can anyone show me a better way to do it?

Thanks in advance.


Ken

« Previous message in topic | 1 of 2 | Next message in topic »

Messages

Show all messages in topic

What is the proper way to build stereotype? wkl Ken W K Lee 2005-10-16 19:27:19 PDT
     Re: [argouml-modules-dev] What is the proper way to build stereotype? bobtarling Bob Tarling 2005-10-17 03:42:42 PDT
Messages per page: