Book a Demo

Author Topic: Setting (default) Available DataTypes for Attributes of a Class in a Package  (Read 6676 times)

chrisfcarroll

  • EA Novice
  • *
  • Posts: 2
  • Karma: +0/-0
    • View Profile
I have created a Package for a domain model and set its Language to <none>. I create a diagram in the package and set its language to <none> as well.

I create a Class by dragging from the toolbox to the diagram. I want the datatypes available for the attributes of the class to be the UML profile datatypes (Boolean, Integer, String etc) but mostly the datatypes available look like C or Java : boolean, byte, double, char etc.

(1) How do I get new classes to default to the language of the Package or the diagram?

(2) How do I get an existing class to offer me UML datatypes for its attributes?

Concerning question 2: I can see that if I set a class's language to C# and then click off the class and click on it again I am then offered C# language datatypes for the attributes. But I see nothing I can do to get the UML datatypes. Setting language to <none> or to blank doesn't have any effect.


EA 14 Professional
« Last Edit: July 02, 2021, 01:17:22 am by chrisfcarroll »

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +397/-301
  • I'm no guru at all
    • View Profile
The datatypes are language agnostic. They are defined in UML itself.

q.

chrisfcarroll

  • EA Novice
  • *
  • Posts: 2
  • Karma: +0/-0
    • View Profile
Ah. So if language is a red herring, I am still left looking for what determines that dropdown of datatypes for an Attribute.

It certainly looks — https://imgur.com/gallery/DddQy74 — language-centric?



qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +397/-301
  • I'm no guru at all
    • View Profile
Not sure about that, but when you deal with databases you can indeed set specific datatypes. There's some setting in EA but I don't remember where. EA is not straight in various aspects. Maybe you wait for a Sparxian to explain it...

q.

Modesto Vega

  • EA Practitioner
  • ***
  • Posts: 1183
  • Karma: +30/-8
    • View Profile
Just a few comments:
  • All out-of-the-box datatypes in Sparx are language or database centric - i.e., C++, C#, Java, SQL Server, Oracle, PostgreSQL, and so on
  • Out-of-the box Sparx does not have a language profile supporting UML primitive types
  • It is possible to create language profiles in Sparx, including what I often referred to as a canonical language, a language of canonical - i.e., implementation independent - data types. To create a new set of data types go to Configure/Settings/Coding Datatypes, add a new product and create all the data types you need

One other point in UML data types are an element. This is not the way Sparx currently implements data types but you could also use this approach.

philchudley

  • EA User
  • **
  • Posts: 750
  • Karma: +22/-0
  • EA Consultant / Trainer - Sparx Europe
    • View Profile
To set the global language to <none> for all elements especially classes:

1) Click the Portal in the Ribbon
2) Select Toolbars -> Code Engineering from the the menu


This will display a floating toolbar which you can dock to a suitable position, once docked, select <none> from the first drop down list.

The second drop down list will allow to set the target DBMS for table elements.

NOTE: this setting will one affect new elements ... existing elements will still have their original default language (usually Java)

Then when adding attributes to a class element using the Features window, you can set the attribute type to one of the UML primitives (String, Boolean, Integer, Real, Unlimited Natural) which are now in the drop down list.

Also  note the default type for any attribute is int regardless on language setting. But can be changed as stated above.

Phil
Models are great!
Correct models are even greater!

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +397/-301
  • I'm no guru at all
    • View Profile
You might run a query in the SQL scratchpad:
Code: [Select]
SELECT * from t_datatypesThat might give you an idea. (Actually I never needed to care about these datatypes so I'm pretty lost here)

q.