Object Oriented Design

Réussis tes devoirs et examens dès maintenant avec Quizwiz!

Hierarchy

"Hierarchy is a ranking or ordering of abstractions." Inheritance defines a relationship among classes, wherein one class shares the structure or behaviour defined in one or more classes (denoting single inheritance and multiple inheritance, respectively)

Complex System - Attribute - Stable intermediate forms ?

As Systems evolve the get complex they are not born complex Working complex systems are evolved versions of less complex systems When evolving , previous versions of the system may get primitve Ex - UniCellular to MultiCellular Organisms We cannot craft these systems complex at the first stage

Complex System - Attribute - Hierarchic Structure ?

Complexity in form of hierarchy All systems have subsystems. all systems are part of a larger system. until the lowest level of component is reached.

Encapsulation vs Abstraction

Data Encapsulation simply means wrapping and controlling access of logically grouped data in a class. It is generally associated with another keyword - Data Hiding. Data Abstraction on the other hand is concept of generalizing so that the underneath complex logic is not exposed to the user. In Java this is achieved by using interfaces and abstract classes.

What is Object Oriented Design ?

Decomposing a problem --> Objects Describes logical and physical design of system based on an activity called abstraction which hides the implementation of complexities

Modularity

Especially for larger applications, in which we may have many hundreds of classes, the use of modules is essential to help manage complexity. • Modules serve as the physical containers in which we declare the classes and objects of our logical design

Five attributes of Complex System

Hierarchic Structure Relative Primitives Separation of concerns Common Patterns Stable intermediate forms

Complex System - Attribute - Separation of concerns ?

Hierarchic components are nearly decomposable because their parts are not completely independant. Separation of concerns means the difference of intra component and inter component interaction of linkages.

Complex System - Attribute - Common Patterns ?

Hierarchic systems are usually made up of 1. Few diff kinds of sub systems 2.in various combinations 3. and arrangements Complex systems may have common patterns , these patterns may reuse small components Ex - Cells inside plants and animals

concurrency

It is natural to consider using a distributed set of computers for the target implementation or to use multitasking. • A single process is the root from which independent dynamic action occurs within a system.

Object Oriented Programming

Object-oriented programming is a method of implementation in which programs are 1 organized as cooperative collections of objects, 2 each of which represents an instance of some class, 3 and whose classes are all members of a hierarchy of classes united via inheritance relationships

persistence

Objects live from certain amounts of time In order to incorporate persistence, database technology and OOD have to undergo some convergent evolution, e.g. OO Databases

Associations

Our abstraction skills help us identify associations, or the relationship between two (or more) classes.

Prototype Theory

Prototype theory is a different way of classifying objects. Essentially, a person has a "prototype" for what an object is; so a person's prototype for DOG may be a mental image of a dog they knew as a child. Their prototype would be their mental idea of a "typical dog." They would classify objects as being dogs or not based on how closely they matched their prototype. Different people have different prototypes for the same kind of object, depending on their experiences. Prototype theory: Under prototype theory, all treelike things will be judged based on an individual's prototype of a tree. The middle category TREE is more salient than the high-level category PLANT or the low-level category ELM.

Abstraction

Reducing information and detail to focus on essential characteristics. distinguish it from all other kinds of objects provide crisply defined conceptual boundaries, relative to the perspective of the viewer whole point of OOA and OOD is to decide the right type of abstraction for a system

Generalisation

Sometimes objects in a problem domain behave in ways that are similar to each other, but not exactly the same. Recognizing the similarities among these objects and grouping the similarities together is called generalization Generalization identifies/implements inheritance class that holds the generalized characteristics is called the base class (for example, Vehicle). Class Airplane, Boat, Automobile are all kinds of Vehicles; these derived classes implement any specialised behaviours.

Interface

