Click here to Skip to main content
Click here to Skip to main content

OOP and UML

By , 20 Jun 2000
 

OOP and UML

Introduction

The purpose of this document is to provide you with information about UML and how to use it.

What is UML?

UML, Unified Modeling Language, is a standard notation for the modeling of real-world objects as a first step in developing an object oriented program. It describes one consistent language for specifying, visualizing, constructing and documenting the artifacts of software systems.

Why model?

Developing a model for a software system before you actually start programming the software, can be seen as having a blueprint for a large building you want to build. It is essential to have one. Although this doesn’t mean that you have to draw a model each time a simple class is introduced in your software. You have to think for yourself whether you want a model or not.

A few notation-rules

Graphs and their contents

Most UML diagrams are graphs containing nodes connected by paths. The information is mostly in the typology, not in the size or placement of the symbols. There are three kinds of visual relationships that are important:

  1. Connection (usually lines)

  2. Containment (2D shapes with boundaries)
  3. Visual attachment (one object being near another)

    UML notation is intended to be drawn on a 2D surface.

    There are basically four kinds of graphical constructs used in the UML notation:

    1. Icons – an icon is a graphical figure of a fixed size and shape. It does not expand to hold contents. Icons may appear within area symbols, as terminators on paths or as standalone symbols that may or may not be connected to paths

    2. 2D symbols – Two dimensional symbols have variable length and width and they can expand to hold other things, such as lists, strings or other symbols. Many of them are divided into compartments of similar or different kinds. Dragging or deleting a 2D-symbol affects its contents and any paths connected to it.

    3. Paths – Sequences of line segments whose endpoints are attached. Conceptually, a path is a single topological entity, although its segments may be manipulated graphically. A segment may not exist apart from his path. Paths are always attached to other graphic symbols at both ends (no dangling lines). Paths may have terminators, which are icons that appear in some sequence on the end of the path and that qualify the meaning of the path symbol.

    4. Strings – Present various kinds of information in an "unparsed" form. UML assumes that each usage of a string in the notation has a syntax by which it can be parsed into underlying model information. For example, syntaxes are given for attributes, operations and transitions. Strings may exist as singular elements of symbols or compartments of symbols, as elements in a list as labels attached to symbols or paths, or as stand-alone elements in a diagram.

Relationships

Attributes and behavior

Each object has various attributes. An attribute is a name/value pair. For example, my age is 22. The attribute name is "age", the value is "22". Objects also have behavior. I can stand, walk, sleep etc.

Relationships

There are different kinds of relationships:

Dependency is where one object must know about another.

In a simple dependency relationship, all we know is that one object has knowledge of another. For example: if one class requires the inclusions of the header for another, that establishes a dependency.

We draw a dependency using a dashed arrow. If a depends on b be sure the arrow points at b.

In association, the state of the object depends on another object.

In an association we say that, as part of understanding the state of one object, you must understand the relationship with the second object. There are many types of association which model real-world relationships, such as owns (Arjen owns this bike), works for (Raymond works for Harry) and so forth.

In an association the two objects have a strong connection, but neither one is a part of the other. The relationship is stronger that dependency; there is an association affecting both sides of the relationship.

An association between a and b is shown by a line joining the two classes:

If there is no arrow on the line, the association is taken to be bi-directional. A unidirectional association is indicated like this:

To improve the clarity of a class diagram, the association between two objects may be named:

Aggegration models the whole/part relation

Objects are often made up of other objects. Cars are made up of steering wheels, engines, transmissions and so forth. Each of these components may be an object in its own right. The special association of a car to its compoment parts is known as aggegration.

An aggregation relationship is indicated by placing a white diamond at the end of the association next to the aggregate class. If b aggregates a, then a is a part of b, but their lifetimes are independent:

Composition models a relationship in which one object is an integral part of another.

Often, the component parts of an object spring into existence only with the entire object. For example, a person may consist of a number of parts including the heart, lungs etc. If you were modeling a person, the lifetime of the heart and lungs would be directly controlled by the lifetime of the aggregating person.We call this special relationship composition.

