19.11.17 Videos:
Relationships:
Inheritance, Association, Aggregation and Composition
These are except that inheritance
From the slide:
Association:
Relation between students and teacher. Both are independent.
Manager has a swipe card to enter the company premises Association
Inheritance:
A manager is a type of Employee. Employee is a parent of manager
Aggregation:
These kind of relationship is called Aggregations. It represents a Has-A relationship.
public class Manager{
//aggregation relation
public List<Worker> workers=new List<Worker>();
//here worker is the child object and manager is the parent object
}
public class Worker{
public string WorkerName=” “;
Worker object=new Objects;
}
Composition(Death Relationships)
StringBuilder:
It is very useful while string can make complexity in heap but StringBuilder helps to reduce it by modifed string.
System.Text.StringBuilder class can be used and it comes from System.Text namespace
StringBuilder is mutable
StringBuilder performs faster than string when appending multiple string values
StringBuilder sb=new StringBuilder();
Use append method to add or append strings with StringBuilder
Use ToString() method to get the string from StringBuilder
Relationships Code and Videos:
- Manager( is a )type of employee(Employee is a parent of Manager) – Inheritance
- Manager ( has a ) swipe card to enter company premises – Association
- He has many workers under him. – Aggregation relationship
- His salary depend on project success. – Composition
- Project success depends on a manager. –
I have completed the program may be I need to do it / practice it letter with heart. 🙂