1 / 5

Object Oriented Programs: Basic Concepts

Object Oriented Programs: Basic Concepts. Nick West. Drawbacks of “Structured” Design. Working in Solution Domain Process Dominated But Program = Software and Data! Data structuring takes second place . Reusability Not Encouraged

hughb
Download Presentation

Object Oriented Programs: Basic Concepts

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. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Object Oriented Programs:Basic Concepts Nick West

  2. Drawbacks of “Structured” Design • Working in Solution Domain • Process Dominated • ButProgram = Software and Data! • Data structuring takes second place. • Reusability Not Encouraged • But“The best way not to create bugs is not to write code!” Process • This is a Computer, but more natural to describe problem in terms of Objects

  3. The World is Full of Objects! • Consider:- • Power Supply:- • Just a source of 240V AC. • Not a complex of circuits, grids, transformers, power stations… • Telephone:- • Just connects to a remote phone. • Not a complex of circuits, exchanges, land lines, satellite links… • Simple Model (Data Abstraction) • Hidden Complexity (Data Hiding). • PC Hardware • Bus • Memory • CPU • Screen • Disk Drive Could this be done in Software? } All have Internal Complexity. But relatively simple Interface. Allows - Upgrading existing PC - Building new PC.

  4. Object Oriented Paradigm • Object: • A miniture Program consisting of:- • Set of internal variables. • Set of functions to manipulate them. • Externally:- • Only access functions. • Variables hidden; object controls access. • Immediate Advantages • More Natural - to state problem in terms of objects. Also good for User Interface. • Data Hiding • As with SA/SD only specify function; implementation can change. • Unlike SA/SD data can change, leads naturally to data abstraction. • Locality or Data Encapsulation ensures code robust; can rigorously test all states and flow paths.

  5. Classes and Inheritance • CLASSES Sets of objects with similar properties form a class. Can create an arbitrary number of objects (called instances of class). • INHERITANCE Can create a new class (subclass) developed from another (base class) by adding more variables and functions. Example: Window Manager Event Display Spreadsheet Editor Subclass (application specific) Base class (for basics e.g. move, resize, iconise) Window

More Related