Author Topic: Setting default tagged values  (Read 9181 times)

Chris_Reynolds

  • EA User
  • **
  • Posts: 25
  • Karma: +0/-0
  • Poets have been curiously silent about cheese.
    • View Profile
Setting default tagged values
« on: October 14, 2002, 11:51:30 pm »
I want to initialise my attributes with a default set of tagged values.
I have created a profile and can drag my attribute over a class.
This works fine but...
sometimes I forget and just create an attribute with the attribute dialog.
Is there anyway of creating a set of default tag values for unstereotyped attributes.

gsparks

  • EA User
  • **
  • Posts: 325
  • Karma: +0/-0
  • I love YaBB 1 Gold!
    • View Profile
Re: Setting default tagged values
« Reply #1 on: October 28, 2002, 04:56:20 am »
Hi Chris,

I cant think of a simple way to do this at the moment. I will think about how it could be done. The Profile mechanism was sort of intended to be the answer to this - but I can see that in some cases you may want to assign a tagged value to all new attributes as a 'custom property'.

I would expect this should apply to new Operations and Classes as well.

Ill see what can be done,

Geoff Sparks






Chris_Reynolds

  • EA User
  • **
  • Posts: 25
  • Karma: +0/-0
  • Poets have been curiously silent about cheese.
    • View Profile
Re: Setting default tagged values
« Reply #2 on: October 28, 2002, 10:21:51 am »
Yep, classes operations and packages would be useful as well.
I wondered whether it would be easiest for you to apply the profiles dynamically as you loaded or saved each thingy (technical abbreviation for any UML object).
Could be a performance hit tho'  :-[

gsparks

  • EA User
  • **
  • Posts: 325
  • Karma: +0/-0
  • I love YaBB 1 Gold!
    • View Profile
Re: Setting default tagged values
« Reply #3 on: October 28, 2002, 03:14:51 pm »
Chris,

Yeh - I saw two options I guess:

1. You can configure a project level set of tags that will automatically be added to new attributes, operations etc.

2. You could apply a profile setting to some element - by dragging onto it - or some other means. In this case you could then apply the information 'after the fact' as it were.

Geoff Sparks

Chris_Reynolds

  • EA User
  • **
  • Posts: 25
  • Karma: +0/-0
  • Poets have been curiously silent about cheese.
    • View Profile
Re: Setting default tagged values
« Reply #4 on: October 28, 2002, 03:49:15 pm »
Geoff

The issue is one of timing more than anything.

I use the model as a design time and a run time repository.

So in a few weeks time, while I am writing my 'n'th report filter dialog, I might see a design pattern.
For instance, I might want any report filters fields that are to have a start-report and end-report expression with perhaps a start of current month and end of current month default for date attributes.
What I could do in Rose (which by the way is nowhere near as good as your wonderous product) is just add two new properties to the default attribute and call them 'report-start' and 'report-end' with appropriate defaults. Then go thru the model and only override the default where required.

So the fundamental problem is me. I keep adding to the things I want to do with stereotypes and tagged values so it would be nice if I could just update the profile everytime I have an idea and let the model automatically catch up with the profile.
This runs counter to either of your suggestions.
I wonder if the simplest solution is to add a phase to the 'import profile' action, that effectively runs thru the model looking for thingies with the new imported stereotypes and adds any missing tagged values into the database. Of course, an undo might be tricky. And do you delete any old tagged values in the model that don't exist in the new profile.
Alternatively, instead of bundling it with the import, maybe it should be a separate 'sync' action on the context menu of the profile.

jaimeglz

  • EA User
  • **
  • Posts: 164
  • Karma: +0/-0
    • View Profile
Re: Setting default tagged values
« Reply #5 on: October 28, 2002, 06:41:37 pm »
Hi Chris, Geof, everybody...

Here's a contribution on attributes best practices:

