How to model "virtual" attributes and methods in UML


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 3 of 3

Thread: How to model "virtual" attributes and methods in UML

  1. #1
    Larry Hayashi Guest

    How to model "virtual" attributes and methods in UML


    I posted this on the enterprise.general list as well but thought it might
    be more appropriate here:

    I was wondering if anyone out there with experience in UML could help me
    with
    the following problem:

    In our old OO modeling paradigm we had what we called virtual attributes
    on classes. These were attributes that could be calculated on the basis of
    values of other attributes, associations and attribute values on classes
    related by association. . This kind of attribute does not physically store
    information, but calculates information whenever it is accessed. For example,
    in a OO system of people in a community, children, brothers, sisters, and
    grandparents can be virtual attributes since they can be calculated by the
    system based on the mother and/or father attributes. In our implementation,
    a virtual attribute was to never change the state of the database. It simply
    made a calculation and returns one or more objects.

    In our older system, we also had methods. Methods changed the state of the
    database. Examples of methods in the above example might include "deletePerson",
    etc.

    So here's my question. In UML, I just want to model the names of and description
    of certain virtual attributes and methods. I don't want to code them as that
    will be implementation specific. I presume that the equivalent of virtual
    attribute in UML is an operation but I am not sure. And I am not sure if
    a method would also be an operation. I believe so for both. Some confirmation
    would be reassuring.

    Thanks for any guidance given!

    Larry


  2. #2
    Larry Hayashi Guest

    Re: How to model "virtual" attributes and methods in UML


    I've been playing around with operations since I wrote my first post yesterday.
    They do not seem to have all the properties I need to define. For example,
    if I have a virtual attribute of "siblings", I would look to parents attribute
    and find out through backreferences who the other children of those parents
    are. I might want to calculate these as ordered ...from oldest to youngest
    sibling. It seems to me that this more like an association but the data is
    not stored. Is there a way to represent this in UML?

    Thanks again for guidance you might have!

    Larry

    "Larry Hayashi" <larry_hayashi@hotmail.com> wrote:
    >
    >I posted this on the enterprise.general list as well but thought it might
    >be more appropriate here:
    >
    >I was wondering if anyone out there with experience in UML could help me
    >with
    >the following problem:
    >
    >In our old OO modeling paradigm we had what we called virtual attributes
    >on classes. These were attributes that could be calculated on the basis

    of
    >values of other attributes, associations and attribute values on classes
    >related by association. . This kind of attribute does not physically store
    >information, but calculates information whenever it is accessed. For example,
    >in a OO system of people in a community, children, brothers, sisters, and
    >grandparents can be virtual attributes since they can be calculated by the
    >system based on the mother and/or father attributes. In our implementation,
    >a virtual attribute was to never change the state of the database. It simply
    >made a calculation and returns one or more objects.
    >
    >In our older system, we also had methods. Methods changed the state of the
    >database. Examples of methods in the above example might include "deletePerson",
    >etc.
    >
    >So here's my question. In UML, I just want to model the names of and description
    >of certain virtual attributes and methods. I don't want to code them as

    that
    >will be implementation specific. I presume that the equivalent of virtual
    >attribute in UML is an operation but I am not sure. And I am not sure if
    >a method would also be an operation. I believe so for both. Some confirmation
    >would be reassuring.
    >
    >Thanks for any guidance given!
    >
    >Larry
    >



  3. #3
    Tim Ellison Guest

    Re: How to model "virtual" attributes and methods in UML

    Just a suggestion, but in the analysis model, you could do the following:

    use the stereotype "<virtual property>" or simply "<virtual>". Doing this,
    it needs to be well understood by your team what this stereotype implies.



    "Larry Hayashi" <larry_hayashi@hotmail.com> wrote in message
    news:3c470541$1@147.208.176.211...
    >
    > I've been playing around with operations since I wrote my first post

    yesterday.
    > They do not seem to have all the properties I need to define. For example,
    > if I have a virtual attribute of "siblings", I would look to parents

    attribute
    > and find out through backreferences who the other children of those

    parents
    > are. I might want to calculate these as ordered ...from oldest to youngest
    > sibling. It seems to me that this more like an association but the data is
    > not stored. Is there a way to represent this in UML?
    >
    > Thanks again for guidance you might have!
    >
    > Larry
    >
    > "Larry Hayashi" <larry_hayashi@hotmail.com> wrote:
    > >
    > >I posted this on the enterprise.general list as well but thought it might
    > >be more appropriate here:
    > >
    > >I was wondering if anyone out there with experience in UML could help me
    > >with
    > >the following problem:
    > >
    > >In our old OO modeling paradigm we had what we called virtual attributes
    > >on classes. These were attributes that could be calculated on the basis

    > of
    > >values of other attributes, associations and attribute values on classes
    > >related by association. . This kind of attribute does not physically

    store
    > >information, but calculates information whenever it is accessed. For

    example,
    > >in a OO system of people in a community, children, brothers, sisters, and
    > >grandparents can be virtual attributes since they can be calculated by

    the
    > >system based on the mother and/or father attributes. In our

    implementation,
    > >a virtual attribute was to never change the state of the database. It

    simply
    > >made a calculation and returns one or more objects.
    > >
    > >In our older system, we also had methods. Methods changed the state of

    the
    > >database. Examples of methods in the above example might include

    "deletePerson",
    > >etc.
    > >
    > >So here's my question. In UML, I just want to model the names of and

    description
    > >of certain virtual attributes and methods. I don't want to code them as

    > that
    > >will be implementation specific. I presume that the equivalent of virtual
    > >attribute in UML is an operation but I am not sure. And I am not sure if
    > >a method would also be an operation. I believe so for both. Some

    confirmation
    > >would be reassuring.
    > >
    > >Thanks for any guidance given!
    > >
    > >Larry
    > >

    >




Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center