Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 86575
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 10, 20262026-05-10T22:16:04+00:00 2026-05-10T22:16:04+00:00

I can not distinguish the difference between aggregating and holding. What does it mean

  • 0

I can not distinguish the difference between aggregating and holding. What does it mean in terms of, let`s say, C++?
I suppose when the object of class A holds (or instantiates) objects of class B, it uses it to perform some functions by itself.
For example:

class A {  int state;  public:    A(int s): state(s) {}   int inc() { return state++; } }; class B {   int app;   string s; public:   B(): app(0), s('') {}   B(int A, const string& str): app(A), s(str) {}   void f(int p);   ~B() { app = 0; s = ''; } }; void B::f(int p) {    A mA(p);    app = mA.inc(); } 

And the aggregation of object of class A would be like this:

class B{  A t;  //... } 

Please give me a link to a web-site or to a place in a book where I can find clear definitions in terms of OO language what exactly each kind of relationship between classes is.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. 2026-05-10T22:16:04+00:00Added an answer on May 10, 2026 at 10:16 pm

    Holding another class means that a class is associated with another class through a parent child relationship. For example a Path has a list of points. The Path is the parent of the List of Points which is the parent of the individual points.

    Aggregating means taking different classes and putting them behind a interface so they appear as one class. For example a FileDialog will have several button class, a text input class, a listview/treeview class and so on. But to the rest of the system it just had methods to be activate, maybe assign a default filename, and retrieve the rest.

    The fact it is comprised of all the other classes is immaterial to other classes using it as a filedialog.However it works by aggregating all the classes to perform the expected behavior.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 104k
  • Answers 104k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer I finally wrote this code: # Reply model validates_uniqueness_of :user_id,… May 11, 2026 at 8:30 pm
  • Editorial Team
    Editorial Team added an answer Only DependencyPropertys. As per MSDN: Dependency properties provide support for… May 11, 2026 at 8:30 pm
  • Editorial Team
    Editorial Team added an answer Just add a . to it: svn checkout file:///home/landonwinters/svn/waterproject/trunk .… May 11, 2026 at 8:30 pm

Related Questions

I'm adding functionality to an existing Java application that's already been deployed extensively. (So
Say you have a class declaration, e.g.: class MyClass { int myInt=7; int myOtherInt;
What do you see as the advantages and disadvantages of Amazon Web Services S3
In our processing software we are moving from one version of an external assembly

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.