Pattern Oriented Software Architecture 1 Architectural Pattern n

  • Slides: 29
Download presentation
Pattern Oriented Software Architecture #1 Architectural Pattern 김범식

Pattern Oriented Software Architecture #1 Architectural Pattern 김범식

목차 n n Introduction Architectural Patterns From Mud to Structure Layer Pattern

목차 n n Introduction Architectural Patterns From Mud to Structure Layer Pattern

Introduction n Pattern? n n Pattern’s schema n n 반복되는 문제에 대한 해법의 틀

Introduction n Pattern? n n Pattern’s schema n n 반복되는 문제에 대한 해법의 틀 Context Problem Solution Pattern Categories n n n Architectural Patterns Design Patterns Idioms

Architectural Patterns n n Expresses a fundamental structural organization schema for software systems Provides

Architectural Patterns n n Expresses a fundamental structural organization schema for software systems Provides a set of predefined subsystems, specifies their responsibilities and includes rules and guidelines for organizing the relationships between them

Architectural Patterns n From Mud to Structure n n Distributed Systems n n Broker

Architectural Patterns n From Mud to Structure n n Distributed Systems n n Broker / Microkernels / Pipes and Filters Interactive Systems n n Layer / Pipes and Filters / Blackboard MVC / PAC(Presentation Abstraction Control) Adaptable Systems n Reflection / Microkernel

Layer Pattern n Helps to structure applications that can be decomposed into groups of

Layer Pattern n Helps to structure applications that can be decomposed into groups of subtasks in which each group of subtasks is at a particular level of abstraction

Layer Pattern n Solution n n 레이어를 적당한 개수로 나눈다. 가장 하단부(Layer 1)에서 추상화를

Layer Pattern n Solution n n 레이어를 적당한 개수로 나눈다. 가장 하단부(Layer 1)에서 추상화를 시작 Layer. N-1 위에 Layer N을 쌓아가며 각 단계의 추상화를 계속한다. Structure n n Class – Layer N Responsibility n n n Collaborator n n Provides services used by Layer. N+1 Delegates subtasks to Layer. N-1 Layer. N은 오직 Layer. N+1에 의해서만 사용되는 특징을 가진다.

Layer Pattern n Dynamics n Scenario 1 n n Scenario 2 n n Bottom-up

Layer Pattern n Dynamics n Scenario 1 n n Scenario 2 n n Bottom-up Scenario 3 /Scenario 4 n n Top-Down/Bottom-up 에서 중간에서 종료 Scenario 5 n 두 개의 레이어 스택이 서로 통신

Layer Pattern n Implementation n n Define the abstraction criterion for grouping tasks into

Layer Pattern n Implementation n n Define the abstraction criterion for grouping tasks into layers. Determine the number of abstraction levels. Name the layers and assign tasks to each of them. Specify the services. Refine the layering.

Layer Pattern n n Specify an interface for each layer. Structure individual layers. Specify

Layer Pattern n n Specify an interface for each layer. Structure individual layers. Specify the communication between adjacent layers. Decouple adjacent layers. Design an error-handling strategy.

Layer Pattern n Benefits n n Reuse of layers Support for standardization Dependencies are

Layer Pattern n Benefits n n Reuse of layers Support for standardization Dependencies are kept local Exchangeability

Layer Pattern n Liabilities n n Cascades of changing behavior Lower efficiency Unnecessary work

Layer Pattern n Liabilities n n Cascades of changing behavior Lower efficiency Unnecessary work Difficulty of establishing the correct granularity of layers

Layer Pattern n Examples n n OSI 7 layer model Virtual Machine APIs Information

Layer Pattern n Examples n n OSI 7 layer model Virtual Machine APIs Information Systems n n Presentation / Application Logic / Domain layer / Database Windows NT n System services / Resource management layer / Kernel / HAL / Hardware

Pipes and Filters n Provides a structure for systems that process a stream of

Pipes and Filters n Provides a structure for systems that process a stream of data. Each processing step is encapsulated in a filter component. Data is passed through pipes between adjacent filters. Recombining filters allows you to build families of related systems.

Pipes and Filters n Structure n n The subsequent pipeline element pulls output data

Pipes and Filters n Structure n n The subsequent pipeline element pulls output data from the filter The previous pipeline element pushes new input data to the filter n n Passive filter Most commonly, the filter is active in a loop, pulling its input from and pushing its output down the pipeline n Active filter

Pipes and Filters n Class - Filter n Responsibility n n Collaborators n n

Pipes and Filters n Class - Filter n Responsibility n n Collaborators n n Gets input data Performs a function on its input data Supplies output data Pipe Class – Data Source n Responsibility n n Delivers input to processing pipeline Collaborators n Pipe

Pipes and Filters n Class – Pipe n Responsibility n n Collaborators n n

Pipes and Filters n Class – Pipe n Responsibility n n Collaborators n n Transfers data Buffers data Synchronizes active neighbors Data source Data sink Filter Class – Data Sink n Responsibility n n Consumes output Collaborators n Pipe

Pipes and Filters n Dynamics n Scenario 1 : a push pipe line

Pipes and Filters n Dynamics n Scenario 1 : a push pipe line

Pipes and Filters n Scenario 2 : pull pipe line

Pipes and Filters n Scenario 2 : pull pipe line

Pipes and Filters n Scenario 3 : mixed pipe line

Pipes and Filters n Scenario 3 : mixed pipe line

Pipes and Filters n Scenario 4 : complex but typical

Pipes and Filters n Scenario 4 : complex but typical

Pipes and Filters n Benefits n n n No intermediate files necessary, but possible

Pipes and Filters n Benefits n n n No intermediate files necessary, but possible Flexibility by filter exchange Flexibility by recombination Reuse of filter components Rapid prototyping of pipelines Efficiency by parallel processing

Pipes and Filters n Liabilities n Efficiency gain by parallel processing is often an

Pipes and Filters n Liabilities n Efficiency gain by parallel processing is often an illusion n n The cost for transferring data between filters Context switching Synchronization Data transformation overhead Error handling

Any Questions?

Any Questions?