In aggregation, the parts may live independently. While my car consists of its wheels and tires and radio, each of those components may have existed before the car was created. In composition, the lifetime of the contained object is tied to the lifetime of the containing object.

Composition is shown by a black diamond on the end of association next to the composite class. If b is composed of a, then b controls the lifetime of a.

Inheritance

Inheritance is a specialization/generalization relationship between objects.

We (humans) have inherited the ability to create categories based on the behavior and characteristics of the things in our environment. This is best shown with an example: If something breathes and moves, we say it’s an animal. If one of those things that move and breathe also has live young and nurses them, we say it’s a mammal. We know that mammals are kinds of animals, and so we can predict that if we see a mammal, it will in all likelihood breathe and move around.

If a mammal barks and wags its tail, we say it’s a dog. If it won’t stop barking and runs about our feet demanding attention, we figure it’s a terrier. Each of these classifications gives us additional information. When we’re done, we have created a hierarchy of types.

Some animals are mammals and some are reptiles. Some mammals are dogs and some are horses. Each type will share certain characteristics, and that helps us understand them and predict their behavior and attributes.

There is only one right way to draw this:

Once we have this categorization, we can see that reading up the animal hierarchy reveals the generalization of shared characteristics.

In the same way, we could create a model of a car. To do so, we must ask ourself some questions:

What is a car? What makes a car different from a truck, from a person, from a rock? One of the delights of object oriented programming is that these questions become relevant to us; understanding how we perceive and think about the objects in the real world directly relates to how we design these objects in our model.

From one perspective, a car is the sum of its parts: steering wheel, brakes, seats, headlights. Here, we are thinking in terms of aggregation. From a second perspective, one that is equally true, a car is a type of vehicle.

Because a car is a vehicle, it moves and carries things. That is the essence of being a vehicle. Cars inherit the characteristics moves and carries things from their "parent" type, which is "vehicle".

We also know that car specializes vehicles. They are a special kind of vehicle, one which meets the federal specifications for automobiles.

We can model this relationship with inheritance. We say that the car type inherits publicly from the vehicle-type; that a car is-a vehicle.

Public inheritance establishes a is-a relationship. It creates a parent class (vehicle) and a derived class (car) and implies that the car is a specialization of the type vehicle. Everything true about a vehicle should be true about a car, but the converse is not true. The car may specialize how it moves, but it ought to move.

What is a motor vehicle? This is a different specialization, at a different level of abstraction. A motor vehicle is any vehicle driven by a motor. A car is one such type, a truck is another. We can model these more complex relationships with inheritance as well.

Which model is better? Depends on what you’re modeling! How do you decide which model you want to use? Ask yourself questions. Is there something about "Motor Vehicle" I want to model? Am I going to model other, non-motorized vehicles? If you do, you should use the second model. To show this with an example: Suppose you want to create two classes for vehicles which are horse-drawn.

Public inheritance

A critical aspect of public inheritance is that it should model specialization/generalization, and nothing else! If you want to inherit implementation, but are not establishing an is-a relationship, you should use private inheritance.

Private inheritance establishes an implemented-in-terms-of rather than an is-a relationship.

Multiple inheritance

One of the capabilities available in C++, is multiple inheritance. Multiple inheritance allows a class to inherit from more than one base class, bringing in the members and methods of two or more classes.

In simple multiple inheritance, the two base classes are unrelated. And example of multiple inheritance is shown below. Also notice how the functions are displayed in this model.

In this rather simple model, the Griffin class inherits from both Lion and Eagle. This means a Griffin can eatMeat(), roar(), squawk() and fly(). A problem arises when both Lion and Eagle share a common base class, for example Animal.

This common base class, Animal, may have methods of member variables which Griffin will now inherit twice. When you call Griffin’s Sleep() method, the compiler will not know which Sleep() you wish to invoke. As the designer of the Griffin class, you must remain aware of these relationships and be prepared to solve the ambiguities they create. C++ facilitates this by providing virtual inheritance.

Without virtual inheritance

With virtual inheritance

With virtual inheritance, Griffin inherits just one copy of the members of Animal, and the ambiguity is solved. The problem is that both Lion and Eagle classes must know that they may be involved in a multiple inheritance relationship; the virtual keyword must be on their declaration of inheritance, not that of Griffin.

Aggregation

Using multiple inheritance when you need aggregation

How do you know when to use multiple inheritance and when to avoid it? Should a car inherit from steering wheel, tire and doors? Should a police car inherit from municipal property and vehicle?

The first guideline is that public inheritance should always model specialization. The common expression for this is that inheritance should model is-a relationships and aggegration should model has-a relationships.

Is a car a steering wheel? Clearly not. You might argue that a car is a combination of a steering wheel, a tire and a set of doors, but this is not modeled in inheritance. A car is not a specialization of these things; it’s an aggregation of these things. A car has a steering wheel, it has doors and it has tires. Another good reason why you should not inherit car from door is the fact that a car usually has more than one door. This is not a relationship that can be modeled with inheritance.

Is a police car both a vehicle and a municipal property? Clearly it is both. In fact, it specializes both. As such, multiple inheritance makes a lot of sense here:

Base classes and derived classes

Derived classes should know who their base class is, and they depend on their base classes. Base classes, on the other hand, should know nothing about their derived classes. Do not put the header for derived classes into your base class files.

You want to be very suspicious of any design that calls for casting down the inheritance hierarchy. You cast down when you ask a pointer for it’s "real" (run-time) class and then cast that pointer to the derived type. In theory, base pointers should be polymorphic, and figuring out the "real" type of the pointer and calling the "right" method should be left to the compiler.

The most common use of casting down is to invoke a method that doesn’t exist in the base class. The question you should be asking yourself is why you are in a situation where you need to do this. If knowledge of the run-time type is supposed to be hidden, then why are you casting down?

Single instance classes

You also want to be very aware of derived classes for which there is always only one instance. Don’t confuse it with a singleton, in which the application only needs a single instance of a type, for example only one document or only one database.

Drawing a class

Displaying members

Suppose you want to create a class CFloatPoint, which has two members: x and y, which are both of type ‘float’, and a function "Empty()" which resets both members to value 0.00000.

First of all, you draw the class itself:

Now, we want the members x and y to be visible in the model:

As you can see, x and y are both private (lock-sign) and have the type "float".

Now, we want to make the function Empty() visible in the model:

Notes

Suppose you need to give some additional information about your class. You can easily do this with adding a note, which looks like this:

Conclusion

Software used

Visual modeler

Keep in mind that these models are created with Visual Modeler, which is delivered with Visual Studio Enterprise Edition, so you can try and draw them yourself. I’m not going to explain how Visual Modeler works here, look in the manual or MSDN Library for more information.

Future versions of this document

I think this document is a good step in OOP and UML. Together with the document " Different styles of Programming " they provide a good first-step tutorial in the world of Object Oriented Programming.

There are many features of UML which are not covered in this document. One of them are so-called "use-cases" which is a story on its own. This will be explained in a new document which has yet to be written at this moment.

Alex Marbus

Bibliography

License

This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here

About the Author

Alex Marbus
Netherlands Netherlands
Member
No Biography provided

Sign Up to vote   Poor Excellent
Add a reason or comment to your vote: x
Votes of 3 or less require a comment

Comments and Discussions

 
You must Sign In to use this message board.
Search this forum  
    Spacing  Noise  Layout  Per page   
GeneralAggregation arrows wrong direction ?memberlordmonkeycode1 Aug '12 - 23:46 
In Aggregation paragraph I think that the directions of aggregation arrows are wrong - the diamonds should be placed next to the car. Am i right ?
GeneralRe: Aggregation arrows wrong direction ?membersapramit24 Mar '13 - 17:45 
yes, you are correct,
GeneralMy vote of 5membermanoj kumar choubey30 Mar '12 - 3:27 
Nice
QuestionIs UML enought on it self to describe a programs working?memberIgen16 Oct '08 - 3:22 
Hi!
 
I have a halfly finished project but I haven't got much time to work on it on a daily bases. I wanted to find a way to document how it works before I forget it. So I dig out my programming book collection and red a pretty good UML teaching book. It describes in detail all 9 diagrams of the UML language. But uses mainly buisness examples.
 
My question is can I describe the inner workings of my classes somehow using UML or I have to use the old way? I know I can show how my classes looks like and how are they interact with eachother. Also can show the dataflow betveen them, but realy I don't find a way to represent the innerworkings of my functions on diagrams.
GeneralRequest responsememberjsundownr25 Dec '07 - 4:22 
Alex
 
I am in negotiations with a major UML tool developer to develop software documentation for their products.
 
If you are interested in short term contract employment please contact me. Maybe we can work out an equitable agreement for all concerned.
 
jsundownr@hotmail.com
 
sundownr

GeneralGood info pool [modified]memberNirosh9 Oct '06 - 20:21 
This is a good collection.. and it is even better if you wrote it answering to questions such as

1. why aggregation and composite, when association is there..
2. what is the importancy of interface, and when to use them..
etc ..
 
And also it is good if you could use some practical sample rather than going with those lazy traditional car samples..
 
Finaly, this gives the introduction to an article I wrote couple of days ago..
 
Refer to :http://www.codeproject.com/useritems/System_Design.asp
 

 

-- modified at 22:53 Saturday 2nd June, 2007
 
L.W.C. Nirosh,
Colombo,
Sri Lanka.

QuestionWhat does a modeler need to do?membercompiler21 Apr '06 - 19:36 
I'm working on a modeler for Windows Mobile devices (PocketPC and SmartPhones with pen input), and would like to add better (any) support for UML class, sequence and state diagrams. Anyone have some suggestions for what some "must have" features would be? Try it out here.
GeneralNice articlememberGanesh_NV31 May '05 - 20:57 
Thanks! Smile | :)
GeneralAggregation vs Compositionsusssankyuu3920 Apr '05 - 15:18 
The position of the diamond in the "car" example is wrong. It should be closer to the car, not to its parts.
Also, as noted by sonny-bob, Composition would be more appropriate, since SteeringWheel, Door and Tire are always parts of Car.

GeneralRe: Aggregation vs CompositionmemberNirosh15 Oct '06 - 22:20 
Yes you are correct about the position of the diamond, it is wrong.. and he is not correcting it either.. that is a very poor mistake..
 
but the second is wrong.. composition is not appropriate to show the relation in between car and SteeringWheel, Door and Tire. You may not have seen a car with out a door but I have ..
 
let me ask a question,, does the wheel form a car or does a tire form a car or does a door form a car.. if the answer is no.. then you cannot say the relation is a composition .. the bastest sample I can find from the physical world to show the composition is
 
House - Room..
 

 
L.W.C. Nirosh,
Colombo,
Sri Lanka.

GeneralOOP and UMLmembersonny-bob9 Apr '05 - 0:20 
Fantastic article. However, I like to point a few things out:
A car is a "Composition" of Steering Wheel, Door, and Tires. Have you ever seen a car without a Steering Wheel or a Door or a Tires? Therefore the shaded diamond sign (Composition) is approprite for this one, and not the aggregation, as you have illustrated.
Cool | :cool:
Generalimplemting UML in C++memberJain Mohit21 Jun '04 - 23:53 
Congrats for the great article, but, I have been through such conceptual articles, but still have some issues when it comes down to representing C++ class in UML.. i especially have problmes in scenarios like:
class A
{
}
 
class B:public A
{
}
 
class C
{
 
public:
A *m_ptrA;
}

Here, its for sure, straight away inheritance relation ship between A and B, but, what kind of relation ship does C have with A (or B) since, m_ptrA can actually point to one or more elements of A or B.
If you can guide me on this, it would be real help.
GeneralCongratsmemberKeny31 Jul '03 - 19:31 
Your article is indeed a great tutorial of UML and OOP concepts.Smile | :)
 
