I have no name yet Flashcards Preview

My TMA derived Questions > I have no name yet > Flashcards

Flashcards in I have no name yet Deck (16):
1

one of the commonly architectural styles include: Client–server

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

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

2

one of the commonly architectural styles include: Call-return


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

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

3

one of the commonly architectural styles include:Layered


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

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

4

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


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

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

5

one of the commonly architectural styles include: pipes and filters


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

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.

6

one of the commonly architectural styles include: data-centered

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

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.

7

one of the commonly architectural styles include: independent components


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

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.

8

one of the commonly architectural styles include: service-oriented

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

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.

9

one of the commonly architectural styles include: notification

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

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.

10

Design pattern: Adapter

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

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.

11

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

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

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

12

Design pattern: Observer Pattern

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

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.

13

Design pattern: Singleton pattern

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

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.

14

Design pattern: Factory pattern

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

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.


15

Design pattern: Template Method

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

16

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

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