200 likes | 398 Views
Object-Oriented Development Concepts. Lecture by: Dr. Boateng Email: Richard@pearlrichards.org. Slides by Emmanuel Owusu-Oware, CAD, UGBS. Learning Objectives. Understanding of Object-Oriented concepts/terminologies Introduction to Unified Modelling Language (UML). Introduction.
E N D
Object-Oriented Development Concepts Lecture by: Dr. Boateng Email: Richard@pearlrichards.org Slides by Emmanuel Owusu-Oware, CAD, UGBS
Learning Objectives • Understanding of Object-Oriented concepts/terminologies • Introduction to Unified Modelling Language (UML) Slides: Mr. Owusu-Oware | Lecture: Dr. Boateng
Introduction Slides: Mr. Owusu-Oware | Lecture: Dr. Boateng
Introduction • Object Oriented Development (OOD) presents a different perspective, philosophy, mindset to software development: • View of applications as objects • Objects do things: behaviour , methods, • Objects have things: attributes or characteristics • Example: A traffic light • Object: A traffic light • Characteristic: Colour [Red, Yellow, Green] • Behaviour: Turn_red Slides: Mr. Owusu-Oware | Lecture: Dr. Boateng
Introduction • Object-Oriented Development vs. Process-Oriented/ Structured Development: The Difference Slides: Mr. Owusu-Oware | Lecture: Dr. Boateng
Introduction OOD Strengths • Easier Development • OOD uses a model that have closer representation of real-world situations • OOD uses smaller independent units • Maintainability – quicker and easier • changes affecting an object will not require change to other parts of the software • A fault could be identified with the object that is responsible • OOD uses smaller independent units Slides: Mr. Owusu-Oware | Lecture: Dr. Boateng
Introduction OOD Strengths (contd.) • Rapid application development, i.e. shorter development life-cycle • Through the reuse of object implementations • Shorter life-cycle - Schach (2002) (see next slide) Slides: Mr. Owusu-Oware | Lecture: Dr. Boateng
Introduction • OOD Weakness One weakness that OOD had was that there was no universally accepted standards in development methodology and tools. This is no longer the case with the emergence and acceptance of UML (Unified Model language). Slides: Mr. Owusu-Oware | Lecture: Dr. Boateng
Object-Oriented Development Concepts Slides: Mr. Owusu-Oware | Lecture: Dr. Boateng
What is an Object? • Definition: An object is a self-contained unit with well-defined characteristics (properties or attributes) and behaviours (operations) – Tsang et al (2005). • Example: A student in a school. • Object: A Student • Attributes/Characteristics: Name, Age • Behaviour/Operation: Writes exams Slides: Mr. Owusu-Oware | Lecture: Dr. Boateng
Object Concepts • The object behaviour is a set of operations that it performs to meet the system goal. • An operation is a function or procedure through which other objects access an object’s data. • The collection of operations is the object’s interface. Other objects access the object’s operations through the interface • Example: The book class in the Library system have the operations : • borrow (book), return ( book), getBookStatus() Slides: Mr. Owusu-Oware | Lecture: Dr. Boateng
Object Concepts • An object has many states. It can be in one state at a time. The state is represented by values of the properties or attributes: • Example: Book – [Borrowed, Available, On Order] • Types of Objects • Domain Objects (real-world entities) • Physical (Tangible): E.g. Book • Conceptual (Intangible): E.g. Bank Account • Implementation Objects (software object) • E.g. : Transaction log file which is used for error recovery Slides: Mr. Owusu-Oware | Lecture: Dr. Boateng
A Class and Instance • Definition: A class is an abstraction of real-world entity that captures and specifies the properties and behaviours essential to the system but hides those that are irrelevant. - Tsang et al (2005). • A class is a generic definition for a set of similar objects. • An object is an instance of a class. • A class has methods and attributes while object instances have behaviours and states. Slides: Mr. Owusu-Oware | Lecture: Dr. Boateng
A Class and Instance • An attribute is a property of a class. • Attributes have a name and a value and may also have a type e.g. Integer or Boolean. • Illustration: • Class: • Name: Book • Properties: ISBN, Title, Author(s) • Instances: • Title: Structured Engineering • Title: Advance VB.Net Programming Slides: Mr. Owusu-Oware | Lecture: Dr. Boateng
Inheritance, Generalisation and Specialisation • Inheritance refers to the derivation of a new class (sub-class) from an existing class (base or super-class). Employee Base class Manager Clerk Sub-class Slides: Mr. Owusu-Oware | Lecture: Dr. Boateng
Inheritance, Generalisation and Specialisation • Through inheritance, the sub-class acquires all the attributes (properties) and methods of the base class in addition to its specialised properties and methods. • It also allows code reuse and thus faster application development and extensibility of the software system. Slides: Mr. Owusu-Oware | Lecture: Dr. Boateng
Inheritance, Generalisation and Specialisation • Inheritance allows generalisation and specialisation associations : • Generalisation distributes the commonalities from the super class (general/bases class) among a group of similar sub-classes(specialised class). The subclass inherits all the super-class’s operations and attributes. • Specialisation allows subclasses to extend the functionalities of their super class by introducing new operations and attributes. Slides: Mr. Owusu-Oware | Lecture: Dr. Boateng
Inheritance, Generalisation and Specialisation Slides: Mr. Owusu-Oware | Lecture: Dr. Boateng