1 of 9

Design Pattern

(Object Oriented Programming → Part 1)

Name: Sheikh Thanbir Alam

Deg: Senior Software Programmer

Org: Army War Game Center, BD Army

2 of 9

What is OOP?

OOPs or object oriented programming is not something that you need. It is just an approach. It is way to analyse and design solutions of a problem.

3 of 9

Principles of OOP

  1. Class.
  2. Object.
  3. Method and method passing.
  4. Pillars of OOPs.
    1. Encapsulation.
    2. Inheritance.
    3. Polymorphism.
    4. Abstraction.
    5. Compile-time polymorphism.
    6. Runtime polymorphism.

4 of 9

Class

Constructor

Destructor

5 of 9

Lets create a “Virtual Console Robot”

  1. Head (int)
  2. HeadMaterial (string)
  3. Eye (int)
  4. EyeMaterial (string)
  5. Hand (int)
  6. HandMaterial (string)
  7. Leg (int)
  8. LegMaterial (string)
  9. CanRun (Boolean)
  10. CanFight (boolean)
  11. CurrentLocation (string)

6 of 9

7 of 9

Do it now!

  1. Send your robot to India.

Now,

  1. Create another class name as “EnemyConcoleRobot”
  2. Populate data from main class.

8 of 9

Function / Method

9 of 9