I have no name yet Flashcards

1
Q

one of the commonly architectural styles include: Client–server

Briefly explain it and its components / connectors. Give 1 example

A
One component (the server) provides a service to the other component (the
client). The server waits for requests from clients, processes each one as it as received, and returns a response to the client.

Example: a request sent from a web
browser to a web server

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

one of the commonly architectural styles include: Call-return

Briefly explain it and its components / connectors. Give 1 example

A

a component (the caller) makes a procedure call to another component (often known as the callee) and waits for the call to return.

Example: In traditional software a main program calls a subprogram and then
waits for a reply

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

one of the commonly architectural styles include:Layered

Briefly explain it and its components / connectors. Give 1 example

A

System is structured as a series of layers, each layer uses services provided by the layers below and supplies services to the layer above.

The components in this style are the various services in each layer and the connectors are the calls made on the services.

example: compiled Java program, which
executes in a Java virtual machine that in turn makes calls to services
supplied by the operating system

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

one of the commonly architectural styles include: Peer-to-peer

Briefly explain it and its components / connectors. Give 1 example

A

Resembles the client–server style except that all the components are both clients and servers and any component can request
services from any other component.

Each node is a component and all components are identical

Example: torrent sharing website

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

one of the commonly architectural styles include: pipes and filters

Briefly explain it and its components / connectors. Give 1 example

A

components are objects or small independent subprograms (filters) that process a stream of data and pass the results on to other components for further processing. Communication is
unidirectional. Each filter has no knowledge of other filters upstream or downstream.

The connectors are services, provided by the operating environment, that ‘pipe’ data from one filter to another

example: Unix operating system for
combining functions and is also seen in the Stream application programming
interface (API) introduced from Java 8 onwards.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

one of the commonly architectural styles include: data-centered

Briefly explain it and its components / connectors. Give 1 example

A

Data provider is a centralised store of
persistent data. There are many clients
who are data consumers

Components are a database server and clients that access it. Connectors are database queries made via a special database connection

Example: A database holding personnel records is an example of this form, with
authorised users being able to log on and submit queries.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

one of the commonly architectural styles include: independent components

Briefly explain it and its components / connectors. Give 1 example

A

components execute concurrently and
are decoupled as far as possible, but can communicate by messages that allow them to exchange data or coordinate their operations. The connectors are the message exchange protocols, which are normally asynchronous

Example: a set of components might control different parts of a chemical processing plant, independently regulating the part each is responsible for, but sharing data and coordinating with one another by exchanging messages.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

one of the commonly architectural styles include: service-oriented

Briefly explain it and its components / connectors. Give 1 example

A

There are two kinds of component, the
consumers and the providers. Consumers can combine services in order to carry out the business processes they require. The connectors are the requests and responses sent between consumers and providers, using standard communication protocols

Example: An example could be different divisions of an organisation whose systems all use a common set of services such as payroll, personnel, customer records
management billing and so on.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

one of the commonly architectural styles include: notification

Briefly explain it and its components / connectors. Give 1 example

A

Two kinds of components are observers and
subjects.

At architectural level this style is usually referred to as publish–
subscribe.

Example: components can register themselves with other components to
receive information about events such as user input and react to them by
executing appropriate event-handling code.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

Design pattern: Adapter

Purpose
How it works – a description of the solution
When to use it
Example of use

A

Name. Adapter.

Purpose. Allows a client to use a class that has a different interface from the one the client is expecting.

How it works. An Adapter class is introduced that provides the client with the interface it is expecting but forwards client requests to an object of the class with the incompatible interface

When to use it. When you want to use a class with a client that is expecting a different interface from the one the class provides.

Example. Legacy software may need to be integrated with a newer system that uses a different interface.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

Design pattern: Model-view-controller pattern (MVC)

Purpose
How it works – a description of the solution
When to use it
Example of use

A

Can be regarded as an architectural style as well
as a design pattern. (MVC) pattern can represent
the overall architecture of some applications, but it can also be a pattern applied to designing just part of a system.

Name. Model-view-controller (MVC).

Purpose. Splits user interface interaction into three distinct roles: the model of the domain, the view representing that domain, and the controller of changes to the domain.

How it works: It identifies three roles: model, view and controller.

When to use it. When you have a user interface that you want kept separate from the model. Advantages:
*The user interface is not affected by changes in the implementation
of the business logic.
*The same domain logic can be used with different user interfaces.
*The business logic can be tested separately from the interface logic.

Example.a chart (the view) which is a graphical representation of the state of an underlying model. If the user changes a value in the table (the controller) the state of the model changes and the change is propagated to the chart

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

Design pattern: Observer Pattern

Purpose
How it works – a description of the solution
When to use it
Example of use

A

Name. Observer (also sometimes known as publish–subscribe like the notification architectural style which it resembles).

Purpose. Mechanism needed to ensure that when the
state of an object changes related objects are updated to keep them in step while keeping coupling between them be loose so you have the flexibility to vary them independently.

How it works.
One object has the role of the subject (or publisher) and one or more other objects the role of observers (or subscribers). The observers register themselves with the subject and if the state of the subject changes the observers are notified and can then update themselves.

When to use it. When different parts of a system have to be kept in step with one another without being too tightly coupled.

Example. As noted, the relationship between the view and the model in an MVC design can be realised by applying the observer pattern. The view registers with the model and is notified every time the model’s state changes, allowing it to update itself to reflect the change.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

Design pattern: Singleton pattern

Purpose
How it works – a description of the solution
When to use it
Example of use

A

Name. Singleton.

Purpose. In many cases only a single instance of a class is required and allowing creation of more than one instance would compromise the design of the system.

How it works.
The Singleton class provides no public operation for creating instances. Instead it defines a public operation getInstance() that lets clients access the unique instance of the class. Only the operation getManager() is public. The attribute manager and the operation create() are declared as private, so other classes have no direct access to them

When to use it. When there must be only one instance of a class. Often this is associated with some global resource that other classes need access to.

Example. the design of a media manager in a multimedia application. There should be only one instance of the manager, which is created by the MediaManager class itself the first time a client accesses the manager.
This strategy of creation on demand is called lazy instantiation.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

Design pattern: Factory pattern

Purpose
How it works – a description of the solution
When to use it
Example of use

A

Name. Factory

Purpose. If the creation and initialisation of an object is complex and liable to change, making clients responsible for the task introduces an undesirable level of coupling. Encapsulating the creation in a dedicated factory class hides the details from the client and reduces the coupling.

How it works: The client has a dependency,
shown by a dashed line, on the factory for the creation of the product, and the factory depends on the Product class to create one of its instances. The factory is often a singleton.

When to use it. Whenever object creation and initialisation is complex or depends on information that clients may not know or is likely to change.

Example. Many applications need to use a database management system (DBMS) for storage. A DBMS is an independent program that applications communicate with using a particular protocol. A suitable object can handle the communications but needs to be created and configured correctly for the DBMS concerned. A connection factory can provide the required object without the client application needing to know any details.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

Design pattern: Template Method

A

Purpose: The problem it solves is the need to keep the
basic structure of an operation the same but leave it up to subclasses to define how some of the steps will be implemented.

How it works: works by defining a Template class, which has a template method that captures the structure, and then declares abstract methods – called primitive operations –for the steps that can vary. Subclasses can then override the primitive operations to provide specific implementations of the corresponding steps but within the same structure.

When to use it

Example of use

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

Suggest how the Factory and the Template Method patterns might be used together.

A

The Factory would create the instance of the subclass and the template would deal with the communication and interaction.