473,770 Members | 1,952 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Mapping Class Diagram to C++ coding

My question is regarding the mapping of Class diagram to the C++
coding.

There are 3 realtions in Class diagram

1) Assosication
2) Composition
3) Aggregation (Weak Composition).

-----------------------------------------------------
Class diagram for A ----- B (Association)
I handle it coding like that

main() {
A objA;
B objB;

objA.funA(objB) ; // or
objB.funB(objA) ;
}

-----------------------------------------------------
A <>---- B (filled diamond) for compoistion
Take the example of CAR and ENGINE, this relation is composition

I handle it coding like that

class B {
}
class A {
B objB; //or B* objB
}

This shows when A's Object destroys B also destroys.
Im clear with above two concepts but when aggregation comes.

A <>---- B (non-filled diamond) for agregation
Take the example of CAR and WHEEL-CUP.

class B {
}
class A {
B* ptrB;
}

Take the example of CAR and WHEEL-CUP, this relation is aggregation.
CAR

changes its wheel-cup each time when it go to service the car.

CAR <>------ Wheel-CUp

im not getting one thing thing when car destroyed (i.e. destructor
called)

does Wheel-Cup should also destroy? iF yes then the difference
between

COMPOSITION and AGGREGATION is only left that in aggregation the
aggregated

object (B* ptrB) points to different objects i.e. different wheel cups
at

different states. and in COMPOSITION it only keep points to only one
object.

AND in both aggre. and comp. object B destoys as object A destroys.

One more question , in composition the Object B is created as object A
is

created i.e. (When CAR is created ENGINE also created) but what abt
wheel

cups? when they will be created and destroyed? as wheel cups can
live

independly and when car goes for services, they new wheel cups only
points of

the this car showing new wheel cups attached. So the other wheel cups

destroyed !!??

I shall be very very thankful if u answer me this question

May 2 '07 #1
1 4687
On May 2, 1:12 pm, Jennifer Jazz <Jeniffer...@gm ail.comwrote:
My question is regarding the mapping of Class diagram to the C++
coding. [snip]
See your other posting of this question for my answer.

Cheers! --M

May 2 '07 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
2849
by: Jacqueline Snook | last post by:
Hi, I am working on a website that uses a SVG diagram with multiple polygons (to represent rooms in a hotel). Each polygon has a class to represent whether the room is single or double. In a separate javascript file, I need to do a different action depending on the class. How do I read the class in the Javascript file. I tried using getAttribute("class"), but this does not work - IE comes up with an error stating 'The object doesn't...
0
1233
by: Sebastian Ware | last post by:
O/R Mapping. After six months of hard work, we are proud to make available the Public Beta of Pragmatier Data Tier Builder 2.5. Initial feedback is amazing, download NOW and find out for yourself: http://www.pragmatier.com (Visit the Beta Lab) Have you read the O/R Mapping scalability report available at VB2theMAX? Download your personal copy from our website. http://www.pragmatier.com (Visit Programmer Reference)
5
2113
by: A.M | last post by:
Hi, I am looking for a Diagram that visually shows how System.Web.HttpApplication class contains System.Web.UI.Page classes and how they interact together. I am trying to underestand the class architecture of ASP.NET. Can anybody refer me to a link or resource related to that ? Any help would be apprecited,
1
1275
by: alex | last post by:
Moving existing asp.net 1.1 app to 2.0 and using VS2005 I have noticed: 1) Class View window display ONLY name spaces and classes located in the new folder App_Code. 2) Using "Add New Item" on App_Code folder presents limited number of items -> no Web Page, no User Control, giving a hint that these items shouldn't go in this folder. Instead should go under the web root and other sub-folders. I haven't run a conversion wizard on my 1.1...
4
10154
by: thoducng | last post by:
Hi all: I want to create a class diagram, similar to MFC class diagram published long ago. I don't need a UML model, all I need is a class named and inheritance relationship. My classes are in different projects. Do you know any tool that help to do that automatically. Thanks Tho
3
1644
by: Lee Crabtree | last post by:
Are there any tools that will take an existing assembly and generate a class hierarchy from it? It seems like the kind of thing that would be possible with reflection, but I don't know enough about that namespace to tackle this. Lee Crabtree
2
1241
by: José Joye | last post by:
Hello I'm currently looking for a diagram that shows the event we can register with asp.net. I'm currently a bit lost with when they are fight and which one are our disposal..... Thanks, José
5
2452
by: Flak | last post by:
Hi, I am a beginning to intermediate PHP programmer. Home schooled. My programmes are starting to get rather big with a couple of thousand lines of code and 10's of different files. I am starting to lose the bigger picture. I want to start using a flow/diagram tool. But I have no idea what program to use. Are there experienced users that can help me with this subject? What to look for in a program and what to not look for.
1
1376
by: Jennifer Jazz | last post by:
My question is regarding the mapping of Class diagram to the C++ coding. There are 3 realtions in Class diagram 1) Assosication 2) Composition 3) Aggregation (Weak Composition). -----------------------------------------------------
0
10099
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10036
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9904
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7451
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6710
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5481
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4007
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3607
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2849
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.