The interface of a class provides its outside view and therefore emphasizes the abstraction (while hiding what's inside)

Typing

Typing is the enforcement of the class of an object, such that objects of different types may not be interchanged, or at the most, they may be interchanged only in very restricted ways. • Some languages (e.g. C++) are strongly typed, meaning that they require exact signatures for things to work. Static and dynamic typing Static typing (also known as static binding or early binding) means that the types of all variables and expressions are fixed at the time of compilation • Dynamic typing (also known as late binding) means that the types of all variables and expressions are not known until runtime

Complex System - Attribute - Relative Primitives ?

What components are primitive is relatively arbitrary and largely up to system observer primitives for a one observer may at much higher level of abstraction for another

Primitiveness

an operation is primitive if it only works when given access to hidden aspects of an abstraction.

Classical Categorization

approach of grouping objects based on their similar properties (which uses the technique of applying successive narrowing questions: Is it an animal or vegetable? How many feet does it have? Does it have fur or feathers? Can it fly?), establishing the basis for natural taxonomy. According to the classical view, categories should be clearly defined, mutually exclusive, and collectively exhaustive. This way, any entity of the given classification universe belongs unequivocally to one, and only one, of the proposed categories. Most modern forms of categorization do not have such a cut-and-dried system.

Completeness

every meaningful aspect of an abstraction is captured. (clearly there is some tension with sufficiency here)

Conceptual Clustering

explain how knowledge is represented. In this approach, concepts are generated by first formulating their conceptual descriptions and then classifying the entities according to the descriptions. So for example, under conceptual clustering, your mind has the idea that the cluster DOG has the description "animal, furry, four-legged, energetic." Then, when you encounter an object that fits this description, you classify that object as being a dog. Conceptual clustering brings up the idea of necessary and sufficient conditions. For instance, for something to be classified as DOG, it is necessary for it to meet the conditions "animal, furry, four-legged, energetic." But those conditions are not sufficient; other objects can meet those conditions and still not be a dog. Different clusters have different requirements, and objects have different levels of fitness for different clusters. This comes up in fuzzy sets.

Cohesion

the class Dog is functionally cohesive if its semantics embrace the behaviour of a dog, the whole dog, and nothing but the dog.

Encapsulation

the hiding of implementation details it separates how objects work from how they behave Programs manipulate objects through the objects' methods It describes the idea of bundling data and methods that work on that data within one unit, e.g., a class in Java. This concept is also often used to hide the internal representation, or state, of an object from the outside It allows closure. Once something is successfully encapsulated, it should never need to be revisited

Sufficiency

the interface has enough (possibly just enough) to render the interaction of an object meaningful

Coupling

the strength of connection between modules/classes. The less you couple, the better. But there has to be some trade-off. For instance, inheritance is desirable, and couples classes strongly

Major Elements of Object Models

1 Abstraction 2 Encapsulation 3 Modularity 4 Hierarchy By major we mean that a model without any one of these is not object-oriented.

Interface Functions II

1 An accessor is distinguished using the const keyword after the method declaration. 2 A constructor is a method with the same name as the class name (there may be more than one). 3 A destructor is a method with the same name as the class, preceded by a tilde. 4 A modifer is a non-const method. 5 Iterators may also be defined (but beyond the scope of our module).

Associations between objects

1 Can be unidirectional or bidirectional; 2 Can be labelled (e.g. a Customer object is associated with a Car object through the labelled association purchases. 3 May occur with multiplicity or may be optional 4 May sometimes be represented as classes { \association class Customers and Automobiles • Each Customer purchases one car. • This is a unidirectional association, and it is labelled.

C++ Interface Functions

1 Selector (or accessor) { access that state of the object but not alter it. 2 Constructor { create an object 3 Destructor { delete an object 4 Modifier (or mutator) { alter the state of the object. 5 Iterator { access the parts of the object in a well-defined order

Minor Elements of the Object Model

1 Typing 2 Concurrency 3 Persistence

Object Oriented Analysis

A method that examines the requirements from the perspective of classes and objects found in the vocabulary of problem domain


Ensembles d'études connexes

Ch 4 Posting to a General Ledger

View Set

Chemistry 7 - Pre Comp Study Guide Packet

View Set

Incorrect PrepU- Exam 3 - Ch29: Perioperative Nursing

View Set

Development and population geography summary

View Set

Chapter 6: Motivation and Performance GCU MGT 420

View Set

MGMT_643: Ch. 3 - Business Ethics

View Set

Learning Concepts and Classical Conditioning

View Set