17
Service Innovation Object-oriented

Object-oriented [호환 모드] - Dongguk · 2015-06-24 · An Object in the Real-world Real-world objectsshare two characteristics: They all have state and behavior. Objects may

  • Upload
    others

  • View
    1

  • Download
    0

Embed Size (px)

Citation preview

Page 1: Object-oriented [호환 모드] - Dongguk · 2015-06-24 · An Object in the Real-world Real-world objectsshare two characteristics: They all have state and behavior. Objects may

Service Innovation

Object-oriented

Page 2: Object-oriented [호환 모드] - Dongguk · 2015-06-24 · An Object in the Real-world Real-world objectsshare two characteristics: They all have state and behavior. Objects may

2경영정보학과

Overall Concepts

Real World OO World

Abstract

CollaborationDelegation

using services at SAP(service access point)

Anthropomorphize

사과 3개Interacting, Collaborating

Objects by Delegating Tasksvia API

(application program interface)

Page 3: Object-oriented [호환 모드] - Dongguk · 2015-06-24 · An Object in the Real-world Real-world objectsshare two characteristics: They all have state and behavior. Objects may

3경영정보학과

Service Collaboration by layering

Personified shopping cart

A Cart in a real world

구매목록

addItem(상품)removeItem(상품명)emptyCart()getTotalAmount()getTotalQuantity()getItem(상품명)listLitems()

Public methods(APIs)

필요한 장 좀 봐올래?

???

Page 4: Object-oriented [호환 모드] - Dongguk · 2015-06-24 · An Object in the Real-world Real-world objectsshare two characteristics: They all have state and behavior. Objects may

4경영정보학과

Layering One of the most common techniques

to provide services to others, not only in IT, but also in real world.

Basic mechanism to break apart or hide complicated something.

The way we collaborate.

송장관리

판매관리

매출관리

Business / Domain Logic

문서관리

문서창고

Data Source Logic

Presentation Logic

Clients

PhysicalLanguages

Data oriented language

Business oriented language

User oriented language

Layered Architecture in a real-world

Everybody has to know everything.

Page 5: Object-oriented [호환 모드] - Dongguk · 2015-06-24 · An Object in the Real-world Real-world objectsshare two characteristics: They all have state and behavior. Objects may

5경영정보학과

Service The word service ordinarily refers to one person performing some work or task for somebody else. A slightly more general definition of service is

a person or an organization performing some work for another person or organization.

An Application Programming Interface (API) is a specification intended to be used as an interface

by software components to communicate with each other.

View on Service and API

Interacting objects

Page 6: Object-oriented [호환 모드] - Dongguk · 2015-06-24 · An Object in the Real-world Real-world objectsshare two characteristics: They all have state and behavior. Objects may

6경영정보학과

Encapsulation: Information Hiding (情報隱匿)

Encapsulation – Information Hiding Is the natural characteristic of the Service.

• 서비스요청자는 기대하는서비스 결과만을요구하며서비스제공자가 서비스를제공하는 구체적인방법은 상관하지도않을뿐만 아니라, 할 필요도없다.

Is the result/act of hiding the implementation details of an object from its user.

Responsibility-driven design (RDD, 책임관점설계) – 협업의 기본 goes beyond information hiding, means that the responsibility of service is belong

to a service provider, not to a service requester. 정보은닉(information hiding) 개념을 뛰어 넘어

모든 서비스의 책임은 의뢰자가 아닌 수신자(서비스 제공자)의 책임이라는 개념임.

Object

외부로 노출된 서비스 (public methods)내부에 내재된 서비스 (private methods)

내부 데이터의 보호- 입력 (setter methods)- 출력 (getter methods)

Page 7: Object-oriented [호환 모드] - Dongguk · 2015-06-24 · An Object in the Real-world Real-world objectsshare two characteristics: They all have state and behavior. Objects may

7경영정보학과

Restrictions of encapsulation Requests are only way to get an object to execute an operation. Object’s internal data

