QA From Book

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 6

What.is.an.architectural.pattern,.and.how.does.it.differ.from.detailed.design.patterns?

2..List. and. explain. the. different. types. of. systems. discussed. for. which.
architectural.

.patterns.can.be.employed.

3..Are.software.architectures.restricted.to.only.one.architectural.pattern.for.its..logical
.

design,.or.can.they.include.more.than.one.architectural.pattern?.Explain.with.example
s.

4..Can.architectural.patterns.lead.to.direct.translation.to.code?.Explain.

5..Explain.the.following.architectural.patterns,.and.provide.an.example.of.a.system.

(different.from.the.one.discussed.in.this.chapter).appropriate.for.them..Explain.how.

these.patterns.support.particular.quality.attributes.

a.. Blackboard

b.. Pipe.and.filter

c.. MVC

d.. Layered

Patterns and Styles in Software Architecture • 137

6..Compare.and.contrasts.the.following.architectural.patterns:

a.. Client–server.vs..broker

b.. Layered.vs..main.program.and.subroutine
7..How.can.the.pipe.and.filter.architectural.pattern.enhance.the.performance.of.softwa
re.

systems?

8..How.can.the.MVC.enhance.a.system’s.modifiability,.usability,.and.reusability?

9..How.can.the.broker.pattern.enhance.a.system’s.interoperability?

. 10..How.can.the.layered.pattern.support.a.system’s.security.and.portability?

.
11..Explain.how.using.design.elements.from.different.architectural.views.can.support.

the.use.of.architectural.patterns.for.providing.a.complete.picture.of.an.architectural.

design.element

Architectural patterns and detailed design patterns are both tools used in software
development, but they focus on different levels of detail:

Architectural Pattern:

 High-level overview: Defines the overall structure of a software system.


 Focuses on:
o How the system is divided into major components.
o How these components interact with each other.
o Addressing system-wide qualities like scalability, performance, and security.
 Think of it as: A blueprint for the entire building.
 Examples: Client-Server, Microservices, Layered Architecture.

Detailed Design Pattern:

 Lower-level specifics: Deals with how specific functionalities or problems within a


component are addressed.
 Focuses on:
o Reusable solutions to common programming problems.
o Code-level structures and relationships between classes and objects.
 Think of it as: Detailed instructions for plumbing or electrical wiring within a specific room.
 Examples: Singleton, Factory Method, Adapter Pattern.

Here's an analogy:

Imagine building a house. The architectural pattern would define the overall layout -
whether it's a single-story ranch or a two-story colonial. It would also specify the
placement of major components like the kitchen, living room, and bedrooms.

Detailed design patterns would come into play when designing specific rooms. These
patterns might involve how to create a more efficient plumbing layout for the kitchen
or how to wire the lights in the living room.

In short, architectural patterns provide a high-level roadmap for the entire system,
while detailed design patterns offer specific solutions for smaller, more focused
problems within that system.

Q2 :

No, software architectures are not restricted to using only one architectural pattern. In
fact, it's quite common to combine multiple patterns to create a system that best
addresses its specific needs. This allows you to leverage the strengths of different
patterns to build a robust and flexible system.

Here are some examples of how multiple architectural patterns can be combined:

Layered Architecture with Microservices: A layered architecture separates


the system into distinct layers (e.g., presentation, business logic, data access).
Within each layer, you could implement microservices, which are small,
independent services that provide specific functionalities. This combination
allows for modular development, easier scaling of individual services, and
cleaner separation of concerns.


Event-Driven Architecture with Client-Server: An event-driven


architecture relies on events to trigger actions within the system. This can be
combined with a client-server architecture, where clients send requests to
servers. The server might then publish events based on those requests, which
are picked up by other components in the system. This enables loose coupling
and real-time processing for specific functionalities.

API Gateway with Microservices: An API Gateway acts as a single entry


point for all incoming requests to a system built with microservices. This
combination centralizes authentication, authorization, and load balancing for
the microservices, improving security and efficiency.

Q3 :

Architectural patterns don't directly translate to code. They provide a high-level


blueprint for the system structure and communication between components, not
specific implementation details. Here's why:

Abstraction: Architectural patterns are designed to be language-agnostic.


They focus on the overall organization and interactions, not the syntax of a
particular programming language.


Flexibility: A single architectural pattern can be implemented in various ways


depending on the chosen programming language, frameworks, and libraries.


Focus on System Design: They guide the system's logical design, not the
nitty-gritty details of classes, functions, or algorithms.

1. Pipe and Filter for Performance:

The pipe and filter architectural pattern can enhance software system performance in
several ways:

 Parallelization: Filters can potentially be executed in parallel if the data processing they
perform is independent and doesn't require strict order. This can significantly improve
throughput for data-intensive tasks.
 Stream Processing: Data flows through the pipeline in a continuous stream, avoiding the
need to load and unload entire datasets at each stage. This reduces memory usage and
improves processing speed.
 Focus on Specific Tasks: Each filter is responsible for a well-defined task, allowing for
optimization of individual processing steps. This modularity can lead to more efficient code.
 Reusability: Well-designed filters can be reused in different pipelines, potentially reducing
code duplication and improving overall efficiency.

2. MVC for Modifiability, Usability, and Reusability:

The Model-View-Controller (MVC) pattern enhances a system's:

 Modifiability: Changes to the data model (M) are isolated from the view (V) and controller
(C). This allows modifying the data or business logic without affecting the user interface or
how users interact with the system.
 Usability: The separation of concerns in MVC leads to a clear separation between the user
interface (V) and the underlying logic (M, C). This can make the system easier to learn and
use for both developers and end-users.
 Reusability: The view components (V) can often be reused across different functionalities
with the same data model (M) or controller (C). This reduces development time and
promotes code reuse.

3. Layered Pattern for Security and Portability:

The layered architecture pattern can support a system's:

 Security: Security checks and access control can be implemented at specific layers. For
example, a data access layer can handle user authentication and authorization before
granting access to sensitive data.
 Portability: By separating concerns into distinct layers, the core business logic layer can be
made independent of the presentation layer and data access layer. This allows the system to
be more easily ported to different platforms or technologies as long as the core logic remains
compatible.

4. Design Elements from Different Architectural Views:

Several architectural views contribute to a complete picture of an architectural design


element:

 Logical View: Defines the system's functional components and their interactions (e.g., layers
in a layered architecture, filters in a pipe and filter pattern).
 Process View: Focuses on the workflows and processes within the system, including data
flow and task execution.
 Deployment View: Describes how the system's components are physically deployed across
different servers, containers, or cloud environments.
 User Interface View: Represents the user interface elements and how users interact with the
system.

By combining these views, you get a comprehensive understanding of the system's


structure, behavior, and deployment. Using design elements from each view helps
ensure consistency between the high-level architectural pattern and the system's
implementation details. For example, a pipe and filter pattern might be represented in
the logical view with processing steps as filters, while the process view would detail
the data flow between these filters. The deployment view might show how these
filters are deployed on different servers for parallel processing.

You might also like