The best way to handle attributes is to group them by domain. A common example of an attribute domain is the "money" data type, which is provided by several RDBMS products: it is a real number, with a so-many decimal places (usually four, but for most operations two is OK).

(Chris, be patient with me: I'll will get to deal with the point you have raised.)

Unfortunately, RDBMS do not readily provide us with "weight", "rate", "person_name", "country_name", "integer_key", "small_key", and other data domains we would just love to have. Yes, of course, RDBMS provide us with user-defined data types; but you still have to do some analysis in order to define your user-defined data types. For example, you have to arrive at something like the following (I'm using Transact-SQL):

sp_addtype dt_int_key,int
sp_addtype dt_name,'varchar(50)'
sp_addtype dt_address_lin1,'varchar(70)'
sp_addtype dt_description,'varchar(70)'
sp_addtype dt_rate,'numeric(12,6)'
and so forth...

If we could have a good data domain hierarchy, which would be supported by data domains in EA, we could make everybody's work more productive. Imagine: we wouldn't have to cope with a first_name being a char of... mmm... (how many?)

A great percentage (I'd say above 90%) of attributes could be assigned by EA users to a data domain type. Variables would (and at least in SQL code they should) be assigned according to these domains; for example:

DECLARE      @last_key_assigned dt_int_key,
     @object_name dt_name,
     @currency_key dt_small_key,
     @LCy_in_USD dt_rate
     @currency_name dt_name

Of course, the usual data types for each RDBMS should still be available, because you do have cases you have to add in the last minute.

An additional nicety could be achieved by having the SQL to generate the corresponding user-defined data types downloaded from EA's profiles in Sparx's web page (and extended or improved domains could be produced by EA's partners)... or, there could be facility in EA to generate code for domain data types.

Ideally, if you can have 100% of your attributes assigned to data domains, your model would work pretty well with a variety of RDBMS products.

In a week or so I will send Sparx, by EMail, the data type hierarchy I've used successfully in my projects. Sparx can criticize it, improve it, publish it in EA's web page, trash it, whatever..., with the idea of having a departure point which can be enriched by other EA users so as to serve at least for vanilla-flavor projects.

Once we have a good hierarchy, and good default values for each domain, Sparx can incorporate data domains in the default EA project, and we could also incorporate them into existing projects through some import process.

EA could provide a dialog (say, extended data domain definitions through Reference -> Data domains) to define the default tag values that Chris wants. Through this dialog a user could make some modifications to existing domains (but not change data type or length), or could add new domains (such as "large_last_name", or "bigint_key"), as needed.

It sounds almost incredible that --in the age of computers-- we are currently working like 18th century artisans, painfully adjusting every little piece we make, when we should be assembling from standard elements.

Jaime Gonzalez

Chris_Reynolds

  • EA User
  • **
  • Posts: 25
  • Karma: +0/-0
  • Poets have been curiously silent about cheese.
    • View Profile
Re: Setting default tagged values
« Reply #6 on: October 28, 2002, 07:09:29 pm »
Thanks Jaime,

I completely agree with you that domain data types are an essential tool. I use them all the time.

However, the stereotype tagged value mechanism has many more uses than that.
For instance, if you are using domain data types in a run-time scenario, you many want to store delphi UI widget type, Coldfusion tag, SQL mapping, JDO mapping, default output formatting, default input mask, ....
And all this info is stored in the UML model in classes with stereotype=DomainDataType  perhaps.
Therefore it would be nice to set up profiles to support these wonderous domain data types with a default set of tagged values.

In the above case, we were applying the stereotype-taggedvalue mechanism to UML classes but there are also uses for them on packages, operations, attributes, associations etc.
So I am unclear about how better domain data types are going to help me.

jaimeglz

  • EA User
  • **
  • Posts: 164
  • Karma: +0/-0
    • View Profile
Re: Setting default tagged values
« Reply #7 on: October 29, 2002, 11:56:31 am »
Hi Chris,

I agree with you on the potential of using tagged values not only for attributes, but for classifiers, associations and packages as well. My comments, however, relate only to attributes.  

The point you raised in your original posting was:

"I have created a profile and can drag my attribute over a class.
"This works fine but...
sometimes I forget and just create an attribute with the attribute dialog.
"Is there anyway of creating a set of default tag values for unstereotyped attributes."

And in a later posting:

"What I could do in Rose (which by the way is nowhere near as good as your wonderous product) is just add two new properties to the default attribute and call them 'report-start' and 'report-end' with appropriate defaults. Then go thru the model and only override the default where required.

"So the fundamental problem is me. I keep adding to the things I want to do with stereotypes and tagged values so it would be nice if I could just update the profile everytime I have an idea and let the model automatically catch up with the profile."

My understanding of the above is that you are looking for a way to have a single point of change to add, delete or update your attibute's tagged values. What I am suggesting is that your tagged values be part of the data domain definition.

For instance, if you have a data domain hierarchy, you can create the report_start_date attribute with a start_date data type (that is, it would belongs to the dt_start_date domain, that would inherit from a dt_date domain). This means you can either drag this attribute into a class, or you can create a new attribute in the class by means of Table Detail -> Column/Attribute -> New, and adding to it the start_date data type. Later, when you want to add, delete or change your tagged values, you have single point of change: the data domain; you would not have to go into each and every one of your report_start_date attributes to make the changes.

I hope this idea contributes to solve the issue.

Jaime

Chris_Reynolds

  • EA User
  • **
  • Posts: 25
  • Karma: +0/-0
  • Poets have been curiously silent about cheese.
    • View Profile
Re: Setting default tagged values
« Reply #8 on: October 29, 2002, 12:12:54 pm »
Jaime,

You are right. My examples were misleading in their scope. What I really want is my UML model to be an extensible repository where new extensions can be accomplished by extending the profiles rather than the individual model elements.

gsparks

  • EA User
  • **
  • Posts: 325
  • Karma: +0/-0
  • I love YaBB 1 Gold!
    • View Profile
Re: Setting default tagged values
« Reply #9 on: October 31, 2002, 04:56:35 am »
Hi,

Im presuming the 'Synchronize' profile tags option would still be a useful addition. If a profile changes slightly - it would be nice to automatically synch the items already stereotyped. Whether you use Profiles or not in certain cases is probably a different matter.

I will add it to the feature request list,

Cheers,
Geoff Sparks


Chris_Reynolds

  • EA User
  • **
  • Posts: 25
  • Karma: +0/-0
  • Poets have been curiously silent about cheese.
    • View Profile
Re: Setting default tagged values
« Reply #10 on: October 31, 2002, 11:14:45 am »
Thank you Geoff  :D :D :D

and whichever way I cut the time stamp of the last message, you should have been resting!

gsparks

  • EA User
  • **
  • Posts: 325
  • Karma: +0/-0
  • I love YaBB 1 Gold!
    • View Profile
Re: Setting default tagged values
« Reply #11 on: November 01, 2002, 06:00:14 pm »
Hi again,

Just a note to say that I have included a first cut of this function in the next build of EA (576) which will be out in a day or three. It is accessed on the right click menu for a profile item - and basically searches thru the model and adds any missing tags or constraints to the element of the correct profile type (link, object, attribute or operation) which have the profile stereotype. No tags or constraints are deleted or modified ... it is add only at the moment.

When the build is released, give it a try and let me know how it works out for you,

Geoff Sparks



Chris_Reynolds

  • EA User
  • **
  • Posts: 25
  • Karma: +0/-0
  • Poets have been curiously silent about cheese.
    • View Profile
Re: Setting default tagged values
« Reply #12 on: November 01, 2002, 09:16:42 pm »
You're wonderful.

Well if I'm ever in Australia and driving from Adelaide to Melbourne, I'll be sure to drop off a nice bottle from the Coonawarra.