what does composition example vs aggregation
- by meWantToLearn
Composition and aggregation both are confusion to me. Does my code sample below indicate composition or aggregation?
class A {
public static function getData($id) {
//something
}
public static function checkUrl($url) {
// something
}
class B {
public function executePatch() {
$data = A::getData(12);
}
public function readUrl() {
$url = A::checkUrl('http/erere.com');
}
public function storeData() {
//something not related to class A at all
}
}
}
Is class B a composition of class A or is it aggregation of class A? Does composition purely mean that if class A gets deleted class B does not works at all and aggregation if class A gets deleted methods in class B that do not use class A will work?