• can not be accessed directly (private/protected), and its representation is invisible from outside the object.

• Operations (getter methods) • are the only way to get an object’s internal data. • Operations (setter methods) • are the only way to change an object’s internal data.

Benefits When there is information hiding,

there cannot be regression faults. The resulting information system

consists of essentially independent classes that communicate by sending messages to their own operations and the operations of other classes.

Object

모든 내부 data는 private으로 선언

Page 8: Object-oriented [호환 모드] - Dongguk · 2015-06-24 · An Object in the Real-world Real-world objectsshare two characteristics: They all have state and behavior. Objects may

8경영정보학과

Views on the Problem Domain

We model the system a number of objects that interact / collaborate.

Object orientation is ideally suited to creating models of real systems.

Service Request

Service Response

Real World View with Collaboration and delegation

Procedure-oriented View

Object-oriented View

Interacting objects

Objects communicate with requests.A request is a Message/Stimulus specifying that an indicated operation be carried out using one or more objects – and, optionally, returning a result.

Page 9: Object-oriented [호환 모드] - Dongguk · 2015-06-24 · An Object in the Real-world Real-world objectsshare two characteristics: They all have state and behavior. Objects may

9경영정보학과

An abstraction of something (anything) in the problem domain, reflecting the capabilities of the system to keep information about it,

interact with it, or both. Real or Abstract; Alive or Dead; Human-being or anything like tree, car,

database, Financial Statement, Address Book, etc.

Anthropomorphism (擬人化) 각 각의 무생물체에게 이의 서비스를 제공하는 담당관을 배치함으로써 (서비스가 있는 실 세계)

• 이세상 모든 사물 또는상상의 사물까지도객체지향세상에 참여시킬수 있고,• 의인화된객체에 내가해야 할행위를 위임(delegation) 할수 있기에

나는 보다 더 추상적이고 본질적인 것에 집중할 (easiness) 수있으며,• 의인화된객체의 서비스는누구라도 활용할수 있기에

근본적으로 중복행위의 배제를 통해 서비스의신뢰도 (reliability) 향상등을 이룰수 있는컴포넌트기반개념의 구현이용이하다.

View on an Anthropomorphic Object

Personified shopping cart

A Cart in a real world

구매목록

addItem(상품)removeItem(상품명)emptyCart()getTotalAmount()getTotalQuantity()getItem(상품명)listLitems()

Public methods(APIs)

필요한 장 좀 봐올래?

Page 10: Object-oriented [호환 모드] - Dongguk · 2015-06-24 · An Object in the Real-world Real-world objectsshare two characteristics: They all have state and behavior. Objects may

10경영정보학과

The Perception of Object-Orient to the Real World

The basic way to understand the real world. Categorization / Classification

• Classes (concepts, abstract) and • their members - objects (real, anything that has its own identity, an instance of class)

A Class Objects, the instances of a class Identified by the attributes(Unique ID)

Person James, Sally, 이동국, … name

Student 20111234, 20105435, 20094532 student ID

Car Equus, Genesis, Sonata, … model name

Car Bus, Truck, Taxi, Private car car type

Classes in MIS Java, ITSM, SAD, … course no

Weapon Fighter plane, Battle ship, Rifle, … weapon type

Page 11: Object-oriented [호환 모드] - Dongguk · 2015-06-24 · An Object in the Real-world Real-world objectsshare two characteristics: They all have state and behavior. Objects may

11경영정보학과

A class/an object is anything to which a concept applies.

Perception and Concepts

Shared conceptsPrivate concepts

The same object can be categorized in many ways.

Concepts shape our perception of reality.

People share concepts and apply them to objects.

Page 12: Object-oriented [호환 모드] - Dongguk · 2015-06-24 · An Object in the Real-world Real-world objectsshare two characteristics: They all have state and behavior. Objects may

12경영정보학과

Object and Class in the Object-Orient