I have only one remark: it seems that there is a little diffence between the sense of the aggregate/composition arrows in the definition and in the example.
 
Would be great if you could extend to cover other UML diagrams.

 
Keny ORDAZ
Better programming language for AI? I have my questions, but succeeding in programming with C++ does make me feel intelligent.
GeneralC++ code to draw a diamondsussAnonymous12 Nov '02 - 13:47 
Can u please help me write the c++ code to draw out a diamond?
GeneralRe: C++ code to draw a diamondsussAnonymous22 Jan '03 - 22:22 
give me a programm for creating a diamond in c++
JokeRe: C++ code to draw a diamondmembergermin10 Oct '06 - 18:51 
Once some one give him that program.. I like to get a program that create Gold, Platinum, and any Gem for me..
 
G
Generaltopological sortingsussdonhuthanh22 Oct '02 - 20:59 
Help me about topological sorting and source code of Csharp(C#.Net).Thanks
Questionummm.. if I override MFC functions?memberEpon11 Oct '02 - 19:44 
To design UML Class Diagram, it's easy to implement self-design classes.
But if I'd like to create MFC objects in my own classes,overriding it's function, how should I write it down in my design prototype? Is it neccessary to include the diagram with MFC? Confused | :confused:
GeneralGetting startmemberReza Azizi23 Sep '02 - 1:23 
Can you tell me how can I start UML?
Here there is no good article for UML.Cry | :((
My only reference is Internet.

GeneralRe: Getting startmemberEpon11 Oct '02 - 19:50 
Here I just read it too.
http://www.modelingstyle.info/
include all topics about what UML can do.
Questiongraphical construct consistency?sussAnonymous29 Aug '02 - 9:58 
The aggregate example for the car uses symbology that is reversed from the description above.. i.e. "wheels" are part of "car" and so the diamond should be drawn at the "car", with the arrow to the "wheel", correct? Confused | :confused:
AnswerRe: graphical construct consistency?sussNayden7 Jan '03 - 3:42 
Yes you are right
GeneralBeautiful articlesussSonnets24 Jul '02 - 6:28 
I am a student of S/w Engg. and have read quite a few articles and books on UML. But your article clears all concepts very easily. Worth a lot of appreciation. Am really looking forward for more of your articles on UML.
 
Also please mention the names of the books you have been referring for UML and C++. Smile | :)

GeneralRe: Beautiful articlememberAnthony_Yio2 Sep '02 - 22:56 
Agreed.
I read quite a number of UML books. None are having this much of clarity.
Short,simple and precise.
GeneralThanks, AlexmemberGary R. Wheeler8 Jun '02 - 0:56 
Thanks for the great intro to UML. I've always understood the underlying ideas, but couldn't get past the visual notation. To quote Oliver Twist: More please! Smile | :)
 
Gary R. Wheeler

GeneralTimetabling in VC++!!!!URGENT!!!memberMark Shian6 Jun '02 - 5:35 
HI EVERYONE,
I'm need to produce an examination scheduling system in Visual C++ within the next 3 weeks. If anyone has source codes or .dsw files i could use to learn how to develop this program. PLEASE HELP ME!!!!
 
Or if that's not possible,could anyone tell me what C++ concepts do i need to learn (i've got a few days only) in order to pull off not getting failed! Please tell me.
 
Thanks Everyone,
Shian

GeneralRe: Timetabling in VC++!!!!URGENT!!!memberDaniel Turini7 Aug '02 - 1:40 
Mark Shian wrote:
HI EVERYONE,
I'm need to produce an examination scheduling system in Visual C++ within the next 3 weeks. If anyone has source codes or .dsw files i could use to learn how to develop this program. PLEASE HELP ME!!!!
 
Or if that's not possible,could anyone tell me what C++ concepts do i need to learn (i've got a few days only) in order to pull off not getting failed! Please tell me.

 
If you pay, a lot of people could be interested in doing this, including me.
 

Concussus surgo.
When struck I rise.

