LICT .NET Training | Kamal Protap Sir | Part 6

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:

 

  1. Manager( is a )type of employee(Employee is a parent of Manager) – Inheritance
  2. Manager ( has a ) swipe card to enter company premises – Association
  3. He has many workers under him.  – Aggregation relationship
  4.  His salary depend on project success. – Composition
  5.  Project success depends on a manager. –

I have completed the program may be I need to do it / practice it letter with heart. 🙂

It would be a great help, if you support by sharing :)
Author: zakilive

Leave a Reply

Your email address will not be published. Required fields are marked *