object oriented concepts l.
Download
Skip this Video
Loading SlideShow in 5 Seconds..
Object Oriented Concepts PowerPoint Presentation
Download Presentation
Object Oriented Concepts

Loading in 2 Seconds...

play fullscreen
1 / 15

Object Oriented Concepts - PowerPoint PPT Presentation


  • 236 Views
  • Uploaded on

Object Oriented Concepts. Object Orientation. An Object oriented approach views systems and programs as a collection of interacting objects. An object is a thing in a computer system that is capable of responding to messages. The Idea of OOP.

loader
I am the owner, or an agent authorized to act on behalf of the owner, of the copyrighted work described.
capcha
Download Presentation

PowerPoint Slideshow about 'Object Oriented Concepts' - Samuel


Download Now An Image/Link below is provided (as is) to download presentation

Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author.While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server.


- - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - -
Presentation Transcript
object orientation
Object Orientation
  • An Object oriented approach views systems and programs as a collection of interacting objects.
  • An object is a thing in a computer system that is capable of responding to messages
the idea of oop
The Idea of OOP
  • The idea of OOP is to try to approach programming in a more natural way by grouping all the code that belongs to a particular object—such as a checking account or a customer—together
objects
Objects
  • Core to the idea of OOPs is the concept of an object.
  • An object is anything that is relevant to your program
  • A customer, an employee, Inventory, a database, a button, a form, a sale are all potential objects
benefits of objects
Benefits of Objects
  • More natural way to look at things
  • Re-usability
objects classes
Objects/Classes
  • A class is a description of an object.
  • This description can include attributes which describe the class
  • It can also include “methods” which describe things the object can do.
  • In programming an object is an actual instance of a class
messages
Messages
  • Object communicate among themselves by means of messages
  • The also maintain “associative relationships” among themselves
a class diagram
A Class Diagram

Class name

Field names

methods

- Means private

+Means Public

login class in c
Login Class in C#

class Login

{

//constructor

public Login(string usr, string pass)

{

Username = usr;

Password = pass;

Authenticate();

}

//private field variables

private string username;

//public property

public string Username

{

get { return username; }

set { username = value; }

}

private string password;

//write only property

public string Password

{

set { password = value; }

}

private int Authenticate()

{

//connect to database etc . . .

int valid = 0;

if (Username && Password)

{

valid = 1;

}

return valid;

}

}

principles of oop
Principles of OOP
  • Abstraction
  • Encapsulation
  • Inheritance
  • Polymorphism
abstraction
Abstraction
  • The idea of abstraction is that a class represents an “abstract” version of an object
  • A customer class presents the abstract idea of what a customer is
  • A sale class represents an abstract idea of what a sale is
encapsulation
Encapsulation
  • Encapsulation refers to the idea that a class should contain all the properties and methods of an object
  • It also means you should be able to use the object without knowing the details of how it is structured internally
inheritance
Inheritance
  • Inheritance means you can derive a new object from an existing one
  • It also means that the new object will have access to (will inherit) the properties and methods from the parent object
inheritance14
Inheritance

Generalization/ Specialization

polymorphism
Polymorphism
  • Polymorphism means that objects descended from a particular types will behave appropriately
  • For example (a listbox and a button are both descended from the same class called control—but they each will behave differently)