SitePoint Sponsor

User Tag List

Results 1 to 5 of 5
  1. #1
    SitePoint Guru Galo's Avatar
    Join Date
    May 2005
    Location
    Holland!
    Posts
    852
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    UML Notations...

    Hey there,

    I had a question about UML notations, i was reading the specs of the CWM (Common Warehouse Model) and i noticed that they specify the attributes, and references. I work with PHP and the specs are based on client-side software, and my question was what do they mean with "references". and how would you implement them in a class.

    For example, they specify a class named "attributes", the attributes for this class is "kind" which is a string and has a multiplicity of zero or one.

    then they specify the references, now my point is i wouold make a variable for the "kind" attribute, but does this mean the references have to go into a variable as well, or do you have to specify actual references as methods in your class ?

    In the UML sheets the references are prefizxed with a slash "/", and i only know the +/-/# prefixes for the scopes.

    Dont know if anyone knows anything about this but i coudn't find it anywhere, and i already send an email to the OMG group but they don't help me either.

    Thanks in advance
    Business as usual is off the menu folks, ...

  2. #2
    eschew sesquipedalians silver trophy sweatje's Avatar
    Join Date
    Jun 2003
    Location
    Iowa, USA
    Posts
    3,749
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hard to tell exactly from your description, but it sounds like your basic aggregation, e.g. one object with an attribute (class variable) which is an instance of another class. This attribute is then holding a reference to the other object.

    Here are a few links I have collected on UML http://del.icio.us/sweatje/uml

    HTH
    Jason Sweat ZCE - jsweat_php@yahoo.com
    Book: PHP Patterns
    Good Stuff: SimpleTest PHPUnit FireFox ADOdb YUI
    Detestable (adjective): software that isn't testable.

  3. #3
    SitePoint Addict been's Avatar
    Join Date
    May 2002
    Location
    Gent, Belgium
    Posts
    284
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quickly about '/':

    '/' indicates a calculated (and thus read only) property, how this has to be mapped to messages should be clarified in some kind of style guide.
    For example:
    Code:
          /property [1] : Type --->   getProperty() : Type (null not allowed)
          /property [0..1] : Type ---> getProperty() : Type (null allowed)
          /property [n..m] : Type ---> getProperties() : Set<Type>
          (where n >= 0 and m > 1)    hasProperty(type : Type) : bool
    Note that this kind of mapping can only be used if the meta model in design stage supports genericity (because of the use of Set<Type>)

    I'm sorry, I tried very hard to make a readable 2 column layout for the mapping, unfortunately, vBulletin keeps screwing it up
    Per
    Everything
    works on a PowerPoint slide

  4. #4
    SitePoint Guru Galo's Avatar
    Join Date
    May 2005
    Location
    Holland!
    Posts
    852
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by sweatje
    Hard to tell exactly from your description, but it sounds like your basic aggregation, e.g. one object with an attribute (class variable) which is an instance of another class. This attribute is then holding a reference to the other object.

    Here are a few links I have collected on UML http://del.icio.us/sweatje/uml

    HTH
    So it's not a literal "reference" through the & prefix before a variable/parameter/method within the PHP language but more like a dispatcher if i understand you correctly, in this case the constraints would make more sense to me as well....

    Quickly about '/':

    '/' indicates a calculated (and thus read only) property, how this has to be mapped to messages should be clarified in some kind of style guide.
    For example:

    Code:

    /property [1] : Type ---> getProperty() : Type (null not allowed)
    /property [0..1] : Type ---> getProperty() : Type (null allowed)
    /property [n..m] : Type ---> getProperties() : Set<Type>
    (where n >= 0 and m > 1) hasProperty(type : Type) : bool

    Note that this kind of mapping can only be used if the meta model in design stage supports genericity (because of the use of Set<Type>)

    I'm sorry, I tried very hard to make a readable 2 column layout for the mapping, unfortunately, vBulletin keeps screwing it up
    Don't bother i see your point but would this actually mean some kind of sub-language/structure in which this style guyide is produced for a particulair instance ?

    Anyway good thoughts though, i'll try to refer them to my local class structure and see if could work out

    Thanks ppl,
    Business as usual is off the menu folks, ...

  5. #5
    SitePoint Addict been's Avatar
    Join Date
    May 2002
    Location
    Gent, Belgium
    Posts
    284
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Galo
    would this actually mean some kind of sub-language/structure in which this style guyide is produced for a particulair instance ?
    Not really, it's more of an agreement, a bit like a coding style guideline if you will, as long as everybody involved can make sense of it, I guess you'll be OK
    It is important though, that you choose the mapping so that it doesn't become a hastle in the implementation stage. Like the example I gave with the genericity; if your implementing programming language doesn't support template classes, that would be a bad choice.

    Off Topic:

    Edit: Cool, after 3 years, I finally became an addict
    Per
    Everything
    works on a PowerPoint slide


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •