Software Architecture: Patterns and Styles

Choose a study mode

Play Quiz
Study Flashcards
Spaced Repetition
Chat to Lesson

Podcast

Play an AI-generated podcast conversation about this lesson

Questions and Answers

Which category of architectural patterns helps in decomposing an overall system task into cooperating subtasks to avoid a 'sea' of components?

  • Distributed Systems
  • From mud to structure (correct)
  • Adaptable Systems
  • Interactive Systems

Which architectural pattern category specifically addresses the organization of software systems emphasizing human-computer interaction?

  • Adaptable Systems
  • From mud to structure
  • Distributed Systems
  • Interactive Systems (correct)

In the context of software architecture, what is the primary purpose of an architectural pattern?

  • To select the programming language for development.
  • To provide a solution to a recurring design problem. (correct)
  • To define the project management timeline.
  • To dictate the specific lines of code to be written.

Which of the following best describes the role of 'Architecture Tactic' in relation to 'Architecture Pattern' and 'Quality Attributes'?

<p>Architecture Pattern includes Architecture Tactic to focus a specific quality attribute, and achieve Quality Attributes. (B)</p> Signup and view all the answers

Which architectural pattern is most suitable for a system needing a complete infrastructure for distributed applications?

<p>Broker (D)</p> Signup and view all the answers

What is the primary goal of the 'Layer' architectural pattern?

<p>To structure applications that can be decomposed into groups of subtasks at a particular level of abstraction. (D)</p> Signup and view all the answers

In the Layer architectural pattern, how are components typically placed within layers?

<p>According to their generality, with more reusable components in lower layers. (C)</p> Signup and view all the answers

In Jacobson's Layer Architecture, what is the role of the 'Business Specific' layer?

<p>To contain elements specific to a business or application domain but reusable across applications. (C)</p> Signup and view all the answers

Which of the following is an example of the Layer architectural pattern in practice?

<p>The OSI 7 Layer Model. (B)</p> Signup and view all the answers

Which statement accurately describes a key consequence of utilizing the Layer architectural pattern?

<p>It enables well-defined abstraction and documentation, promoting reuse. (D)</p> Signup and view all the answers

What is the primary purpose of the Pipe & Filter architectural pattern?

<p>To structure a system that processes a stream of data through multiple stages. (A)</p> Signup and view all the answers

In the Pipe & Filter pattern, what distinguishes a 'Push' system from a 'Pull' system?

<p>The direction of data flow initiation; 'Push' starts from the source, 'Pull' from the sink. (B)</p> Signup and view all the answers

In the context of Pipe & Filter architecture, which characteristic contributes most to flexibility?

<p>The ability to easily rearrange or add filters to the processing pipeline. (C)</p> Signup and view all the answers

For what type of problems is the Blackboard architectural pattern most suitable?

<p>Problems for which no deterministic solution strategies are known. (C)</p> Signup and view all the answers

In a Blackboard system, what is the role of specialized subsystems?

<p>To assemble their knowledge to build a possibly partial or approximate solution. (C)</p> Signup and view all the answers

Which of the following accurately describes a characteristic of the Blackboard pattern?

<p>It supports modifiability and maintainability due to the modular nature of knowledge sources. (D)</p> Signup and view all the answers

What is the primary responsibility of the Broker component in a distributed system?

<p>To coordinate communication between decoupled components. (C)</p> Signup and view all the answers

What is the primary function of a Broker in a distributed system, analogous to real-world concepts?

<p>A messenger and yellow book, facilitating communication and providing directory services. (D)</p> Signup and view all the answers

If a Broker fails in a distributed system, what is a likely consequence?

<p>Components may not be able to locate or communicate with each other. (B)</p> Signup and view all the answers

Which architectural pattern is most suitable for systems with a high degree of user interaction?

<p>Model-View-Controller (MVC) (C)</p> Signup and view all the answers

In the Model-View-Controller (MVC) pattern, what is the responsibility of the 'View' component?

<p>To display information to the user. (D)</p> Signup and view all the answers

In the Model-View-Controller (MVC) pattern, what is the role of the 'Controller'?

<p>Handling user input and updating the model accordingly. (C)</p> Signup and view all the answers

Within the MVC architectural pattern, what is a key characteristic of the 'Model'?

<p>It is independent of the output representation and input behavior. (B)</p> Signup and view all the answers

Which of the following is a valid use case of the Model-View-Controller (MVC) pattern?

<p>A web application with a dynamic user interface. (D)</p> Signup and view all the answers

What is a primary benefit of using the Model-View-Controller(MVC) pattern?

<p>It allows multiple views of the same model and enhances exchangeability of look-and-feel. (D)</p> Signup and view all the answers

What does ADR stand for and what is their primary purpose in software development?

<p>Architecture Description Records: To document key architectural decisions. (B)</p> Signup and view all the answers

Why is 'context' an important element of an Architectural Decision Record (ADR)?

<p>It describes the issue motivating the decision or change. (D)</p> Signup and view all the answers

What is the purpose of documenting the 'rationale' within an Architecture Decision Record (ADR)?

<p>To explain why a particular solution was chosen over alternatives. (B)</p> Signup and view all the answers

In the structure of an Architecture Decision Record (ADR), what do 'consequences' primarily describe?

<p>The resulting easier and more difficult aspects of implementing the architecture. (A)</p> Signup and view all the answers

According to the content covered, which of the following consideration is most important when making technological decisions?

<p>An architect is responsible for defining the architecture and design principles used to guide technology decisions. (C)</p> Signup and view all the answers

What is the first step of implementing a Layer Pattern?

<p>Start at lowest Level. (B)</p> Signup and view all the answers

Which of the following is correct about Layer and Tier?

<p>Layer and Tier are often confused (D)</p> Signup and view all the answers

Choose the correct answer about broker pattern.

<p>Broker forward request from client or transmit result/error back to client (B)</p> Signup and view all the answers

What are the components in MVC?

<p>Model, View, Controller (A)</p> Signup and view all the answers

Which of the following is correct about ADR's content?

<p>All of the above (D)</p> Signup and view all the answers

What is the correct way to access the data of lower layer in Layer Pattern architecture?

<p>adaptor and interface can be use for connector (D)</p> Signup and view all the answers

What is the benefit of Pipe and Filter?

<p>Flexibility by filter exchange (B)</p> Signup and view all the answers

Why developer create application-specific?

<p>Make layers because some components are reusable (C)</p> Signup and view all the answers

Fill in the blank: ______________layer contains element that are specific to application in question.

<p>Application-Specific (D)</p> Signup and view all the answers

What is the difference between Push and Pull in Pipe & Filter?

<p>Push write, Pull read (D)</p> Signup and view all the answers

What is the bad consequence of Blackboard Architecture Pattern?

<p>No deterministic algorithm so results are often not reproducible (B)</p> Signup and view all the answers

Flashcards

Architectural Pattern

Solutions for recurring problems in software design. They're like architectural building styles.

Quality Attribute

A fundamental attribute determining overall quality (security, performance, scalability).

Mud to Structure

Patterns that help avoid a "sea" of components by decomposing tasks and improving structure

Distributed System

Patterns including only Broker patterns that provide a complete infrastructure for distributing applications

Signup and view all the flashcards

Interactive System

Pattern that supports structuring of software with human-computer interaction.

Signup and view all the flashcards

Adaptable Systems

Patterns supporting extension of applications and adaptation to evolving technology.

Signup and view all the flashcards

Layer Pattern

A pattern that structures applications into groups of subtasks at particular levels

Signup and view all the flashcards

Pipe and Filter

A pattern where data moves through filters for processing

Signup and view all the flashcards

Blackboard Pattern

A pattern useful for problems where the solution strategy isn't certain.

Signup and view all the flashcards

Broker Pattern

Broker pattern structures distributed systems via decoupled components using remote service invocations.

Signup and view all the flashcards

MVC Pattern

Divides application into Model, View, and Controller for interactive systems.

Signup and view all the flashcards

Architecture Decision Record

A document capturing design decisions alongside their context and rationale.

Signup and view all the flashcards

Context (in ADR)

Captures issue motivating the need to solve it or change it.

Signup and view all the flashcards

Decision (in ADR)

Defines the proposed or implemented solution to the issue

Signup and view all the flashcards

Rationale (in ADR)

Explains the reasoning behind choosing the specific strategy

Signup and view all the flashcards

Consequences (in ADR)

Lists benefits and drawbacks of this architecture decision.

Signup and view all the flashcards

Study Notes

  • Software Architecture consists of architectural patterns and styles
  • Nacha Chondamrongkul is an Assistant Professor at the School of IT, Mah Fah Luang University

Agenda:

  • Architectural patterns
  • Architecture Decisions
  • Architectural patterns provide a way to structure systems from interactive to distributed

The Architecture

  • Architects look at previous architectures when designing new ones

Architectural Pattern

  • Architectural patterns are solutions for recurring problems and are synonymous with architectural styles
  • Architectural patterns are similar to building styles like Gothic, Pyramid, or Greek
  • They specify the fundamental structure of an application

Overview of Relation:

  • Basic Architecture is the basis of Architecture Patterns
  • Architecture Pattern provides solutions that resolve multiple problems
  • "Most system software has multiple patterns"
  • Architecture Tactic includes Architecture Pattern
  • Architecture Tactic can focus on a specific quality attribute
  • Quality attributes can allow you to achieve the desired outcome
  • “In order to address multiple required quality attributes"

Categories of Pattern

  • Patterns are grouped into 4 categories.
  • “From mud to structure” helps avoid "sea" of components and supports decomposing system tasks into subtasks.
  • Distributed systems include the Broker pattern, which provides a complete infrastructure for distributed applications.
  • Interactive Systems support structuring software systems with human-computer interaction.
  • Adaptable Systems support extension of applications and adapting to evolving technology and functional requirements.

From Mud to Structure

  • There are 3 patterns in this category:
    • Layer
    • Pipe & Filters
    • Blackboard

Layer Pattern

  • Helps structure applications so they can be decomposed into subtasks at particular abstraction levels.
  • Suitable for large systems that require decomposition.
  • Higher-level operations handle higher-level issues by relying on lower-level operations.
  • Lower-level operations handle lower-level issues and adaptors and interfaces can be used as connectors.
  • It allows you to structure a system into different layers
  • Design the upper layers by delegating subtasks to lower layers, while supporting subtasks, until it reaches the highest level
  • The solution is extremely simple from a high-level viewpoint.
  • Example: VAT calculation software

Layer Pattern Example:

  • User visible element: Button, Textfield, windows
  • Specific Application Module: Calculate VAT 7%
  • Common Service Level: Basic mathematic operation +, -, *, /
  • Operating System: Driver for monitor, keyboard, CPU
  • Hardware: Monitor, keyboard, CPU

Layer vs Tier

  • Tier and Layer are often confused
  • The layer pattern places components within layers according to their generality.
  • More general-purpose components (most reusable) are in the lower layers, with a focus on reusing.
  • A tier is a physical machine or server that hosts one or more layers and tiers are not the same thing as layers.

Jacobson's Layer Architecture:

  • Proposed layer architecture (Jacobson 1997)
  • Application-Specific layer contains elements specific to the application.
  • Business-Specific layer contains elements specific to a business or application domain (e.g., financial systems).
  • These can be reusable across applications.
  • Business-Independent layer contains elements independent of business or application domain, such as UI frameworks or databases.

Usage of Layer

  • Network OSI 7 Layer Model
  • Virtual Machine – JVM
  • API – Application Programming Interface
  • MS Windows
  • Information System

Layer Pattern - Consequence:

  • Reuse of Layer: Achieved with well-defined abstraction and documentation.
  • Exchangeability: Achieved with standardized interfaces and adaptors that connect components between layers.
  • Dependencies Kept Local: Achieved with standardized interfaces and adaptors that connect components between layers.

Pipe & Filter

  • Provides structure for processing a stream of data.
  • Suitable for systems that process data streams.
  • These system youtube that detects internet speed to adjust video quality
  • It contains : Data sources, Filter 1, Filter 2, Filter 3 and a Data sink

Pipe & Filter – Push vs. Pull:

  • Push: Data source source pushing to sink downstream
  • Pull: Filters reading from source to sink upstream

Flexibility of Pipe & Filter

  • Flexibility by filter exchange to rearrange and create new fitlers
  • Reuse of filter to reuse components
  • Efficiency by parallel processing to start fitler component in parralel

Known uses of Pipes & Filters:

  • Unix
  • LASSPTool
  • streaming video/audio over internet

Blackboard

  • Useful for problems lacking deterministic solution strategies as it acts as Specialized subsystems whose knowledge allows them to assemble a solution
  • Each subsystem specializes in solving a part of the overall task.
  • This is useful when we do not know the exact solution

What it is useful for

  • Suitable for problems that do not have feasible deterministic solutions for transformation of raw data into high-level data structures:
    • Diagrams
    • Tables
    • English phrases
    • Vision
    • Image recognition
    • Speech recognition

Blackboard Sample

  • Speech recognistion is a sample
  • It leverages control to build a "solution" using segmented Knowledge sources

Consequence of blackboard

  • Supports modifiability and maintainability
  • There are difficulties for testing due to not having a deterministic algorithm
  • There is no good solution that is guarantee
  • It typically has low efficiency

Distributed System

  • The broker pattern is used to structure distributed software systems with decoupled components and allows interaction by remote service invocations
  • A broker component coordinates communication

Broker

  • Suitable for distributed and heterogeneous systems with independently cooperating components.
  • A Broker acts like a directory (yellow book) and messenger, servers resgister in the broker
  • They forward requests from the cient
  • They encapsulate connectivity, which can hide IP addresses to create VPNs
  • Example : Bangkok bridge Tokyo

The Broker facilitates:

  • Implementation of service by registering itself with broker to respond back
  • Supports un/register server, transfer of service, location of server and communication with other brokers
  • Implements functionality to encapsulate system
  • Implement the client functions, and the request sent

Known Uses of Brokers:

  • World Wide Web (WWW)
  • CORBA - Common Object Request Broker Architecture
  • The network specific functionality it enables involves mediating local brokers

Consequences of Broker

  • Portability of system
  • Changeability/Extensibility of components.
  • Location Transparency.
  • Suffers from Restricted efficiency due to indirect communication because if broker faces it crashes it cannot access

Interactive System:

  • For systems with high degree of user interaction and usability enhancement.
  • There are 2 patterns within this group
    • Model View Controller (MVC)
    • Presentation Abstraction Control

Model View Controller (MVC):

  • Suitable for interactive applications with a flexible human-computer interface.
  • Divides the system into 3 parts:
    • Model: Core functionality & data
    • View: Information displayed to user (Output)
    • Controller: Handles user input (Input)
  • View & Controller together are the user interface.
  • The model is indepedent from output to input
  • It displays info and propagates change, and often works controller 1 to 1 where the view translates events

Functional Core

  • Has model to provide function, register dependancies to controller, and notify data changes
  • Translate events and send the request for propogation and disables buttons
  • Separate human-computer interaction from core functionality

Consequence of MVC:

  • Multiple Views of the same Model.
  • Exchangeability of look-and-feel.
  • Framework potential.
  • Increased Complexity.
  • Potential Inefficiency with data access in view if updates are frequent.

Decision:

  • The decision to develop a UI in mobile as opposite to web, a UI in Authetication as compared to 2 factor Authetication
  • Architects take responsiblity to guding technology and decisions

Architecture Description Record

  • ADR is a document that captures and communicates important decisions made during the software architecture design process.
  • ADRs provide the way to document standardized context, consideration, and rationale behind a specific architectural decision.
  • Context is needed to find which issues we need to motivate for a change
  • We need to find the best solution and why we choose it
  • The consequences are the pros and cons for why it becomes easier and difficult

Studying That Suits You

Use AI to generate personalized quizzes and flashcards to suit your learning preferences.

Quiz Team

Related Documents

More Like This

Use Quizgecko on...
Browser
Browser