Introduction to Object-Oriented ApproachObjectivesIn this lesson, you will learn to: State the reasons for the complexity ...
Introduction to Object-Oriented ApproachObjectives (Contd.) State the significance of the activities involved in  object-o...
Introduction to Object-Oriented ApproachComplexity of the Software System Internal Complexity     Arises from the composit...
Introduction to Object-Oriented ApproachReasons for the Complexity Involved in theDevelopment of Software Difficulty in ma...
Introduction to Object-Oriented ApproachSimplifying Complexity Is done by breaking the system into its component  parts an...
Introduction to Object-Oriented ApproachJust a Minute…Jane has called a technician to repair her television. Howwould the ...
Introduction to Object-Oriented ApproachObject Is an instance of a class that exhibits some well-  defined behavior©NIIT  ...
Introduction to Object-Oriented ApproachCharacteristics of Objects State     Is indicated by a set of attributes and the v...
Introduction to Object-Oriented ApproachJust a Minute…Identify the possible attributes to define the state of thefollowing...
Introduction to Object-Oriented ApproachClasses Define the attributes and behaviors of an object Example:                 ...
Introduction to Object-Oriented ApproachMessages and MethodsMessages: Are transmitted by one object to another Are transmi...
Introduction to Object-Oriented ApproachMessages and Methods (Contd.)Methods: Are a set of actions taken by the receiver o...
Introduction to Object-Oriented ApproachJust a Minute…Dr. James and Mr. Hyde went to the railway station tobook two ticket...
Introduction to Object-Oriented ApproachBenefits of the Object-Oriented Approach Realistic modeling     Easy to use Reusab...
Introduction to Object-Oriented ApproachJust a Minute…State whether the following situations demonstratereusability:a. Rec...
Introduction to Object-Oriented ApproachBenefits of Object-Oriented Approach (Contd.) Resilience to change     Easy to mai...
Introduction to Object-Oriented ApproachObject-Oriented Analysis (OOA)Analysis: Is a phase where users and developers get ...
Introduction to Object-Oriented ApproachObject-Oriented Design (OOD)Design: Generates the blueprint of the system that has...
Introduction to Object-Oriented ApproachObject-Oriented Design (OOD) (Contd.) Abbott’s technique follows the listed steps:...
Introduction to Object-Oriented ApproachObject-Oriented Programming (OOP) Is a way of writing programs Some applications b...
Introduction to Object-Oriented ApproachJust a Minute…As a member of a team that is developing the billingsystem software ...
Introduction to Object-Oriented ApproachGenerations of Computer Languages First generation Second generation Third generat...
Introduction to Object-Oriented ApproachEvolution of C++ as an Object OrientedProgramming Language In the early 1980s, Bja...
Introduction to Object-Oriented ApproachCreating Classes in C++Sample:  class Car  {    public:    void honk()    {      c...
Introduction to Object-Oriented ApproachCreating Classes in C++ (Contd.) The class keyword     Is used to declare a class ...
Introduction to Object-Oriented ApproachCreating Classes in C++ (Contd.) Conventions for naming classes     Should be mean...
Introduction to Object-Oriented ApproachCreating Classes in C++ (Contd.) Member functions     Are means of passing message...
Introduction to Object-Oriented ApproachCreating Classes in C++ (Contd.) The cout object     Is an instance of the pre-def...
Introduction to Object-Oriented ApproachProblem Statement 1.D.1As a member of a team that is developing the billingsystem ...
Introduction to Object-Oriented ApproachProblem Statement 1.D.1 (Contd.)Solution:    class Customer    {       void accept...
Introduction to Object-Oriented ApproachProblem Statement 1.P.1As a member of a team that is developing an automatedbookin...
Introduction to Object-Oriented ApproachSummaryIn this lesson, you learned that: Complexity of software arises mainly due ...
Introduction to Object-Oriented ApproachSummary (Contd.) The object-oriented approach views the systems as  consisting of ...
Introduction to Object-Oriented ApproachSummary (Contd.) The object that receives the message is called the  receiver; the...
Introduction to Object-Oriented ApproachSummary (Contd.) The purpose of the model built during analysis and  design is to ...
Upcoming SlideShare
Loading in …5
×

Aae oop xp_01

1,424 views
1,296 views

Published on

Published in: Technology
0 Comments
1 Like
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total views
1,424
On SlideShare
0
From Embeds
0
Number of Embeds
228
Actions
Shares
0
Downloads
42
Comments
0
Likes
1
Embeds 0
No embeds

No notes for slide

Aae oop xp_01

  1. 1. Introduction to Object-Oriented ApproachObjectivesIn this lesson, you will learn to: State the reasons for the complexity involved in the development of software Define the following terms Objects Classes Messages Methods Explain benefits of the object-oriented approach©NIIT OOPS/Lesson 1/Slide 1 of 35
  2. 2. Introduction to Object-Oriented ApproachObjectives (Contd.) State the significance of the activities involved in object-oriented analysis and design Create classes in C++©NIIT OOPS/Lesson 1/Slide 2 of 35
  3. 3. Introduction to Object-Oriented ApproachComplexity of the Software System Internal Complexity Arises from the composition of a system itself External Complexity Arises from the fact that users themselves have only a vague idea of how their system works and have difficulty in expressing their requirements©NIIT OOPS/Lesson 1/Slide 3 of 35
  4. 4. Introduction to Object-Oriented ApproachReasons for the Complexity Involved in theDevelopment of Software Difficulty in managing the software development process Lack of standards for developing software Difficulty in predicting software behavior©NIIT OOPS/Lesson 1/Slide 4 of 35
  5. 5. Introduction to Object-Oriented ApproachSimplifying Complexity Is done by breaking the system into its component parts and arranging them in a hierarchy©NIIT OOPS/Lesson 1/Slide 5 of 35
  6. 6. Introduction to Object-Oriented ApproachJust a Minute…Jane has called a technician to repair her television. Howwould the technician deal with the complexity of thetelevision?©NIIT OOPS/Lesson 1/Slide 6 of 35
  7. 7. Introduction to Object-Oriented ApproachObject Is an instance of a class that exhibits some well- defined behavior©NIIT OOPS/Lesson 1/Slide 7 of 35
  8. 8. Introduction to Object-Oriented ApproachCharacteristics of Objects State Is indicated by a set of attributes and the values of these attributes Behavior Is indicated by how an object acts and reacts Identity Distinguishes the object from all other objects©NIIT OOPS/Lesson 1/Slide 8 of 35
  9. 9. Introduction to Object-Oriented ApproachJust a Minute…Identify the possible attributes to define the state of thefollowing objects: Tea cup Stereo tape-recorder©NIIT OOPS/Lesson 1/Slide 9 of 35
  10. 10. Introduction to Object-Oriented ApproachClasses Define the attributes and behaviors of an object Example: B IR D S PEACO CK SPARRO W K IN G F IS H E R©NIIT OOPS/Lesson 1/Slide 10 of 35
  11. 11. Introduction to Object-Oriented ApproachMessages and MethodsMessages: Are transmitted by one object to another Are transmitted as requests for an action to be taken Are accompanied by additional information needed to carry out the request©NIIT OOPS/Lesson 1/Slide 11 of 35
  12. 12. Introduction to Object-Oriented ApproachMessages and Methods (Contd.)Methods: Are a set of actions taken by the receiver object in response to the request©NIIT OOPS/Lesson 1/Slide 12 of 35
  13. 13. Introduction to Object-Oriented ApproachJust a Minute…Dr. James and Mr. Hyde went to the railway station tobook two tickets in the Flying express for 3rd Decemberby AC 1st class. Identify the following:a.The possible receiver of the message in this situationb.The possible method that the receiver can use©NIIT OOPS/Lesson 1/Slide 13 of 35
  14. 14. Introduction to Object-Oriented ApproachBenefits of the Object-Oriented Approach Realistic modeling Easy to use Reusability Saves time and cost©NIIT OOPS/Lesson 1/Slide 14 of 35
  15. 15. Introduction to Object-Oriented ApproachJust a Minute…State whether the following situations demonstratereusability:a. Recycling paperb. Pump reusability (same pump is used in a well and in a fuel station)©NIIT OOPS/Lesson 1/Slide 15 of 35
  16. 16. Introduction to Object-Oriented ApproachBenefits of Object-Oriented Approach (Contd.) Resilience to change Easy to maintain Parts of the system can be refined without any major change in other parts©NIIT OOPS/Lesson 1/Slide 16 of 35
  17. 17. Introduction to Object-Oriented ApproachObject-Oriented Analysis (OOA)Analysis: Is a phase where users and developers get together and arrive at a common understanding of the system Requires the developer to concentrate on obtaining maximum possible information about the problem domain Results in one of the end products as specification of the function of the system©NIIT OOPS/Lesson 1/Slide 17 of 35
  18. 18. Introduction to Object-Oriented ApproachObject-Oriented Design (OOD)Design: Generates the blueprint of the system that has to be implemented Involves identifying classes using Abbott’s technique©NIIT OOPS/Lesson 1/Slide 18 of 35
  19. 19. Introduction to Object-Oriented ApproachObject-Oriented Design (OOD) (Contd.) Abbott’s technique follows the listed steps: Write English description of the problem Underline nouns (nouns represent candidate classes)©NIIT OOPS/Lesson 1/Slide 19 of 35
  20. 20. Introduction to Object-Oriented ApproachObject-Oriented Programming (OOP) Is a way of writing programs Some applications built using OOP techniques are: Computer-Aided Design (CAD) Computer-Aided Manufacturing (CAM) Artificial Intelligence (AI) and Expert Systems Object-Oriented Databases©NIIT OOPS/Lesson 1/Slide 20 of 35
  21. 21. Introduction to Object-Oriented ApproachJust a Minute…As a member of a team that is developing the billingsystem software for Diaz Telecommunications Inc., youhave been assigned the task of creating a softwaremodule that accepts and displays customer details.Identify the class that you will create and the methods ofthe class.©NIIT OOPS/Lesson 1/Slide 21 of 35
  22. 22. Introduction to Object-Oriented ApproachGenerations of Computer Languages First generation Second generation Third generation©NIIT OOPS/Lesson 1/Slide 22 of 35
  23. 23. Introduction to Object-Oriented ApproachEvolution of C++ as an Object OrientedProgramming Language In the early 1980s, Bjarne Stroustrup developed the C++ language C++ was originally known as C with classes©NIIT OOPS/Lesson 1/Slide 23 of 35
  24. 24. Introduction to Object-Oriented ApproachCreating Classes in C++Sample: class Car { public: void honk() { coutBEEP BEEP!; } };©NIIT OOPS/Lesson 1/Slide 24 of 35
  25. 25. Introduction to Object-Oriented ApproachCreating Classes in C++ (Contd.) The class keyword Is used to declare a class Example: class Car { ... };©NIIT OOPS/Lesson 1/Slide 25 of 35
  26. 26. Introduction to Object-Oriented ApproachCreating Classes in C++ (Contd.) Conventions for naming classes Should be meaningful Should ideally be a noun First letter of every word should be in upper case Rules for naming classes Must not contain any embedded space or symbol Must begin with a letter, which may be followed by a sequence of letters or digits Cannot be a keyword©NIIT OOPS/Lesson 1/Slide 26 of 35
  27. 27. Introduction to Object-Oriented ApproachCreating Classes in C++ (Contd.) Member functions Are means of passing messages and responding to them Are declared inside the class body Example: class Car { void honk() { coutBEEP BEEP!; } };©NIIT OOPS/Lesson 1/Slide 27 of 35
  28. 28. Introduction to Object-Oriented ApproachCreating Classes in C++ (Contd.) The cout object Is an instance of the pre-defined class, ostream The endl manipulator Is a command that takes the cursor to the new line©NIIT OOPS/Lesson 1/Slide 28 of 35
  29. 29. Introduction to Object-Oriented ApproachProblem Statement 1.D.1As a member of a team that is developing the billingsystem software for Diaz Telecommunications Inc., youhave been assigned the task of creating a softwaremodule that accepts and displays customer details.Declare the Customer class and the member functions.The member function to accept customer details shoulddisplay the message “Accepting Customer Details”.Similarly, the member function to display customerdetails on the screen should display the message“Displaying Customer Details.”©NIIT OOPS/Lesson 1/Slide 29 of 35
  30. 30. Introduction to Object-Oriented ApproachProblem Statement 1.D.1 (Contd.)Solution: class Customer { void accept() { cout “Accepting Customer Details” endl; } void display() { cout “Displaying Customer Details” endl; } };©NIIT OOPS/Lesson 1/Slide 30 of 35
  31. 31. Introduction to Object-Oriented ApproachProblem Statement 1.P.1As a member of a team that is developing an automatedbooking system for the Railways, you have beenassigned the task of creating a module that accepts thedetails of a passenger and checks whether the ticket hasbeen confirmed or is in the waiting list. The module thenprints the list of confirmed passengers. Declare a classTicket, which consists of three member functions,booking(), status(), and print().©NIIT OOPS/Lesson 1/Slide 31 of 35
  32. 32. Introduction to Object-Oriented ApproachSummaryIn this lesson, you learned that: Complexity of software arises mainly due to four reasons: Difficulty in understanding the intricacies and complexity of the system and its needs Communication problems during development Lack of standards for developing software Difficulty in predicting software behavior One way of dealing with the complexity of software is to break down an application into its components and deal with each component separately©NIIT OOPS/Lesson 1/Slide 32 of 35
  33. 33. Introduction to Object-Oriented ApproachSummary (Contd.) The object-oriented approach views the systems as consisting of component objects and looks at the interactions between them An object is an entity that may have a physical boundary and is also characterized by the following: State Behavior Identity A class consists of a set of objects that share a common structure and behavior If one object desires an action from another object, it sends a message to the second object©NIIT OOPS/Lesson 1/Slide 33 of 35
  34. 34. Introduction to Object-Oriented ApproachSummary (Contd.) The object that receives the message is called the receiver; the set of actions taken by the receiver constitutes the method The benefits of the object-oriented approach are: Realistic modelling, hence it is easier to use Reusability of code, hence it saves time and cost Resilience to change, hence systems are easier to maintain In the stages of analysis and design, a model of the system is built©NIIT OOPS/Lesson 1/Slide 34 of 35
  35. 35. Introduction to Object-Oriented ApproachSummary (Contd.) The purpose of the model built during analysis and design is to help developers understand the reality that they are trying to imitate Bjarne Stroustrup developed the C++ language in the early 1980s The cout object is an instance of the class, ostream The class ostream is associated with the standard output device (screen) The output operator is used to direct a value to the standard output device©NIIT OOPS/Lesson 1/Slide 35 of 35

×