Unit 10 - Building blocks and enterprise architectures Flashcards

1
Q

Whats is CBD?

A

Component-based development

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

What are the two types of interface for components?

A

A provided interface, which specifies what the component makes available to other components.

A required interface, which specifies what the component expects from other components.

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

Think of another concept that uses principles similar to software components?

A

A component closely resembles the concept of

an object in an object-oriented language.

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

Think of some possible advantages and disadvantages of building software by plugging together off-the-shelf components.

A

Advantages
. Reusing a standard component should be cheaper than developing software from scratch.
. Using off-the-shelf components will allow applications to be developed more quickly.
. Standard components will have been used in many other projects, so their behaviour will be well understood and any bugs are likely to be known.
. Components are pluggable, so it is often possible to replace one component with another providing it has the same interface and behaves in the same way.

Disadvantages
. Using standard components may restrict what we can do since we have to work with the capability of the components.
. Some additional software is likely to be needed as ‘plumbing’.
. If the interfaces of components are incompatible, adapters will have to be written.
. Creating a system by plugging together off-the-shelf components may not be as simple as it sounds.

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

An application built using components is likely to be structured using which architectural style?

A

A call-return architectural style

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

How do components interact

A

Through their interfaces (required and provided)

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

Suppose a component is implemented as an instance of a Java class. What corresponds to:
. the provided interface of the component
. the required interface of the component?

A

The provided interface consists of all the public methods in the class.
The required interface consists of all the methods from other classes that the component’s methods make use of.

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

In the context of software components, describe a concept that is similar to substitutability.

A

Components are replaceable: a component can be replaced by another that does the same job.

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

What is SOA?

A

Service-oriented architecture

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

What do components help achieve?

A

Components keep coupling low by hiding their implementation and communicating only via their interface.

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

Give a definition of a service

A

A service is an abstract description of some unit of business functionality, usually described in terms that are meaningful from both a business and a technical perspective.

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

In order to be used, a service must be implemented by?

A

A service provider, and accessed over a network by a
client, also known as a service consumer or a service requester.

You can think of a service as being what a component provides, but the component itself has been abstracted away, leaving the service as something the requester simply accesses by connecting to an end-point, without any knowledge of where or how the service is provided. This is a more loosely coupled model than component-based development.

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

What are the similarities and differences between components and services?

A

Similarities
. have well defined interfaces which specify how other software can interact with them

. aim to be loosely coupled, by not exposing details of their implementation, thus allowing it to be changed without disturbing other parts of the system

. can be composed – services can be combined to build up more complex functionality

. aim to be reusable, so that the same service can be used as part of many different applications.

Differences
. Communication with components tends to depend on proprietary technologies, which restricts interoperability. Services use standard communication protocols, which allows them to interoperate in a
platform- and language-independent way.

. Services are discoverable. Clients can access a repository to find details of available services.

. Components run on computers controlled by the organisation using them and if many organisations use a component it executes in multiple locations. A service in contrast resides on a provider server, typically
owned by a different organisation, and executes at a single end-point that all clients communicate with.

. Services should be autonomous and as far as possible independent of other services. So, for example, they do not have a ‘requires’ interface. This is so that they can be more reusable and also more insulated from
changes in their operating environment. Not all dependencies can be avoided of course, for example a service may rely on a particular database.

In addition, services have two properties which may sometimes apply to components as well:

Statelessness. A service or component is stateless if it responds to each request as a ‘one-off’, without retaining any memory of previous requests.
This reduces complexity, because each request can be dealt with in the same way. It also allows increased demand to be dealt with by simply deploying more copies of the service or component, since it will not matter which copy is allocated to which request.

Location transparency. Clients can use a service without needing to know its physical location – that is, what computer it is actually running on. It is also possible for components to be location transparent and be invoked using a logical name rather than a physical address. The advantage of location transparency is that the service or component can be moved to a different
computer without clients being affected.

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

What are the elements involved in the find, bind and invoke cycle?

A

. The consumer.

. The service. Each service has a service description that specifies how the client can interact with it. The service description will define the signature of the service and may describe other aspects of the contract, although this is not always the case and some information about the service typically needs to be provided outside the service description.

. The provider, which is the platform on which the service is implemented. It accepts and executes requests from clients.

. The registry (or locator) which allows clients to find services.

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

What are the three kinds of service?

A

. utility services, which provide some generic functionality useful in a wide range of applications

. business services, which implement a specific business function

. coordination services, which coordinate workflows composed of a number of individual services.

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

What is service orchestration?

A

When we build an application within an SOA we must choose suitable services and then compose them into a workflow, so that the services are invoked in the proper sequence. This overall coordination is referred to as service orchestration, and successful orchestration is obviously essential to whether or not the application will work.

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

What are the stages for developing an application by composing services within an SOA?

A

. Design a workflow and specify what services will be needed.

. Use the registry to discover candidate services.

. From the candidates select a suitable set of services.

. Orchestrate the chosen services according to the workflow. This may be done using a special-purpose orchestration language, or we may write an
orchestrating program in a standard language such as Java.

. Test the application and correct any faults found.

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

What are the advantages of SOA?

A

. Agile and flexible response. SOA supports a flexible business model that can respond quickly to changes in customers’ requirements, new business opportunities or competitive threats. Developers can quickly assemble new applications by combining existing services.

. Less duplication. If several parts of a business require the same function, it can be packaged as a service and made available for reuse.

. Integration of legacy applications. Legacy software can be wrapped as a service and made to interoperate with other applications.

. Use of third-party services. Systems can easily incorporate functions, for example credit card validation or online payment, provided as services by
external suppliers.

. Language independence. Services written in different languages can interoperate using standard protocols.

19
Q

What are quality attribute scenarios?

A

A tool that allows specification of non-functional requirements in a more precise and detailed form which can be used to help make architectural
decisions

20
Q

What are the individual components that comprise to form a quality attribute scenario in the six part model?

A

. The source is a human actor, another system, or anything else that can generate a stimulus.

. The stimulus is any kind of event or request.

. The artefact is what will respond to the stimulus. It might be a running component or service if we are considering performance for example, but it could be code or documentation if we are interested in maintainability.

. The environment specifies the conditions which the scenario assumes the artefact will be operating under. For instance if we are concerned with performance the environment might be either ‘normal operation’ or
‘overloaded’.

. The response is what happens as a result of the artefact receiving the stimulus.

. The response measure is an objective yardstick by which we can test if the requirement has been met.

21
Q

What values can the Source be for a quality attribute scenario?

A

Internal/External

22
Q

What values can the Stimulus be for a quality attribute scenario?

A

periodic events
sporadic events
bursty events
stochastic events

23
Q

What values can the Environment be for a quality attribute scenario?

A

normal

overload

24
Q

What values can the Response measure be for a quality attribute scenario?

A
latency
deadline
throughput
jitter
miss rate
data loss
25
Q

What is a sporadic event?

A

A sporadic event is one that is infrequent and isolated

26
Q

What is a stochastic event?

A

A stochastic event is one occurring randomly but according to a well-defined probability
distribution: for example heads coming up when a coin is flipped.

27
Q

What is a bursty event?

A

Bursty events are ones coming in sudden and unpredictable clusters overlaying normally low background activity.

28
Q

What is latency?

A

Latency is the time taken to process a stimulus, for example how long does a search engine take to respond to a query?

29
Q

What is throughput?

A

Throughput is the number of events dealt with in a given time.

30
Q

What is jitter?

A

Jitter is the amount of variation in latency:

for example, are some responses very quick while others take much longer?

31
Q

What is miss rate?

A

Miss rate measures the proportion of events that are not responded to?

32
Q

Invent a performance scenario similar to the one in Table 3 but for a search engine.

A

Source: External : Web Browser, internet user
Stimulus: Stochastic event: Search request
Artefact: System: Search engine
Environment: Normal: browser and internet connection
working normally
Response: Process Stimuli: return list of search hits
Response Measure: Latency: first 10 hits returned within 0.35 seconds for 99% of queries

33
Q

Think of situations where the pattern of events for a performance scenario might be:
. periodic
. sporadic
. bursty.

A

Periodic
Anything that occurs regularly, for example information sent at the same time each day from a weather station, or status information sent every minute from a spacecraft.

Sporadic
Messages sent to an address for reporting problems, or signals from a device monitoring earth tremors.

Bursty
Search queries about a suddenly popular topic, or signals from a device reporting lightning strikes in a particular area.

34
Q

Think of two application areas where the appropriate response measure for a performance scenario would be something other than latency.

A

. a system controlling a plant processing industrial chemicals – deadline
. an online shopping site – throughput
. an online gaming site – jitter (since users will expect consistent response times)
. a social networking site – data loss
. an online shopping site – miss rate.

35
Q

From your study of the module, list some other types of reusable solution, apart from design tactics, that are available to software engineers.

A
. analysis patterns
. requirements patterns
. architectural styles
. design patterns
. language idioms
. components
. services.
36
Q

What are the three main forms of Tactics for meeting performance requirements.

A

Tactic 1: Manage demand

How many?

If the frequency of stimuli is controllable, for example if we are periodically asking a weather station for the current temperature, we can simply sample the stimuli at a rate the system can keep up with.

Otherwise incoming stimuli are placed in a queue and processed as soon as possible. The queue will have a maximum length, which in some circumstances may be exceeded, causing stimuli to be missed, but this is
unavoidable since no system has limitless capacity.

How much?

Processing stimuli requires computations and access to resources – a demand on the system. Using efficient algorithms and resource requests will reduce this demand.

