Book a Demo

Author Topic: Tagged Value Types - default values  (Read 4348 times)

Paolo F Cantoni

  • EA Guru
  • *****
  • Posts: 8626
  • Karma: +259/-129
  • Inconsistently correct systems DON'T EXIST!
    • View Profile
Tagged Value Types - default values
« on: September 20, 2009, 02:10:32 pm »
Some Tagged Value types (such as Enum) have the ability to specify default values.

I guess all Tagged Values Types are equal, but some are more equal than others...  ;)

ALL Tagged Value Types should have the ability to specify a default value.

Reported,
Paolo
« Last Edit: September 20, 2009, 09:25:32 pm by PaoloFCantoni »
Inconsistently correct systems DON'T EXIST!
... Therefore, aim for consistency; in the expectation of achieving correctness....
-Semantica-
Helsinki Principle Rules!

«Midnight»

  • EA Guru
  • *****
  • Posts: 5651
  • Karma: +0/-0
  • That nice Mister Grey
    • View Profile
Re: Tagged Value Types - default values
« Reply #1 on: September 20, 2009, 09:14:03 pm »
Or at least some explicit way to define an absence of value.
No, you can't have it!

Paolo F Cantoni

  • EA Guru
  • *****
  • Posts: 8626
  • Karma: +259/-129
  • Inconsistently correct systems DON'T EXIST!
    • View Profile
Re: Tagged Value Types - default values
« Reply #2 on: September 20, 2009, 09:29:42 pm »
Quote
Or at least some explicit way to define an absence of value.
Well actually, I was looking for a way to save a few clicks each time.  Many of my (boolean) Tagged Values use the pattern that if the Tagged Value is missing, then it implies false.  Consequently, If I decide to add it, it generally ends up with a value of true.  So being able to specify a default save a few clicks each time.  It DOES mount up...

However, your point about being able to also specify an absence of value is well taken.  I've already left a pointer back to this topic in the report so hopefully Sparx will incorporate that.

It's about extrinsic values...

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

«Midnight»

  • EA Guru
  • *****
  • Posts: 5651
  • Karma: +0/-0
  • That nice Mister Grey
    • View Profile
Re: Tagged Value Types - default values
« Reply #3 on: September 21, 2009, 06:47:08 am »
Methinks Paolo says it better than I...
No, you can't have it!

Paolo F Cantoni

  • EA Guru
  • *****
  • Posts: 8626
  • Karma: +259/-129
  • Inconsistently correct systems DON'T EXIST!
    • View Profile
Re: Tagged Value Types - default values
« Reply #4 on: September 23, 2009, 11:16:25 am »
I've received some good news from Sparx:


While the "Predefined Structured Types" help page only mentions the default value for Enum types, it seems the "Default=...;" format can be used to apply default values for any Tagged Value Type.  For example, the following definition applies a default value of "False"...

Type=Boolean;
Default=False;

I will request that the help be updated.  If you find the default does not work for any specific types please let us know.

So there you have it folks...  If you come across any specific types fort which the default doesn't work, let Sparx know... (referencing this Topic).

This news also helps with: New Tagged Value dialog - EAUI  since with the ability to specify the most common default (and in the case of many of my booleans the ONLY value) I can very significantly reduce the number of mouse-clicks required.

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