Book a Demo

Author Topic: Object State - name rendering  (Read 5729 times)

Paolo F Cantoni

  • EA Guru
  • *****
  • Posts: 8626
  • Karma: +259/-129
  • Inconsistently correct systems DON'T EXIST!
    • View Profile
Object State - name rendering
« on: October 24, 2006, 01:34:52 pm »
In a recent post: [size=13]NewBie question[/size]  I mentioned setting the object state using the context menu dialog [Ctrl+Shift+S].  On that dialog is a check-box:  [ ] Merge State with Instance name.

If the name of the Instance is empty, the Classifier is Order, the state is Paid and the checkbox is unset then the rendering is:
: Order
[Paid]


if you set the check-box, then the rendering is:
: [Paid] : Order]

if you add a name for the instance say "Order", you get:
Order[Paid] : Order
where the state is postfixed to the name.

In the other post, I manually set the name to:
PaidOrder and UnpaidOrder

But it seems to me a more general rule that says
when constructing a name for the instance. the most common renderings would be:
[State]Classififer or Classifier[State]
Example: [Paid]Order  or Order[Unpaid]

I think it would be a time saver (and increase consistency) if the [ ] Merge State with Instance name were enhanced with:
[ ] Prefix (else Postfix) and [ ] Use Classifier Name
If both were set, in the above example we'd get:
[Paid]Order: Order

Lastly, a checkbox [ ] Suppress State markers would suppress the enclosing "[" and "]" for the state giving:
PaidOrder: Order.

Thoughts?
Paolo
[size=0]©2006 Paolo Cantoni, -Semantica-[/size]
Inconsistently correct systems DON'T EXIST!
... Therefore, aim for consistency; in the expectation of achieving correctness....
-Semantica-
Helsinki Principle Rules!

jeshaw2

  • EA User
  • **
  • Posts: 701
  • Karma: +0/-0
  • I'm a Singleton, what pattern are you?
    • View Profile
Re: Object State - name rendering
« Reply #1 on: November 08, 2006, 06:08:44 pm »
Paolo said:
Quote
Lastly, a checkbox [ ] Suppress State markers would suppress the enclosing "[" and "]" for the state giving:
PaidOrder: Order.

I think without the state markers, PaidOrder and UnpaidOrder would be taken as two different orders instead of two states of the same order.  Otherwise, I like what you are suggesting.  I'm wondering on which diagrams you would normally include the state notation on an object?  For example, I don't think it would be used on a Composite Structure diagram.  :-/  

Does the Superstructure Document speak to this type of state notation?
Verbal Use Cases aren't worth the paper they are written upon.

«Midnight»

  • EA Guru
  • *****
  • Posts: 5651
  • Karma: +0/-0
  • That nice Mister Grey
    • View Profile
Re: Object State - name rendering
« Reply #2 on: November 09, 2006, 04:15:46 am »
I agree Jim,

Unfortunately I don't know what the superstructure spec says either, and don't have time to look.

The Sparx folks certainly do know, so let's see if they either answer - there might be a good reason for the status quo - or make some changes.

David
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: Object State - name rendering
« Reply #3 on: November 09, 2006, 05:39:20 am »
Quote
I think without the state markers, PaidOrder and UnpaidOrder would be taken as two different orders instead of two states of the same order.  Otherwise, I like what you are suggesting.  I'm wondering on which diagrams you would normally include the state notation on an object?  For example, I don't think it would be used on a Composite Structure diagram.  :-/

Does the Superstructure Document speak to this type of state notation?
In higher order models you can mark PaidOrder and UnpaidOrder as «inferred» objects (see: [size=13]Inferred UML elements[/size]) this alerts you to the fact that these objects are merely expository.

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

Paolo F Cantoni

  • EA Guru
  • *****
  • Posts: 8626
  • Karma: +259/-129
  • Inconsistently correct systems DON'T EXIST!
    • View Profile
Re: Object State - name rendering
« Reply #4 on: January 14, 2007, 05:00:03 pm »
Just got back to this again...

When you select [X] Merge State with Instance name, the state is immediately abutted with the name.  This causes wrap propblems.  Perhaps the leading "[" could be added as a wrapping point?

Actually, if the name already contains a space, then there should be a space prior to the "[".  Even better, an [  ] Add space separator checkbox would be better still (Defaulting to true of there's already a space in the Object name.

Thoughts? Votes?
Paolo
[size=0]©2007 Paolo Cantoni, -Semantica-[/size]
Inconsistently correct systems DON'T EXIST!
... Therefore, aim for consistency; in the expectation of achieving correctness....
-Semantica-
Helsinki Principle Rules!

jeshaw2

  • EA User
  • **
  • Posts: 701
  • Karma: +0/-0
  • I'm a Singleton, what pattern are you?
    • View Profile
Re: Object State - name rendering
« Reply #5 on: January 16, 2007, 10:48:13 pm »
Quote
Perhaps the leading "[" could be added as a wrapping point?
I like this option best; I don't want to think about wrapping issues and check boxes as I develop a model.
Verbal Use Cases aren't worth the paper they are written upon.