Tactic 2: Manage system capacity

Resource provision

One way to deal with demand is to increase resources: storage, processing or communications. A trade-off is involved since increasing resources has a financial cost.

Bottlenecks
There may be bottlenecks: widely used resource such as data with only one point of access, or computations carried out just in a single location.

If processing stimuli involves such a bottleneck,
performance is likely to suffer. To overcome this we can provide multiple copies of the data, or run the computation in multiple locations.

Concurrent processing
Wherever possible, stimuli should be processed in parallel. Even where we do not have multiple processors it is usually possible to process stimuli in
separate interleaved threads of control and so make more effective and efficient use of resources, for example by ensuring input and output is not idle, by assigning it to a thread that is currently ready to use it.

Tactic 3: Match resource to demand (also known as arbitrating resources)

Resources must be matched to demand in a way that best meets quality requirements.

For example, to minimise latency we would use a scheduling policy that deals with short tasks before lengthier ones – rather like the ‘10 items or fewer’ queue in supermarkets.

If deadline is the measure then each task must have a priority and the scheduler must ensure that higher-priority tasks are dealt with first.

To achieve throughput the scheduling policy must attempt to maximise use of resources, which means that, whenever a task cannot make progress for some
reason, resources it is using must be temporarily reallocated, allowing other tasks to use the slack capacity.

37
Q

Write down in your own words what flexibility means in relation to software.

A

Flexibility is the ability for software to be changed easily.

38
Q

What concepts introduced in the module relate to flexibility? Come up with as many as you can and write them down.

A

◦ Low coupling so changes don’t have knock-on effects.
◦ High cohesion so functions that are closely related can get changed together as a unit.
◦ Hiding implementation behind interfaces and contracts
because this keeps coupling as low as possible.
◦ Use component-based development so components are pluggable/replaceable.
◦ Delegate details such as object creation to factories so clients don’t need to know them and coupling is kept low.
◦ Use layers. Low coupling and separation of concerns.
◦ Wrap legacy software (related to hiding functions behind interfaces).
◦ Package functions as loosely coupled services.

39
Q

What are the main forms of Tactics for meeting flexibility requirements.

A

Tactic 1: Minimise coupling
Coupling is concerned with how much changing one part of the system affects other parts. If coupling is low then a change in one place does not have knock-on consequences for other parts of the system.

Tactic 2: Maximise cohesion
Cohesion measures how closely the activities of a module are related to one another. Module here could mean any kind of subsystem – a component, a
service, an object-oriented class and so on. If a module has high cohesion it will group together a set of closely related activities and exclude unrelated ones. Its activities will all share a common purpose.
If activities are together within a module they will be less isolated from one another than if they are part of different modules. If a module cuts across many different concerns it may need to be changed frequently, and a change required to one activity in a module may have effects on otherwise unrelated
activities.
Tactic 3: Keep modules small
The idea here is fairly intuitive: if modules are small and a change involves just a single module it will be relatively easy to make. However, we need to make sure that we do not separate a group of activities that are likely to change as a unit. Otherwise, if a change does need to be made, the number of modules affected will have been increased.

Tactic 4: Bind as late as possible
A binding is simply an association between two things.
For example:
. In an object-oriented programming language a variable name is bound to an object when the object is assigned to the variable.

. A user interface uses a particular look and feel, so it is bound to it.

. In a service-oriented architecture a consumer finds a service from a registry and binds to the service.

. A symbolic name such as www.open.ac.uk is bound to a numerical IP address (137.108.198.32 at the time of writing, 2014).

The longer we can delay any binding, the more flexible the system will be, because a different choice remains available.

40
Q

List as many ways as you can think of to reduce coupling.

A

Use components that hide their implementation behind interfaces.
Use services that hide their implementation behind interfaces.
Use a layered architecture.
Use packages to group closely related elements.
Separate model from presentation.
Hide legacy software behind wrappers.
Delegate object creation to factories.
Use a registry to locate objects or services instead of having to know their location.

41
Q

Java EE applications follow a layered architecture. Describe how the Java EE containers and other elements fit into a three-layer architecture

A

Browsers, applet containers, application clients, web containers, JavaServer Faces and servlets are all in the presentation layer.

The EJB container and EJBs are in the application domain, since EJBs are business components.

The database is part of the infrastructure.

42
Q

What does REST stand for?

A

REST stands for representational state transfer.

43
Q

What is a RESTful web service?

A

RESTful services follow a different philosophy from components.

RESTful web services use a uniform interface consisting only of a set of standard methods which are always the same for every service. These are the standard HTTP (hypertext transfer protocol) methods, used by web
browsers to communicate with web servers. The commonest of these is GET, which is the request the browser sends to the server when you open a web
page. The request is sent to the URL of the web page and the server at that web address responds with the information requested, which the browser then displays.