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 8151637
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T15:27:00+00:00 2026-06-06T15:27:00+00:00

Owner Class: class University { List<Student> studentCollection; public void addStudent(); public void removeStudent(); }

  • 0

Owner Class:

class University {
  List<Student> studentCollection;
  public void addStudent();
  public void removeStudent();
}

owned Class:

class Student {
  String name;
  public void setName();
  public String getName();
}

Here University is composed of Students and if we delete university object, all its students are supposed to be deleted.

But i want to ask the Student what University it is in?
Can we change Student class to have the reference of University?

Proposed class

class Student {
  String name;
  University univRef;
  /* ... */
}

would this still be appropriate composition? In UML can this be marked as composition?
Or should it be changed to bidirectional association?

Note: Searching for the answer wasn’t successful & struggled with formatting 🙂

  • 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-06T15:27:02+00:00Added an answer on June 6, 2026 at 3:27 pm

    Yes, it is still a composition. The Students are still owned by the University and they are still killed when the University burns down.

    Formally speaking, the first composition (without the back-reference), is modeled in a UML class diagram with a filled diamond on the University end, and an arrow on the Student end. The composition without the back-reference is then represented without the arrow. However, a lot of people are not very strict in applying the arrow, using the second notation also for a unidirectional composition.

    To be clear you should model it with two arrows: One with a filled diamond from the University to the Student, the other without diamond from the Student to the University.

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

Sidebar

Related Questions

I have the following entities: @Entity public class Owner{ @Id @Column(name = OWNER_ID) @OneToMany()
here's the code: class Acount { int sum ; String owner ; //these seem
I have the following select list: <select d=Owner_Id name=Owner.Id> <option value=>[Select Owner]</option> <option value=1>Owner
I don't know OWNER object class name. So I must check everywhere in my
I'm working with models analogous to the following: class Owner < ActiveRecord::Base has_many :owned
(Click on owner-form doesn't count. :)) I have: public partial class Form1 : Form
Suppose I have a class like this: class Owner { private: long m_Id; QString
I've got two models: class Solution < ActiveRecord::Base belongs_to :owner, :class_name => User, :foreign_key
I have a worker thread in a class that is owned by a ChildView.
INSERT INTO options (owner, name, value, modified) SELECT owner, name, value, modified, @draft:=draft FROM

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.