Skip to content

Instantly share code, notes, and snippets.

@tarikguney
Created October 8, 2017 18:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tarikguney/d293a59ab9f241bd70fca948ba924fc0 to your computer and use it in GitHub Desktop.
Save tarikguney/d293a59ab9f241bd70fca948ba924fc0 to your computer and use it in GitHub Desktop.
Composition vs. Aggregation
public class Account {
private Profile _profileInfo;
private Login _loginInfo;
public Account(Profile profileInfo, Login loginInfo){
_profile = profileInfo;
_loginInfo = loginInfo;
}
}
public class Account {
private Profile _profileInfo;
private Login _loginInfo;
public Account(){
_profile = new Profile();
_loginInfo = new Login();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment