220 likes | 339 Views
BCS 2143. Introduction to Object Oriented and Software Development. Objectives. Able to define OO concepts. Understand the importance of OOP. Outline. OO Definition OO Concepts OO Benefits. OO Definition. OO Definition.
E N D
BCS 2143 Introduction to Object Oriented and Software Development
Objectives • Able to define OO concepts. • Understand the importance of OOP.
Outline • OO Definition • OO Concepts • OO Benefits
OO Definition • A method of implementation in which programs are organized as cooperative collections of objects, each of which represents an instance of some class • Object-oriented programs use objects as components • Reusable software components that model real-world items
OO Concepts • Objects and Classes • Attributes - including the object's characteristics (fields or properties) • Behaviors (methods) - the things it can do, or operations or features) • Inheritance • Encapsulation - the code for a class should be relatively self-contained
Objects and Classes • An object is a thing, both tangible and intangible. • Objects - Look all around you • Account, Vehicle, Employee, People, animals, plants, cars, etc • To create an object inside the computer program, we must provide a definition for objects - how they behave (methods) and what kinds of information they maintain (data values) - called a class.
A rectangle to represent a class with its name appearing inside the rectangle. Vehicle Objects and Classes • An object is called an instance of a class. • Example:
Message and Methods • To instruct a class or an object to perform a task, we send a message to it. • You can send a message only to the classes and objects that understand the message you sent to them. • A class or an object must possess a matching method to be able to handle the received message. • A method defined for a class is called a class method, and a method defined for an object is called an instance method. • A value we pass to an object when sending a message is called an argument of the message.
Message and Methods • Methods - An object's or class’s abilities (sometimes referred to as "functions") • Message - The process by which an object sends data to another object or asks the other object to invoke a method
Ask for the current balance of this particular account. getCurrentBalance() current balance SV198 : BankAccount The current balance of SV198 is returned. Message and Methods (example)
Inheritance • Inheritance is a mechanism to design two or more entities that are different but share many common features. • Features common to all classes are defined in the superclass. • The classes that inherit common features from the superclass are called subclasses. • also call the superclass an ancestor and the subclass a descendant.
Current Account Saving Account Account Inheritance • Here are the superclass Account and its subclasses Current Account and Saving Account.
OO Programming • Implements OO design into program codes. • Several examples of OO languages : • C++ • Java • VB.NET • C# • Smalltalk
What is Java Technology? • Java technology is • An OO programming language • A development environment • An application environment • A deployment environment
OO Benefits • “reuse , reuse, reuse” • Reusable software components. • Saves development time and efforts. • Build more reliable and effective systems. • Additional software features can be added by combining classes.
Software Engineering • Much like building a skyscraper, we need a disciplined approach in developing complex software applications. • Software engineering is the application of a systematic and disciplined approach to the development, testing, and maintenance of a program. • In this class, we will learn how to apply sound software engineering principles when we develop sample programs.
Software Development • Software life cycle • Five primary phases : Analysis, Design, Implementation, Test and Operation/maintenance. • UML serves as modeling tool for software developments. • Use UML diagrams to construct and explain software designs.
Software Life Cycle • The sequence of stages from conception to operation of a program is called software life cycle. • Five stages are: • Analysis > requirement spec • Design > a set of classes/objects • Implementation > program codes • Testing > unit and integration testing • Operation and Maintenance > put in actual use
More for info, log on to… • http://java.sun.com/ • http://www.omg.org/uml