Generalgood article, but i have a question-memberspoongirl9 May '02 - 5:25 
it seems like you kind of glossed over the idea of composition vs. aggregation; i'm a little confused about it.
 
is composition where basically one object is MADE up of something (for instance, say class Polygon is COMPOSED of instances of class Point and class Edge) whereas an aggregation is more like a group of related things? (say, class House is AGGREGATE of class Wall, class Roof, etc?) but isn't that pretty much the same thing as a composition?
 
I'm just not totally sure on the difference. would it be more correct to say a COMPOSITION is a group of all the same thing? like, if i defined class PointSet, consisting solely of Points?
 
thanx for writing this helpful article.
 
~L
GeneralRe: good article, but i have a question-memberjan larsen25 Jul '02 - 1:35 
No he actually cleared it up quite well:
In an Aggregation relationship the aggregated object is independant of the container, that is: when the container dies, the aggregated object may keep living.
In a Composition however the contained object is tied to the lifetime of the container.
Example:
class PlaneTicket
{
public:
   PlaneTicket(User * user)
   {
      this->m_ticketId = new TicketId();
      this->m_user     = user;
   }
 
   ~PlaneTicket()
   {
      delete this->m_ticketId;
   }
 
private:
   TicketId *    m_ticketId; // Composition relation.
   User *        m_user;     // Aggregation relation.
};      
 
In the example above you can see that m_user keeps existing when the PlaneTicket instance dies. The m_user could be designed to aggregate because you want to reuse an allready existing instance, and the m_ticketId as a composition because it really only is useable internally by PlaneTicket.
 
"It could have been worse, it could have been ME!" -Rincewind
Generalah- thanx for the explanationmemberspoongirl25 Jul '02 - 3:27 
now i get it.
GeneralActually better (self?) explanation for composition could be:memberKokeeno29 May '03 - 18:08 
class PlaneTicket
{
public:
PlaneTicket(User * user)
{
this->m_user = user;
}
 
private:
TicketId m_ticketId; // Composition relation.
User * m_user; // Aggregation relation.
};

 

 
Live For The Moment
Generalurgentmemberaris puji widodo4 May '02 - 6:40 
I need a project with UML in java and c++.
I need source code (FSA-scanner)lexical analysis for pascal language. This is for my class of software ing . i need that urgent
please
 
thank you
 
aris puji widodo
jl. tubagus ismail V no. 77/157-D
bandung Indonesia.
masarisdong@yahoo.com

GeneralRe: urgentmemberAlexMarbus6 May '02 - 6:16 
I'm very sorry, but I can't help you with that.
 
--
Alex Marbus
www.marbus.net
But then again, I could be wrong.
Generalpointers or objectsmembersansingh3 May '02 - 4:00 
Hi alex,
I am always confused on whether to keep pointer or object of a class inside another class...can you explain it through a suitable exampleSmile | :)
GeneralRe: pointers or objectsmemberRejeesh.T.S6 May '02 - 7:36 
Even though the question is for Alex, I am trying to give an answer.
 

Consider an example of a class CTriangle, which has an array of CPoint, having size 3. Here the size is fixed because, we know the triangle is always having only 3 coordinates. In this case we need not use pointers since we know the limit of number of data members in advance.
 
But suppose we are writing a class to manipulate a polygon, say its name is CPoligon. Here we can’t fix the number of coordinate a polygon has. In such a case we can declare a pointer to CPoint as the member of CPolygon class so that we can dynamically decide the number of coordinates. The number of coordinates can be an input from the user.
 
Hope, now it is clear for you.
 
Regrads,
Rejeesh
GeneralRe: pointers or objectsmemberAnonymous7 May '02 - 1:16 
Thanks a lot rejeeshSmile | :) Smile | :)
Generalshape classmemberjdreamer30 Apr '02 - 2:22 
hi anyone have done this shape class before can u send it to me by email.
Generalsahep classmemberjdreamer30 Apr '02 - 2:21 
hi anyone have done this shape class before can u send it to me by email.
GeneralSequence DiagramsmemberTom Archer25 Apr '02 - 19:55 
Nice article! One great addition would be a section on sequence diagrams.
 
