Book a Demo

Author Topic: Assigning a String data type to a Class attribute  (Read 4749 times)

apetosa

  • EA Novice
  • *
  • Posts: 14
  • Karma: +0/-0
    • View Profile
Assigning a String data type to a Class attribute
« on: April 10, 2011, 03:08:08 pm »
Hello, folks.

EA provides a number of primitive data types for Class attributes. I find myself needing to assign a String data type to an attribute, especially when I want to reproduce an existing model in EA. For example, ISO/IEC 11179-3, Figure 5, defines a "Contact" class with three attributes each of type "String".

What I've done in the past is to create a custom String class (i.e., a custom data type) within EA and used that as the basis of applying a String data type to some attribute. However, I do not provide the semantics for the String datatype, since I want it to be agnostic to a programming language. As I view it, String semantics are either Java-like or C-like. With the former, a String is a composite type and includes a count (i.e., String size). In the latter, String is a primitive type and terminates with a null character.

If I create a String class for the purpose expressed, is it best to create a String class with its language assignment to "<none>"? If so, are there an unintended consequences when executing model-driven transformations?


Regards,

Anthony

Paolo F Cantoni

  • EA Guru
  • *****
  • Posts: 8626
  • Karma: +259/-129
  • Inconsistently correct systems DON'T EXIST!
    • View Profile
Re: Assigning a String data type to a Class attrib
« Reply #1 on: April 10, 2011, 07:36:31 pm »
Hi Anthony,

Why not create a language called "Conceptual" or "Logical".  You can define (as I have done) a type String there.  It's better than <none> because then you have a specific target.

Export one of the existing languages as an XML and edit the XML keeping the datatypes you are interested in.

Are you using edition 2 or edition 3 of ISO11179-3?

If you contact me off-line I can send you my "Conceptual" language definitions.

HTH,
Paolo
Inconsistently correct systems DON'T EXIST!
... Therefore, aim for consistency; in the expectation of achieving correctness....
-Semantica-
Helsinki Principle Rules!

apetosa

  • EA Novice
  • *
  • Posts: 14
  • Karma: +0/-0
    • View Profile
Re: Assigning a String data type to a Class attrib
« Reply #2 on: April 11, 2011, 04:24:53 am »
I'm using the 2nd edition of ISO/IEC 11179. Thanks, Paolo. I will contact you off-line.