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

  • Home
  • SEARCH
  • 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 8929241
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T08:37:50+00:00 2026-06-15T08:37:50+00:00

I find these two examples conceptually identical – yet one is a composition and

  • 0

I find these two examples conceptually identical – yet one is a composition and the other aggregation.

In the first example, the relationship ‘class (has-a) students’ is a compositon.

A class contains students. A student cannot exist without a class.
There exists composition between class and students.

In the second example, the relationship ‘department (has-a) professors’ is an aggregation.

If the university closes, the departments will no longer exist, but
the professors in those departments will continue to exist

In my opinion the first one is plain wrong. Notice that in the comment section of this SO question @TallPaul is questioning the first example as well. I think in practice it would delete all students enrolled in a class after each semester from the system. Moreover, the students would probably have to be created by the class on its initialisation, because composition in C++ is usually implemented as private attribute (not pointer). Am I right? Is there any way the first example makes sense?

  • 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. Editorial Team
    Editorial Team
    2026-06-15T08:37:51+00:00Added an answer on June 15, 2026 at 8:37 am

    There is no absolute truth and it all depends on the system you are modeling. You can create a system where students are instances that exist only in a specific class and when the class is deleted, so are the students. This may make sense when you don’t want to store student information between classes for example.

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

Sidebar

Related Questions

I have two examples here, only difference between these two example are one uses
These days I design some algorithms in python, but find first two greatest value
I am evaluating datamining packages. I have find these two so far: RapidMiner Weka
I have these two data structures that I continually find myself choosing between when
Starting Situation These two commands should be equivalent. jQuery('a').filter(':contains(about)'); and jQuery.find('a').filter(':contains(about)'); Problem In fact,
I am comparing between two tables first column each. If there is find a
I want to find string similarity between two strings. en.wikipedia has examples of some
I can't find a working regex in python to split these strings: CAT One
Erg, I'm trying to find these two methods in the BCL using Reflector, but
There are two unsorted lists containing Integers, need to find the common largest integer

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.