Cheers,
Tom Archer
Author, Inside C#
 
Please note that the opinions expressed in this correspondence do not necessarily reflect the views of the author.
GeneralRe: Sequence Diagramsmemberjan larsen25 Jul '02 - 1:37 
I agree!, usefull stuff that.
 
"It could have been worse, it could have been ME!" -Rincewind
GeneralSequence, states, deployment, and many othersmemberKokeeno29 May '03 - 18:11 
But it could be found in UML reference
(and it's also good to read some books about UDSP methodology - but better - to make some bigger project and compare efficiency with vs. without proper documentation Wink | ;) )...
 
Live For The Moment
GeneralI want to begin visual c and this is my questionmemberAnonymous21 Mar '02 - 10:08 
what is the needed information about c\c++ to begin visual_ c++?
i need the detailed answer if u please
GeneralC++ examples pleasememberFederico23 May '01 - 8:47 
Could you give me some examples of agregation, Relationship,composition, I mean the sourcode and the graphics so I can see how they really work.
 

Thanks in advance.
GeneralRe: C++ examples pleasememberbenj200212 Jan '02 - 21:41 
Federico wrote:
Could you give me some examples of agregation, Relationship,composition, I mean the sourcode and the graphics so I can see how they really work.
 
Composition: the car contains wheels, steering wheel
 
Class Car {
Wheel wheel1, wheel2, wheel3, wheel4;
SteeringWheel sw;
};
 
Aggregation: the car has an air freshener - but aggregation is a weaker relationship than composition - can live without:
 
class car {
airfreshener *af; // pointer so can be null??
bool hasairfreshener;
}
 
specialisation :
 
class car : public vehicle {
// stuff
}
 


GeneralRe: C++ examples pleasememberClim8 Apr '02 - 11:46 
The article would look much better if it were with examples.
The way it is represented in the article is just dry theory and it is really hard to get the idea and the meaning.
 
I would love to have the same article with examples and explanations in C++

GeneralRe: C++ examples pleasememberMichael T. Babcock10 Jun '02 - 5:59 
I disagree; the article is about OOP and UML, not C++ necessarily. The article applies equally well to Python or Smalltalk, FWIW. The issue at hand is learning how to model one's objects using UML. If you don't understand how your objects work at this level of abstraction, you've got problems this article isn't trying to solve.
 
--
Michael T. Babcock
GeneralRe: C++ examples pleasememberAlexMarbus11 Jun '02 - 6:02 
Michael is totally correct on this one. I will not give examples in any language.
 
--
Alex Marbus
www.marbus.net
But then again, I could be wrong.
GeneralMicrosoft FoxPro Data ModelsmemberAnonymous9 May '01 - 8:45 
I am trying to locate an automated tool to help construct UML object models. This will help us reverse engineer a recently completed Microsoft FoxPro project.
 
Thank you
 
Thomas Shokite (thomas.shokite@att.net)
GeneralRe: Microsoft FoxPro Data ModelsmemberBaelWrath4 Jul '01 - 5:21 
Visual Studio Enterprise includes a modeler you could use. The only other tools that do reverse engineering that I know of are the VisualRose range Cry | :((
 
I have been looking for a system to take ClassBuilder (Rose) MDL files and import them into VC++ with no luck.
 
Good hunting
 

GeneralRe: Microsoft FoxPro Data ModelsmemberMark W. Holmes13 Jul '01 - 18:25 
Try Visual UML addons from EPS software. Marcus Edgar's company. They can be reached @www.eps-software.com 281.866.7444
 
Mark W. Holmes
dot Common, Inc

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Rant Rant    Admin Admin   

Permalink | Advertise | Privacy | Mobile
Web01 | 2.6.130516.1 | Last Updated 21 Jun 2000
Article Copyright 2000 by Alex Marbus
Everything else Copyright © CodeProject, 1999-2013
Terms of Use
Layout: fixed | fluid