An Object is an instance of a class. Is a thing, an entity, a noun, anything you can imagine that has its own identity. Is an abstraction of something in a problem domain,

• reflecting the capabilities of the system to keep information about it, interact with it, or both.

Real-world/Software objects share two characteristics: They all have • State (Attributes) : state of the object itself • Behavior (Operations/Methods) : services that the object can perform

A Class is the blueprint from which individual objects are created. Is a collection of objects which share common attributes and methods. Is the blueprint from which individual objects are created.

Instance of ‘person’ class

‘Person’ class

Name:

Page 13: Object-oriented [호환 모드] - Dongguk · 2015-06-24 · An Object in the Real-world Real-world objectsshare two characteristics: They all have state and behavior. Objects may

13경영정보학과

An Object in the Real-world

Real-world objects share two characteristics: They all have state and behavior. Objects may be…

• vary in complexity.• some objects will also contain other objects.

The real-world observations all translate into the world of object-oriented programming. For each object that you see, ask yourself two questions:

• "What possible states can this object be in?" and • "What possible behavior can this object perform?".

An Object State Behavior

Dog name, color, breed, hungry barking, fetching, wagging tail

Bicycle current gear, current pedal cadence, current speed

changing gear, changing pedal cadence, applying brakes

desktop lamp On, off turn on, turn off

desktop radio on, off, current volume, current station turn on, turn off, increase volume, decrease volume, seek, scan, and tune

Account accountNo, customerName, PIN, accountBalance Deposit, withdrawal, transferMoney

Page 14: Object-oriented [호환 모드] - Dongguk · 2015-06-24 · An Object in the Real-world Real-world objectsshare two characteristics: They all have state and behavior. Objects may

14경영정보학과

Software objects

Software objects are conceptually similar to real-world objects: they too consist of state and related behavior.

A bicycle modeled as a software object.

An object Stores its state in fields/attributes (variables in

some programming languages) and exposes its behavior through methods (functions in

some programming languages).• Methods operate on an object's internal state

and serve as the primary mechanism for object-to-object communication.

Data Encapsulation Hiding internal state and requiring all interaction to

be performed through an object's methods is known as data encapsulation — a fundamental principle of object-oriented programming.

Getter / Setter methods

Blueprint / DNA of an Object, A class

Page 15: Object-oriented [호환 모드] - Dongguk · 2015-06-24 · An Object in the Real-world Real-world objectsshare two characteristics: They all have state and behavior. Objects may

15경영정보학과

An abstraction of something in a problem domain, reflecting the capabilities of the system to

keep information about it, interact with it, or both.

Objects are deliberately characterized as if each were a person (anthropomorphism),

with a role in the system that is based on its answers to three questions.

• Who am I? – Identity• What can I do? – Operations/Methods (Behavior)• What do I know? – Attributes (State)

An instance of a Class An object is created by runtime environment at run-time.

Every object has a lifecycle. 이 세상 모든 생물체는 부모에 의해 잉태되나,

스스로 모습과 성격을 정하여 탄생한다.

Constructor Destructor

An Object in the Object-Orient

Page 16: Object-oriented [호환 모드] - Dongguk · 2015-06-24 · An Object in the Real-world Real-world objectsshare two characteristics: They all have state and behavior. Objects may

16경영정보학과

Types of Events An object is created (constructor) and terminated/finalized (destructor). An object is classified, declassified, changes and as an instance of an object type. An object’s attribute is changed.

The Lifecycle of an Object

Destroyed by itself

But createdby itself

Invoke other objects methods

Create other objects if necessary

Provide service when invoked by other objects

Some other objects initiate the lifecycle of an object.

Page 17: Object-oriented [호환 모드] - Dongguk · 2015-06-24 · An Object in the Real-world Real-world objectsshare two characteristics: They all have state and behavior. Objects may

17경영정보학과

How can an Object strengthen its ability by itself?

InheritanceInterfacePolymorphismDynamic behavior