Documente Academic
Documente Profesional
Documente Cultură
Q1) With the help of neat block diagram of ABC (architecture business cycle). Explain in
detail the different activities which are involved in creating software architecture.
(10 Marks)(Jun 14, Jun 15,Jan 16)
Soln:
Software architecture is a result of technical, business, and social influences. Its existence in turn
affects the technical, business, and social environments that subsequently influence future
architectures. We call this cycle of influences, from the environment to t he architecture and
back to the environment, the Architecture Business Cycle (ABC).
x Developers must understand the work assignments it requires of them, testers must
understand the task structure it imposes on them, management must understand the
scheduling implications it suggests, and so forth.
x Constant vigilance is required to ensure that the actual architecture and its
representation remain to each other during this phase.
Q2) Explain the Architecture Business Cycle?(Jan 14,Jan 16)( (10 Marks)
Soln :
Software architecture is a result of technical, business, and social influences. Its existence in turn
affects the technical, business, and social environments that subsequently influence future
architectures. We call this cycle of influences, from the environment to t he architecture and
back to the environment, the Architecture Business Cycle (ABC).
prescribes a structure for a system it particularly prescribes the units of software that must be
implemented (or otherwise obtained) and integrated to form the s ystem. These units are the basis
for the development project's structure. Teams are formed for individual software units and the
development, test, and integration activities all revolve around the units. Likewise, schedules and
budgets allocate resources in chunks corresponding to the units. If a company becomes adept at
building families of similar systems, it will tend to invest in each team b y nurturing each area of
expertise. Teams become embedded in the organization's structure. This is feedback from the
architecture to the developing organization.
In the software product line, separate groups were given responsibility for building and
maintaining individual portions of the organization's architecture for a family of products. In any
design undertaken by the organization at large, these groups have a strong voice in the system's
decomposition, pressuring for the continued existence of the portions they control.
The architecture can affect the goals of the developing organization. A successful system built from
it can enable a company to establish a foothold in a particular market area. The architecture
can provide opportunities for the efficient production and deployment of similar systems, and the
organization may adjust its goals to take advantage of its newfound expertise to plumb the market.
This is feedback from the system to the developing organization and the systems it builds.
The architecture can affect customer requirements for the next system by giving the customer the
opportunity to receive a system (based on the same architecture) in a more reliable, timely, and
economical manner than if the subsequent system were to be built from scratch. The customer
may be willing to relax some requirements to gain these economies. Shrink-wrapped software has
clearly affected people's requirements by providing solutions that are not tailored to their precise
needs but are instead inexpensive and (in the best of all possible worlds) of high quality. Product
lines have the same effect on customers who cannot be so flexible with their requirements.
The process of system building will affect the architect's experience with subsequent systems by
adding to the corporate experience base. A system that was successfully built around a tool bus or
.NET or encapsulated finite-state machines will engender similar systems built the same way in
the future. On the other hand, architectures that fail are less likely to be chosen for future projects.
A few systems will influence and actually change the software engineering culture, that is, the
technical environment in which system builders operate and learn. The first relational
databases, compiler generators, and table-driven operating systems had this effect in the 1960s
and early 1970s; the first spreadsheets and windowing systems, in the 1980s. When such
pathfinder systems are constructed, subsequent systems are affected by their legacy.
Q3) Define Software Architecture. Explain the common software Architecture Structures?
(Jan 14, Jun 14,Jan 15)(10 marks)
So l n :
Architectural structures can by and large be divided into three groups, depending on the broad nature of
the elements they show.
x Module structures.
Here the elements are modules, which are units of implementation. Modules represent a code-based way
of considering the system. They are assigned areas of functional responsibility. There is less emphasis on
how the resulting software manifests itself at runtime. Module structures allow us to answer questions
such as What is the primary functional responsibility assigned to each module? What other software
elements is a module allowed to use? What other software does it actually use? What modules are related
to other modules by generalization or specialization (i.e., inheritance) relationships?
x Component-and-connector structures.
Here the elements are runtime components (which are the principal units of computation) and connectors
(which are the communication vehicles among components). Component-and-connector structures help
answer questions such as What are the major executing components and how do they interact? What are
the major shared data stores? Which parts of the system are replicated? How does data progress through
the system? What parts of the system can run in parallel? How can the system's structure change as it
executes?
• Allocation structures.
Allocation structures show the relationship between the software elements and the elements in one or
more external environments in which the software is created and executed. They answer questions
such as What processor does each software element execute on? In what files is each element stored
during development, testing, and system building? What is the assignment of so ftware elements to
development teams?
Q4) State and explain the different architectural activities (Jun 14,Jan 15) (10 Marks)
Soln:
x Architecture is high-level design. Other tasks associated with design are not architectural,
such as deciding on important data structures that will be encapsulated.
• Architecture is the overall structure of the system. The different structures provide the
critical engineering leverage points to imbue a system with the quality attributes that will render it a
success or failure. The multiplicity of structures in an architecture lies at the heart of the concept.
Architecture is the structure of the components of a program or system, their interrelationships, and
the principles and guidelines governing their design and evolution over time. Any system has an
architecture that can be discovered and analyzed independently of any knowledge of the process by
which the architecture was designed or evolved.
• Architecture is components and connectors. Connectors imply a runtime mechanism for
transferring control and data around a system. When we speak of "relationships" among elements, we
intend to capture both runtime and non-runtime relationships.
Q5) Define the Software Architecture? Discuss in detail implication of the definition?
(Jun 15, Jan 16)(10 Marks)
Soln:
There are fundamentally three reasons for software architecture’s importance from a technical
perspective.
x Communication among stakeholders: software architecture represents a common abstraction of
a system that most if not all of the system’s stakeholders can use as a basis for mutual
understanding, negotiation, consensus and communication.
x Early design decisions: Software architecture manifests the earliest design decisions about a
system with respect to the system's remaining development, its deployment, and its maintenance
life. It is the earliest point at which design decisions governing the system to be built can be
analyzed.
x Transferable abstraction of a system: software architecture model is transferable across
systems. It can be applied to other systems exhibiting similar quality attribute and functional
attribute and functional requirements and can promote large-scale re-use.
Each stakeholder of a software system – customer, user, project manager, coder, tester and so on - is
concerned with different system characteristics that are affected by the architecture. For ex. The user is
concerned that the system is reliable and available when needed; the customer is concerned that the
architecture can be implemented on schedule and to budget; the manager is worried that the
architecture will allow teams to work largely independently, interacting in disciplined and
controlled ways. Architecture provides a common language in which different concerns can be
expressed, negotiated, and resolved at a level that is intellectually manageable even for large, complex
systems.
x ARCHITECTURE MANIFESTS THE EARLIEST SET OF DESIGN DECISIONS
Software architecture represents a system’s earliest set of design decisions. These early decisions are the
most difficult to get correct and the hardest to change later in the development process, and they have the
most far-reaching effects.
i)The architecture defines constraints on implementation
This means that the implementation must be divided into the prescribed elements, the elements must
interact with each other in the prescribed fashion, and each element must fulfill its responsibility to the
others as dictated by the architecture.
An architecture embodies design decisions about how elements interact that, while reflected in each
element's implementation, can be localized and written just once. Templates can be used to capture in one
place the inter-element interaction mechanisms.
v)An architecture can be the basis for training
The architecture, including a description of how elements interact to carry out the required behavior, can
serve as the introduction to the system for new project members.
Q6) Define Architectural Patterns,reference models and reference architectures and bring out
relationship between them?(Jun 14,Jan 15,Jan 16)(6 Marks)
Soln:
An architectural pattern is a description of element and relation types together with a set of constraints
on how they may be used. For ex: client-server is a common architectural pattern. Client and server are
two element types, and their coordination is described in terms of the protocol that the server uses to
communicate with each of its clients.
A reference model is a division of functionality together with data flow between the pieces. A reference
model is a standard decomposition of a known problem into parts that cooperatively solve the problem.
A reference architecture is a reference model mapped onto software elements (that cooperatively
implement the functionality defined in the reference model) and the data flows between them. Whereas a
reference model divides the functionality, A reference architecture is the mapping of that functionality
onto a system decomposition.
Q8) Explain various process recommendations as used by architect while developing SA?
(Jun 14,Jan 15)(4 Marks)
Soln:
Process recommendations are as follows:
The architecture should be the product of a single architect or a small group of architects with an
identified leader. The architect (or architecture team) should have the functional requirements for the
system and an articulated, prioritized list of quality attributes that the architecture is expected to satisfy.
The architecture should be well documented, with at least one static view and one dynamic view, using
an agreed-on notation that all stakeholders can understand with a minimum of effort.The architecture
should be circulated to the system’s stakeholders, who should be actively involved in its review.The
architecture should be analyzed for applicable quantitative measures (such as maximum
throughput) and formally evaluated for quality attributes before it is too late to make changes to it.The
architecture should lend itself to incremental implementation via the creation of a “skeletal” system in
which the communication paths are exercised but which at first has minimal functionality. This
skeletal system can then be used to “grow” the system incrementally, easing the integration and testing
efforts.The architecture should result in a specific (and small) set of resource contention areas, the
resolution of which is clearly specified, circulated and maintained.
Q9) Briefly explain,what does Software architecture Constitute?(Jan 14,Jan 15) (5 Marks)
Soln:
UNIT 2
Q1) Discuss the Invariants,Advantages and Disadvantages of Pipes and Filters Architectural Style?
(Jun 15,Jan 16) (10 Marks)
Soln:
Conditions (invariants) of this style are:
Filters must be independent entities. They should not share state with other filter Filters do not know the
identity of their upstream and downstream filters. Specification might restrict what appears on input pipes
and the result that appears on the output pipes. Correctness of the output of a pipe-and-filter network
should not depend on the order in which filter perform their processing.
Q2) What are the Basic Requirements for Mobile Robotics Architecture? How implicit Invocation Model
Handles them?(Jan 14,Jan 15)(8 Marks)
Soln:
DESIGN CONSIDERATIONS:
REQ1: Supports deliberate and reactive behavior. Robot must coordinate the actions to accomplish its
mission and reactions to unexpected situations
REQ2: Allows uncertainty and unpredictability of environment. The situations are not fully defined
and/or predicable. The design should handle incomplete and unreliable information
REQ3: System must consider possible dangerous operations by Robot and environment
REQ4: The system must give the designer flexibility (mission’s change/requirement changes)
IMPLICIT INVOCATION
The third solution is based on the form of implicit invocation, as embodied in the Task-Control-
Architecture (TCA). The TCA design is based on hierarchies of tasks or task trees Parent tasks initiate
child task Temporal dependencies between pairs of tasks can be defined A must complete A must
complete before B starts (selective concurrency) Allows dynamic reconfiguration of task tree at run time
in response to sudden change(robot and environment) Uses implicit invocation to coordinate tasks and
Tasks communicate using multicasting message (message server) to tasks that are registered for these
events TCA’s implicit invocation mechanisms support three functions:
Exceptions: Certain conditions cause the execution of an associated exception handling routines i.e.,
exception override the currently executing task in the sub-tree (e.g., abort or retry) tasks Wiretapping:
Message can be intercepted by tasks superimposed on an existing task tree E.g., a safety-check
component utilizes this to validate outgoing motion commands Monitors: Monitors read information and
execute some action if the data satisfy certain condition.
E.g. battery check
Q3) Explain Process control Paradigms with various process control definitions?
(Jun 14,Jan 15)(6 marks)
Soln:
PROCESS CONTROL PARADIGMS
Q5) Enlist different Architetcural styles and discuss in brief Event-based, Implicit Invocation?
(Jun 14/Jan 15)(6 Marks)
Soln:
The Architectural Styles are:Dataflow systems,Call-and-return systems,Independent components,Virtual
machines,Data-centered systems:.
x EVENT-BASED, IMPLICIT INVOCATION
Instead of invoking the procedure directly a component can announce one or more events.
Other components in the system can register an interest in an event by associating a procedure to it.
When the event is announced, the system itself invokes all of the procedure that have been registered for
the event. Thus an event announcement “implicitly” causes the invocation of procedures in other
modules.Architecturally speaking, the components in an implicit invocation style are modules whose
interface provides both a collection of procedures and a set of events.
Advantages:
It provides strong support for reuse
Any component can be introduced into the system simply by registering it for the events of that system.
Implicit invocation eases system evolution.
Components may be replaced by other components without affecting the interfaces of other components.
Disadvantages:
Components relinquish control over the computation performed by the system.
Concerns change of data.
Global performance and resource management can become artificial issues.
Q6) Explain Software Paradigm for process Control?(Jan 14,Jan 15) (4 Marks)
Soln:
An architectural style for software that controls continuous processes can be based on the process-control
model, incorporating the essential parts of a process-control loop:
x Computational elements: separate the process of interest from the controlled policy Process
definition, including mechanisms for manipulating some process variables Control algorithm, for
deciding how to manipulate variables
x Data element: continuously updated process variables and sensors that collect them Process
variables, including designed input, controlled and manipulated variables and knowledge of
which can be sensed Set point, or reference value for controlled variable Sensors to obtain
values of process variables pertinent to control
x The control loop paradigm: establishes the relation that the control algorithm exercises.
Q7) State the problem of KWIC?Propose Abstract datatypes and Implicit Invocation styles to
Implement solution for same?(Jan 14,Jun 15,Jan 16) (10 Marks)
Soln:
Parnas proposed the following problems: KWIC index system accepts an ordered set of lines. Each line is
an ordered set of words and each word is an ordered set of characters. Any line may be circularly shifted
by repeated removing the first word and appending it at the end of the line. KWIC index system outputs a
listing of all circular shifts of all lines in alphabetical order.
Parnas used the problem to contrast different criteria for decomposing a system into modules. He
describes 2 solutions:
a) Based on functional decomposition with share access to data representation.
b) Based on decomposition that hides design decision.
SOLUTION 1: ABSTRACT DATA TYPES
Decomposes The System Into A Similar Set Of Five Modules.
Data is no longer directly shared by the computational components.
Each module provides an interface that permits other components to access data only by invoking
procedures in that interface.
Q8) Explain Block diagram for Cruise Control?(Jan 14,Jan 15) (4 Marks)
Soln:
A cruise control (CC) system that exists to maintain the constant vehicle speed even over varying terrain.
Inputs: System On/Off: If on, maintain speed Engine On/Off: If on, engine is on. CC is active only in this
state Wheel Pulses: One pulse from every wheel revolution Accelerator: Indication of how far accelerator
is de-pressed Brake: If on, temp revert cruise control to manual mode Inc/Dec Speed: If on,
increase/decrease maintained speed Resume Speed: If on, resume last maintained speed Clock: Timing
pulses every millisecond Outputs: Throttle: Digital value for engine throttle setting
UNIT-III
Q1) what is availability? Explain general scenario for availability? (Jun 14, Jun 15,Jan 16)
(10marks)
Soln:
AVAILABILITY SCENARIO
Availability is concerned with system failure and its associated consequences Failures are usually a result
of system errors that are derived from faults in the system. It is typically defines as .
Source of stimulus. We differentiate between internal and external indications of faults or failure since
the desired system response may be different. In our example, the unexpected message arrives from
outside the system.
Stimulus. A fault of one of the following classes occurs. - omission. A component fails to respond to an
input. - crash. The component repeatedly suffers omission faults. - timing. A component responds but the
response is early or late. - response. A component responds with an incorrect value.
Artifact. This specifies the resource that is required to be highly available, such as a processor,
communication channel, process, or storage.
Environment. The state of the system when the fault or failure occurs may also affect the desired system
response. For example, if the system has already seen some faults and is operating in other than normal
mode, it may be desirable to shut it down totally. However, if this is the first fault observed, some
degradation of response time or function may be preferred. In our example, the system is operating
normally.
Response. There are a number of possible reactions to a system failure. These include logging the failure,
notifying selected users or other systems, switching to a degraded mode with either less capacity or less
function, shutting down external systems, or becoming unavailable during repair. In our example, the
system should notify the operator of the unexpected message and continue to operate normally. Response
measure. The response measure can specify an availability percentage, or it can specify a time to repair,
times during which the system must be available, or the duration for which the system must be available
Q3) what do you mean by Tactics? Explain Availability Tactics with a Neat Diagram?
(Jun 14,Jun 15,Jan 16) (10 Marks)
Soln:
A tactic is a design decision that influences the control of a quality attribute response.
AVAILABILITY TACTICS
The above figure depicts goal of availability tactics. All approaches to maintaining availability involve
some type of redundancy, some type of health monitoring to detect a failure, and some type of recovery
when a failure is detected. In some cases, the monitoring or recovery is automatic and in others it is
manual.
FAULT DETECTION
1.Ping/echo. One component issues a ping and expects to receive back an echo, within a predefined time,
from the component under scrutiny. This can be used within a group of components mutually responsible
for one task
2.Heartbeat (dead man timer). In this case one component emits a heartbeat message periodically and
nother component listens for it. If the heartbeat fails, the originating component is assumed to have failed
and a fault correction component is notified. The heartbeat can also carry data.
3.Exceptions. The exception handler typically executes in the same process that introduced the exception.
FAULT RECOVERY
1.Voting. Processes running on redundant processors each take equivalent input and compute a simple
output value that is sent to a voter. If the voter detects deviant behavior from a single processor, it fails it.
2.Active redundancy (hot restart). All redundant components respond to events in parallel. The
response from only one component is used (usually the first to respond), and the rest are discarded. Active
redundancy is often used in a client/server configuration, such as database management systems, where
quick responses are necessary even when a fault occurs
3.Passive redundancy (warm restart/dual redundancy/triple redundancy). One component (the
primary) responds to events and informs the other components (the standbys) of state updates they must
make. When a fault occurs, the system must first ensure that the backup state is sufficiently fresh before
resuming services.
Spare. A standby spare computing platform is configured to replace many different failed components. It
must be rebooted to the appropriate software configuration and have its state initialized when a failure
occurs.
Shadow operation. A previously failed component may be run in "shadow mode" for a short time to
make sure that it mimics the behavior of the working components before restoring it to service.
State resynchronization. The passive and active redundancy tactics require the component being restored
to have its state upgraded before its return to service.
Checkpoint/rollback. A checkpoint is a recording of a consistent state created either periodically or in
response to specific events. Sometimes a system fails in an unusual manner, with a detectably inconsistent
state. In this case, the system should be restored using a previous checkpoint of a consistent state and a
log of the transactions that occurred since the snapshot was taken.
Q4) Explain the quality attribute general scenario? List the parts of such scenario? Distinguish
between Availability and Modifiability Scenario?(Jan 14,Jan 16) (10 Marks)
Soln:
QUALITY ATTRIBUTE SCENARIOS
A quality attribute scenario is a quality-attribute-specific requirement. It consists of six parts.
1) Source of stimulus. This is some entity (a human, a computer system, or any other
actuator) that generated the stimulus.
2) Stimulus. The stimulus is a condition that needs to be considered when it arrives at a system.
3) Environment. The stimulus occurs within certain conditions. The system may be in an
overload condition or may be running when the stimulus occurs, or some other condition may be true.
4) Artifact. Some artifact is stimulated. This may be the whole system or some pieces of it.
5) Response. The response is the activity undertaken after the arrival of the stimulus.
6) Response measure. When the response occurs, it should be measurable in some fashion so
that the requirement can be tested.
Figure 4.1 shows the parts of a quality attribute scenario.
Availability is concerned with system failure and its associated consequences Failures are usually a result
of system errors that are derived from faults in the system.
It is typically defines as
Source of stimulus. We differentiate between internal and external indications of faults or failure
since the desired system response may be different. In our example, the unexpected message arrives
from outside the system.
Stimulus. A fault of one of the following classes occurs.
- omission. A component fails to respond to an input.
- crash. The component repeatedly suffers omission faults.
- timing. A component responds but the response is early or late.
- response. A component responds with an incorrect value.
Artifact. This specifies the resource that is required to be highly available, such as a processor,
communication channel, process, or storage.
Environment. The state of the system when the fault or failure occurs may also affect the desired
system response. For example, if the system has already seen some faults and is operating in other than
normal mode, it may be desirable to shut it down totally. However, if this is the first fa ult observed,
some degradation of response time or function may be preferred. In our example, the system is operating
normally.
Response. There are a number of possible reactions to a system failure. These include logging the
failure, notifying selected users or other systems, switching to a degraded mode with either less
capacity or less function, shutting down external systems, or becoming unavailable during repair. In
our example, the system should notify the operator of the unexpected message and continue to operate
normally.
Response measure. The response measure can specify an availability percentage, or it can specify a
time to repair, times during which the system must be available, or the duration for which the system
must be available.
MODIFIABILITY SCENARIO
Modifiability is about the cost of change. It brings up two concerns.
♣ What can change (the artifact)?
♣ When is the change made and who makes it (the environment)?
Source of stimulus. This portion specifies who makes the changes—the developer, a system
administrator, or an end user. Clearly, there must be machinery in place to allow the system administrator
or end user to modify a system, but this is a common occurrence. In Figure 4.4, the modification is to be
made by the developer. Stimulus. This portion specifies the changes to be made. A change can be the
addition of a function, the modification of an existing function, or the deletion of a function. It can also be
made to the qualities of the system—making it more responsive, increasing its availability, and so forth.
The capacity of the system may also change. Increasing the number of simultaneous users is a frequent
requirement. In our example, the stimulus is a request to make a modification, which can be to the
function, quality, or capacity.
Artifact. This portion specifies what is to be changed—the functionality of a system, its platform, its user
interface, its environment, or another system with which it interoperates. In Figure 4.4, the modification is
to the user interface.
Environment. This portion specifies when the change can be made—design time, compile time, build
time, initiation time, or runtime. In our example, the modification is to occur at design time.
Response. Whoever makes the change must understand how to make it, and then make it, test it and
deploy it. In our example, the modification is made with no side effects.
Response measure. All of the possible responses take time and cost money, and so time and cost are the
most desirable measures. Time is not always possible to predict, however, and so less ideal measures are
frequently used, such as the extent of the change (number of modules affected). In our example, the time
to perform the modification should be less than three hours.
Q5) What are the qualities that architecture itself should posses?(Jan 14,Jun 15)(6 Marks)
Soln:
Achieving quality attributes must be considered throughout design, implementation, and deployment. No
quality attribute is entirely dependent on design, nor is it entirely dependent on implementation or
deployment. For example: Usability involves both architectural and non-architectural aspects
Modifiability is determined by how functionality is divided (architectural) and by coding techniques
Q6) List the Parts of Quality Attribute Scenario? (Jan 14,Jan 16)(4 Marks)
Soln:
A quality attribute scenario is a quality-attribute-specific requirement. It consists of six parts.
1) Source of stimulus. This is some entity (a human, a computer system, or any other actuator) that
generated the stimulus.
2) Stimulus. The stimulus is a condition that needs to be considered when it arrives at a system.
3) Environment. The stimulus occurs within certain conditions. The system may be in an overload
condition or may be running when the stimulus occurs, or some other condition may be true.
4) Artifact. Some artifact is stimulated. This may be the whole system or some pieces of it.
5) Response. The response is the activity undertaken after the arrival of the stimulus.
6) Response measure. When the response occurs, it should be measurable in some fashion so that the
requirement can be tested.
Q7) What is the goal of Tactics of Testability? Discuss 2 Categories of Tactics for Testing?
(Jan 14,Jan 15)(10 Marks)
Soln:
The goal of tactics for testability is to allow for easier testing when an increment of software development
is completed.
x INPUT/OUTPUT
Record/playback. Record/playback refers to both capturing information crossing an interface and using
it as input into the test harness. The information crossing an interface during normal operation is saved in
some repository. Recording this information allows test input for one of the components to be generated
and test output for later comparison to be saved.
Separate interface from implementation. Separating the interface from the implementation allows
substitution of implementations for various testing purposes. Stubbing implementations allows the
remainder of the system to be tested in the absence of the component being stubbed.
Specialize access routes/interfaces. Having specialized testing interfaces allows the capturing or
specification of variable values for a component through a test harness as well as independently from its
normal execution. Specialized access routes and interfaces should be kept separate from the access routes
and interfaces for required functionality.
x INTERNAL MONITORING
Built-in monitors. The component can maintain state, performance load, capacity, security, or other
information accessible through an interface. This interface can be a permanent interface of the component
or it can be introduced temporarily. A common technique is to record events when monitoring states have
been activated. Monitoring states can actually increase the testing effort since tests may have to be
repeated with the monitoring turned off. Increased visibility into the activities of the component usually
more than outweigh the cost of the additional testing.
Q8) Classify Secutity Tactics? What are different tactics for resisting attacks?
(Jan 15,Jan 16)(8 Marks)
Soln:
Tactics for achieving security can be divided into those concerned with resisting attacks, those concerned
with detecting attacks, and those concerned with recovering from attacks.
RESISTING ATTACKS
Authenticate users. Authentication is ensuring that a user or remote computer is actually who it purports
to be. Passwords, one-time passwords, digital certificates, and biometric identifications provide
authentication.
Authorize users. Authorization is ensuring that an authenticated user has the rights to access and modify
either data or services. Access control can be by user or by user class.
Maintain data confidentiality. Data should be protected from unauthorized access. Confidentiality is
usually achieved by applying some form of encryption to data and to communication links. Encryption
provides extra protection to persistently maintained data beyond that available from authorization.
Maintain integrity. Data should be delivered as intended. It can have redundant information encoded in it,
such as checksums or hash results, which can be encrypted either along with or independently from the
original data.
Limit exposure. Attacks typically depend on exploiting a single weakness to attack all data and services
on a host. The architect can design the allocation of services to hosts so that limited services are available
on each host.
Limit access. Firewalls restrict access based on message source or destination port. Messages from
unknown sources may be a form of an attack. It is not always possible to limit access to known sources.
Q9) Explain the following with respect to Tactics? (Jun 14,Jan 15)(10 Marks)
i) Fault Prevention ii) Defer Binding Time iii) Resource Arbitration iv)Internal Monitoring v) Run
Time Tactics
Soln:
x FAULT PREVENTION
Removal from service. This tactic removes a component of the system from operation to undergo some
activities to prevent anticipated failures.
Transactions. A transaction is the bundling of several sequential steps such that the entire bundle can be
undone at once. Transactions are used to prevent any data from being affected if one step in a process
fails and also to prevent collisions among several simultaneous threads accessing the same data.
Process monitor. Once a fault in a process has been detected, a monitoring process can delete the
nonperforming process and create a new instance of it, initialized to some appropriate state as in the spare
tactic.
x DEFER BINDING TIME
Many tactics are intended to have impact at loadtime or runtime, such as the following.
Runtime registration supports plug-and-play operation at the cost of additional overhead to manage the
registration.
Configuration files are intended to set parameters at startup.
Polymorphism allows late binding of method calls.
Component replacement allows load time binding.
Adherence to defined protocols allows runtime binding of independent processes.
x RESOURCE ARBITRATION
First-in/First-out. FIFO queues treat all requests for resources as equals and satisfy them in turn.
Fixed-priority scheduling. Fixed-priority scheduling assigns each source of resource requests a
particular priority and assigns the resources in that priority order. Three common prioritization strategies
are semantic importance. Each stream is assigned a priority statically according to some domain
characteristic of the task that generates it,deadline monotonic. Deadline monotonic is a static priority
assignment that assigns higher priority to streams with shorter deadlines,.rate monotonic. Rate monotonic
is a static priority assignment for periodic streams that assigns higher priority to streams with shorter
periods.
Dynamic priority scheduling:
1.round robin. Round robin is a scheduling strategy that orders the requests and then, at every assignment
possibility, assigns the resource to the next request in that order.
2.earliest deadline first. Earliest deadline first assigns priorities based on the pending requests with the
earliest deadline.
Static scheduling. A cyclic executive schedule is a scheduling strategy where the pre-emption points and
the sequence of assignment to the resource are determined offline.
x INTERNAL MONITORING
Built-in monitors. The component can maintain state, performance load, capacity, security, or other
information accessible through an interface. This interface can be a permanent interface of the component
or it can be introduced temporarily. A common technique is to record events when monitoring states have
been activated. Monitoring states can actually increase the testing effort since tests may have to be
repeated with the monitoring turned off. Increased visibility into the activities of the component usually
more than outweigh the cost of the additional testing.
x RUNTIME TACTICS
Maintain a model of the task. In this case, the model maintained is that of the task. The task model is
used to determine context so the system can have some idea of what the user is attempting and provide
various kinds of assistance. For example, knowing that sentences usually start with capital letters would
allow an application to correct a lower-case letter in that position.
Maintain a model of the user. In this case, the model maintained is of the user. It determines the user's
knowledge of the system, the user's behavior in terms of expected response time, and other aspects
specific to a user or a class of users. For example, maintaining a user model allows the system to pace
scrolling so that pages do not fly past faster than they can be read.
Maintain a model of the system. In this case, the model maintained is that of the system. It determines
the expected system behavior so that appropriate feedback can be given to the user. The system model
predicts items such as the time needed to complete current activity.
Unit-IV
Q1) What do you mean by architectural pattern ? how it is categorized ?Explain the
structure part of the solution for ISO layered architecture.(Jun 14,Jun 15)
Soln:
Architectural patterns express fundamental structural organization schemas for software systems.
They provide a set of predefined subsystems, specify their responsibilities, and include
rules and guidelines for organizing the relationships between them
The layers architectural pattern helps to structure applications that can be decomposed
into groups of subtasks in which each group of subtasks is at a particular level of abstraction.
Example: Networking protocols are best example of layered architectures. Such a protocol
consists of a set of rules and conventions that describes how computer programmer
communicates across machine boundaries. The format, contacts and meaning of all messages
are defined. The protocol specifies agreements at a variety of abstraction levels, ranging from the
details of bit transmission to high level abstraction logic. Therefore the designers use secured sub
protocols and arrange them in layers. Each layer deals with a specific aspect of communication
and users the services of the next lower layer. (see diagram & explain more)
Context: a large system that requires decomposition.
Problem: The system we are building is divided by mix of low and high level issues,
where high-level operations rely on the lower-level ones. for ex, high-level will be interactive to user
and low-level will be concerned with hardware implementation
x Parts of the system should be exchangeable (i.e, a particular layer can be changed).
x It may be necessary to build other systems at a later date with the same low-level issues
as the system you are currently designing.
x Structure your system into an appropriate number of layers and place them on top of each
other.
x Lowest layer is called 1 (base of our system), the highest is called layer N. i.e, Layer 1,
……. Layer J-1,
x Layer J, ….. Layer N.
x Most of the services that layer J Provides are composed of services provided by
layer J-1. In other words, the services of each layer implement a strategy for combining
the services of the layer below in a meaningful way. In addition, layer J’s services may
depend on other services in layer J.
Structure:
x An individual layer can be described by the following CRC card:
o
The main structural characteristics of the layers patterns is that services of layer J are only use by
layer J+1-there are no further direct dependencies between layers. This structure can be
compared with a stack, or even an onion. Each individual layer shields all lower from direct
access by higher layers.
Dynamics:
x Scenario I is probably the best-known one. A client Issues a request to Layer N. Since
Layer N cannot carry out the request on its own. It calls the next Layer N - 1 for
supporting subtasks. Layer N - I provides these. In the process sending further requests
to Layer N-2 and so on until Layer I is reached. Here, the lowest-level services are finally
performed. If necessary, replies to the different requests are passed back up from Layer 1
to Layer 2, from Layer 2 to Layer 3, and so on until the final reply arrives at Layer N.
x Scenario III describes the situation where requests only travel through a subset of the
layers. A top level request may only go to the next lower level N- 1 if this level can satisfy
the request. An example of this is where level N- 1 acts as a cache and a request from level
N can be satisfied without being sent all the way down to Layer 1 and from here to a
remote server.
x Scenario IV An event is detected in Layer 1, but stops at Layer 3 instead of travelling all
the way up to Layer N. In a communication protocol, for example, a resend request
may arrive from an impatient client who requested data some time ago. In the meantime
the server has already sent the answer, and the answer and the re-send request cross. In this
case, Layer 3 of the server side may notice this and intercept the re-send request without
further action.
x Scenario V involves two stacks of N layers communicating with each other. This scenario
is well-known from communication protocols where the stacks are known as
'protocol stacks'. In the following diagram, Layer N of the left stack issues a request.
'The request moves down through the layers until it reaches Layer 1, is sent to Layer 1 of
the right stack, and there moves up through the layers of the right stack. The response to
the request follows the reverse path until it arrives at Layer N of the left stack.
Implementation:
The following steps describe a step-wise refinement approach to the definition of a layered
architecture. Define the abstraction criterion for grouping tasks into layers.
o This criterion is often the conceptual distance from the platform (sometimes, we encounter
other abstraction paradigm as well).
o In the real world of software development we often use a mix of abstraction criterions. For ex,
the distance from the hardware can shape the lower levels, and conceptual complexity
governs the higher ones.
o Example layering obtained using mixed model layering principle is shown below User-
visible elements
x Specific application modules
x Common services level
x Operating system interface level
x Operating system
x Hardware
Determine the number of abstraction levels according to your abstraction criterion.
x Each abstraction level corresponds to one layer of the pattern.
x Having too many layers may impose unnecessary overhead, while too few layers
can result in a poor structure.
Name the layers and assign the tasks to each of them.
x The task of the highest layer is the overall system task, as perceived by the client.
x The tasks of all other layers are to be helpers to higher layers.
Specify the services
x It is often better to locate more services in higher layers than in lower layers.
x The base layers should be kept ‘slim’ while higher layers can expand to cover a
spectrum of applicability.
x This phenomenon is also called the ‘inverted pyramid of reuse’.
Refine the layering
x Iterate over steps 1 to 4.
x It is not possible to define an abstraction criterion precisely before thinking about
the implied layers and their services.
x Alternatively it is wrong to define components and services first and later impose
a layered structure.
x The solution is to perform the first four steps several times until a natural and
stable layering evolves.
Specify an interface for each layer.
x If layer J should be a ‘black box’ for layer J+1, design a flat interface that offers all layer
J’s services.
x ‘White box’ approach is that in which, layer J+1 sees the internals of layer J.
x ‘Gray box’ approach is a compromise between black and white box approaches.
Here layer J+1 is aware of the fact that layer J consists of three components, and
address them separately, but does not see the internal workings of individual components.
Structure individual layers
x When an individual layer is complex, it should be broken into separate components.
x This subdivision can be helped by using finer-grained patterns.
Specify the communication between adjacent layers.
x Push model (most often used): when layer J invokes a service of layer J+1, any required
information is passed as part of the service call.
x Pull model: it is the reverse of the push model. It occurs when the lower layer
fetches available information from the higher layer at its own discretion.
Decouple adjacent layers.
x For top-down communication, where requests travel top-down, we can use one-way
coupling (i.e, upper layer is aware of the next lower layer, but the lower layer is unaware
of the identity of its users) here return values are sufficient to transport the results in the
reverse direction.
x For bottom-up communication, you can use callbacks and still preserve a top-
down one way coupling. Here the upper layer registers callback functions with the lower
layer.
x We can also decouple the upper layer from the lower layer to a certain degree using
object oriented techniques.
Design an error handling strategy
x An error can either be handled in the layer where it occurred or be passed to the next
higher layer.
x As a rule of thumb, try to handle the errors at the lowest layer possible.
Q2) List the Components of Pipes and Filters Architectural Pattern?With Sketch explain CRC
Card for the same?(Jan 14,Jun 14)(8 Marks)
Soln:
The componenets of Pipes and Filters are:
1.Filter Component
2.Pipe Component
3.Data Source
4.Data Sink
1.Filter component:
Filter components are the processing units of the pipeline. A filter enriches, refines or transforms its input
data. It enriches data by computing and adding information, refines data by concentrating or extracting
information, and transforms data by delivering the data in some other representation. It is responsible for
the following activities:
The subsequent pipeline element pulls output data from the filter. (passive filter)
2. Pipe component:
x Pipes denote the connection between filters, between the data source and the first filter, and between
the last filter and the data sink.
x If two active components are joined, the pipe synchronizes them.
x This synchronization is done with a first-in- first-out buffer.
Q3) Explain the forces that influence the solution to problems based on black board pattern?
(Jan 14,Jun 15,Jan 16)(7 Marks)
Soln:
The following forces influence solutions to problems of this kind:
A complete search of the solution space is not feasible in a reasonable time.Since the domain is immature,
we may need to experiment with different algorithms for the same subtask. Hence, individual modules
should be easily exchangeable.
Q4) Discuss the steps involved in implementation of pipes of filters architecture?(Jan 15)(12 Marks)
Soln:
Implementation:
x Divide the system’s tasks into a sequence of processing stages.
Each stage must depend only on the output of its direct predecessor.
All stages are conceptually connected by the data flow.
x Define the data format to be passed along each pipe.
Defining a uniform format results in the highest flexibility because it makes recombination of its filters
easy.
You must also define how the end of input is marked.
x Decide how to implement each pipe connection.
This decision directly determines whether you implement the filters as active or passive components.
Adjacent pipes further define whether a passive filter is triggered by push or pull of data.
x Design and implement the filters.
Design of a filter component is based both on the task it must perform and on the adjacent pipes.
You can implement passive filters as a function, for pull activation, or as a procedure for push activation.
Active filters can be implemented either as processes or as threads in the pipeline program.
x Design the error handling.
Because the pipeline components do not share any global state, error handling is hard to address and is
often neglected. As a minimum, error detection should be possible. UNIX defines specific output
channel for error messages, standard error. If a filter detects error in its input data, it can ignore input
until some clearly marked separation occurs. It is hard to give a general strategy for error handling
with a system based on the pipes and filter pattern.
x Set up the processing pipeline.
If your system handles a single task you can use a standardized main program that sets up the pipeline and
starts processing. You can increase the flexibility by providing a shell or other end-user facility to set
up various pipelines from your set of filter components.
Q5) Explain layers architectures Pattern,with sketches and CRC cards? (Jan 15,Jun 15)(6 Marks)
Soln:
Structure your system into an appropriate number of layers and place them on top of each other. Lowest
layer is called 1 (base of our system), the highest is called layer N. i.e, Layer 1, ……. Layer J-1, Layer J,
….. Layer N. Most of the services that layer J Provides are composed of services provided by layer J-1. In
other words, the services of each layer implement a strategy for combining the services of the layer below
in a meaningful way. In addition, layer J’s services may depend on other services in layer J.
Structure:
An individual layer can be described by the following CRC card:
The main structural characteristics of the layers patterns is that services of layer J are only use by layer
J+1-there are no further direct dependencies between layers. This structure can be compared with a stack,
or even an onion. Each individual layer shields all lower from direct access by higher layers.
Pull model: it is the reverse of the push model. It occurs when the lower layer fetches available
information from the higher layer at its own discretion.
x Decouple adjacent layers.
For top-down communication, where requests travel top-down, we can use one-way coupling (i.e, upper
layer is aware of the next lower layer, but the lower layer is unaware of the identity of its users) here
return values are sufficient to transport the results in the reverse direction.
Q7) Explain Benefits and Liabilities of Pipes and filter pattern?(Jan14)(6 Marks)
Soln:
The Pipes and Filters architectural pattern has the following benefits
x No intermediate files necessary, but possible.
Computing results using separate programs is possible without pipes, by storing intermediate results in
pipes.
x Flexibility by the filter change
Filters have simple interface that allows their easy exchange within a processing pipeline.
x Flexibility by recombination
This benefit combined with reusability of filter component allows you to create new processing pipelines
by rearranging filters or by adding new ones.
x Reuse of filter components.
Support for recombination leads to easy reuse of filter components.
x Rapid prototyping of pipelines.
Easy to prototype a data processing system from existing filters.
x Efficiency by parallel processing.
It is possible to start active filter components in parallel in a multiprocessor system or a network.
The Pipes and Filters architectural pattern has the following Liabilities
x Sharing state information is expensive or inflexible
This pattern is inefficient if your processing stage needs to share a large amount of global data.
x Efficiency gain by parallel processing is often an illusion, because:
The cost for transferring data between filters is relatively high compared to the cost of the computation
carried out by a single filter.Some filter consumes all their input before producing any output. Context-
switching between threads or processes is expensive on a single processor machine. Synchronization
of filters via pipes may start and stop filters often.
x Data transformation overhead
Using a single data type for all filter input and output to achieve highest flexibility results in data
conversion overheads.
x Error handling
Is difficult. A concrete error-recovery or error-handling strategy depends on the task you need to solve.
Q8) What are the known uses of Black Board Pattern?(Jan 14,Jan 16)(4 marks)
Soln:
Known uses:
HEARSAY-II The first Blackboard system was the HEARSAY-II speech recognition system from the
early 1970's. It was developed as a natural language interface to a literature database. Its task was to
answer queries about documents and to retrieve documents from a collection of abstracts of Artificial
Intelligence publications. The inputs to the system were acoustic signals that were semantically
interpreted and then transformed to a database query. The control component of HEARSAY-I1 consists
of the following:
The focus of control database, which contains a table of primitive change types of blackboard changes,
and those condition-parts that can be executed for each change type.
x The scheduling queue, which contains pointers to condition- or action-parts of knowledge source.
x The monitor, which keeps track of each change made to the blackboard.
x The scheduler, which uses experimentally-derived heuristics to calculate priorities for the condition-
and action- parts waiting in the scheduling queue.
HASP/SIAP
CRYSALIS
TRICERO
SUS
Q9) Illustrate the behavior of the black board architecture based on Speech recognition and list the
steps to implement black board pattern?(Jun 14,Jun 15)(10 marks)
Soln:
Implementation:
x Define the problem
Specify the domain of the problem
Scrutinize the input to the system
Define the o/p of the system
Detail how the user interacts with the system.
x Define the solution space for the problem
Specify exactly what constitutes a top level solution
List the different abstraction levels of solutions
Organize solutions into one or more abstraction hierarchy.
Find subdivisions of complete solutions that can be worked on independently.
x Divide the solution process into steps.
Define how solutions are transformed into higher level solutions.
Describe how to predict hypothesis at the same abstraction levels.
Detail how to verify predicted hypothesis by finding support for them in other levels.
Specify the kind of knowledge that can be uses to exclude parts of the solution space.
x Divide the knowledge into specialized knowledge
These subtasks often correspond to areas of specialization.
x Define the vocabulary of the blackboard
Elaborate your first definition of the solution space and the abstraction levels of your solution.
Find a representation for solutions that allows all knowledge sources to read from and contribute to the
blackboard.
The vocabulary of the blackboard cannot be defined of knowledge sources and the control component.
x Specify the control of the system.
Control component implements an opportunistic problem-solving strategy that determines which
knowledge sources are allowed to make changes to the blackboard.The aim of this strategy is to construct
a hypothesis that is acceptable as a result. The following mechanisms optimizes the evaluation of
knowledge sources, and so increase the effectiveness and performance of control strategy. Classifying
changes to the blackboard into two types. One type specify all blackboard change that may imply new set
of applicable knowledge sources, and the other specifies all blackboard changes that do not. Associating
categories of blackboard changes with sets of possibly applicable knowledge sources. Focusing of
control. The focus contains either partial results on the blackboard or knowledge sources that should be
preferred over others. Creating on queue in which knowledge sources classified as applicable wait for
their execution.
x Implement the knowledge sources
Split the knowledge sources into condition parts and action-parts according to the needs of the control
component. We can implement different knowledge sources in the same system using different
technologies
Unit-V
Q1) What do you mean by broker architecture?What are the steps involved in implementing
distributed broker architecture patterns?(Jun 14,Jun 15) (10 Marks)
Soln:
The broker architectural pattern can be used to structure distributed software systems with decoupled
components that interact by remote service invocations. A broker component is responsible for
coordinating communication, such as requests, as well as for transmitting results and exceptions.
Implementation:
1) Define an object existing model, or use an existing model.
Each object model must specify entities such as object names, requests, objects, values, exceptions,
supported types, interfaces and operations.
2) Decide which kind of component-interoperability the system should offer.
You can design for interoperability either by specifying a binary standard or by introducing a high-level
IDL.
IDL file contains a textual description of the interfaces a server offers to its clients.
The binary approach needs support from your programming language.
3) Specify the API’S the broker component provides for collaborating with clients and servers.
Decide whether clients should only be able to invoke server operations statically, allowing clients to bind
the invocations at complete time, or you want to allow dynamic invocations of servers as well.
This has a direct impact on size and no. of API’S.
4) Use proxy objects to hide implementation details from clients and servers.
Client side proxies package procedure calls into message and forward these messages to the local broker
component.
Server side proxies receive requests from the local broker and call the methods in the interface
implementation of the corresponding server.
5) Design the broker component in parallel with steps 3 and 4
During design and implementations, iterate systematically through the following steps
5.1 Specify a detailed on-the-wire protocol for interacting with client side and server side proxies.
5.2 A local broker must be available for every participating machine in the network.
5.3 When a client invokes a method of a server the broker system is responsible for returning all results
and exceptions back to the original client.
5.4 If the provides do not provide mechanisms for marshalling and un marshalling parameters results, you
must include functionality in the broker component.
5.5 If your system supports asynchronous communication b/w clients and servers, you need to provide
message buffers within the broker or within the proxies for temporary storage of messages.
5.6 Include a directory service for associating local server identifiers with the physical location of the
corresponding servers in the broker.
5.7 When your architecture requires system-unique identifiers to be generated dynamically during server
registration, the broker must offer a name service for instantiating such names.
5.8 If your system supports dynamic method invocation the broker needs some means for maintaining
type information about existing servers.
5.9 Plan the broker’s action when the communication with clients, other brokers, or servers fails.
6) Develop IDL compliers
An IDL compiler translates the server interface definitions to programming language code. When many
programming languages are in use, it is best to develop the compiler as afrarnework that allows the
developer to add his own code generators.
Q2)Explain with neat diagram, dynamic scenario of MVC?(Jun 15,Jan 16) (10 Marks)
Soln:
Dynamics: The following scenarios depict the dynamic behavior of MVC. For simplicity only one view-
controller pair is shown in the diagrams.
Scenario I shows how user input that results in changes to the model triggers the change-propagation
mechanism:
The controller accepts user input in its event-handling procedure, interprets the event, and activates a
service procedure of the model.
The model performs the requested service. This results in a change to its internal data.
The model notifies all views and controllers registered with the change-propagation mechanism of the
change by calling their update procedures.
Each view requests the changed data from the model and redisplays itself on the screen.
Each registered controller retrieves data from the model to enable or disable certain user functions..
The original controller regains control and returns from its event handling procedure.
Scenario II shows how the MVC triad is initialized. The following steps occur:
The model instance is created, which then initializes its internal data structures.
A view object is created. This takes a reference to the model as a parameter for its initialization.
The view subscribes to the change-propagation mechanism of the model by calling the attach procedure.
The view continues initialization by creating its controller. It passes references both to the model and to
itself to the controller's initialization procedure.
The controller also subscribes to the change-propagation mechanism by calling the attach procedure.
After initialization, the application begins to process events.
Consider a simple information system for political elections with proportional representation. This offers
a spreadsheet for entering data and several kinds of tables and charts for presenting the current results.
Users can interact with the system via a graphical interface. All information displays must reflect changes
to the voting data immediately.
Context: Interactive applications with a flexible human-computer interface
Problem: Different users place conflicting requirements on the user interface. A typist enters information
into forms via the keyboard. A manager wants to use the same system mainly by clicking icons and
buttons. Consequently, support for several user interface paradigms should be easily incorporated. How
do you modularize the user interface functionality of a web application so that you can easily modify the
individual parts? The following forces influence the solution:
Same information is presented differently in different windows. For ex: In a bar or pie chart. The display
and behavior of the application must reflect data manipulations immediately. Changes to the user
interface should be easy, and even possible at run-time. Supporting different ‘look and feel’ standards or
porting the user interface should not affect code in the core of the application.
MVC divides an interactive application into the three areas: processing, output and input.
Model component encapsulates core data and functionality and is independent of o/p and i/p.
View components display user information to user a view obtains the data from the model. There can be
multiple views of the model.
Each view has an associated controller component controllers receive input (usually as mouse events)
events are translated to service requests for the model or the view. The user interacts with the system
solely through controllers.
The separation of the model from view and controller components allows multiple views of the same
model.
Structure:
x Model component:
Contains the functional core of the application.
Registers dependent views and controllers
Notifies dependent components about data changes (change propagation mechanism)
x View component:
Presents information to the user
Retrieves data from the model
Creates and initializes its associated controller
Implements the update procedure
x Controller component:
Accepts user input as events (mouse event, keyboard event etc)
Translates events to service requests for the model or display requests for the view.
An object-oriented implementation of MVC would define a separate class for each component. In a C++
implementation, view and controller classes share a common parent that defines the update interface. This
is shown in the following diagram.
Dynamics: The following scenarios depict the dynamic behavior of MVC. For simplicity only one view-
controller pair is shown in the diagrams.
Scenario I shows how user input that results in changes to the model triggers the change-propagation
mechanism:
The controller accepts user input in its event-handling procedure, interprets the event, and activates a
service procedure of the model.
The model performs the requested service. This results in a change to its internal data.
The model notifies all views and controllers registered with the change-propagation mechanism of the
change by calling their update procedures.
Each view requests the changed data from the model and redisplays itself on the screen.
Each registered controller retrieves data from the model to enable or disable certain user functions..
The original controller regains control and returns from its event handling procedure.
Scenario II shows how the MVC triad is initialized. The following steps occur:
The model instance is created, which then initializes its internal data structures,A view object is created.
This takes a reference to the model as a parameter for its initialization,The view subscribes to the
change-propagation mechanism of the model by calling the attach procedure,The view continues
initialization by creating its controller. It passes references both to the model and to itself to the
controller's initialization procedure.
The controller also subscribes to the change-propagation mechanism by calling the attach procedure.
After initialization, the application begins to process events.
Implementation:
1) Separate human-computer interaction from core functionality
Analysis the application domain and separate core functionality from the desired input and output
behavior
2) Implement the change-propagation mechanism
Follow the publisher subscriber design pattern for this, and assign the role of the publisher to the model.
3) Design and implement the views
design the appearance of each view and Implement all the procedures associated with views.
4) Design and implement the controllers
For each view of application, specify the behavior of the system in response to user actions.
We assume that the underlying pattern delivers every action of and user as an event. A controller receives
and interprets these events using a dedicated procedure.
5) Design and implement the view controller relationship.
A view typically creates its associated controller during its initialization.
6) Implement the setup of MVC.
The setup code first initializes the model, then creates and initializes the views.
After initialization, event processing is started.
Because the model should remain independent of specific views and controllers, this set up code should
be placed externally.
7) Dynamic view creation
If the application allows dynamic opening and closing of views, it is a good idea to provide a component
for managing open views.
8) ‘pluggable’ controllers
The separation of control aspects from views supports the combination of different controllers with a
view.
This flexibility can be used to implement different modes of operation.
9) Infrastructure for hierarchical views and controllers
Apply the composite pattern to create hierarchically composed views.
If multiple views are active simultaneously, several controllers may be interested in events at the same
time.
Q4) Discuss the most common scenario illustrating dynamic behavior of Broker system?
(Jun 15,Jan 16)(10 Marks)
Soln:
Scenario 1. illustrates the behaviour when a server registers itself with the local broker component:
Scenario II illustrates the behaviour when a client sends a request to a local server. In this scenario we
describe a synchronous invocation, in which the client blocks until it gets a response from the server. The
broker may also support asynchronous invocations, allowing clients to execute further tasks without
having to wait for a response.
The smaller the atomic semantic concepts of an applications are, and the greater the similarly of their user
interfaces, the less applicable this pattern is.
Provide the robot with a description of the environment it will work in, places in this environment, and
routes between places.
Subsequently modify the environment.
Specify missions for the robot.
Control the execution of missions.
Observe the progress of missions.
UNIT-VI
Q1) State and explain the properties of reflection pattern .(Jan 14,Jun 15,Jan 16)(10marks)
Soln:
The reflection architectural pattern provides a mechanism for changing structure and behavior of software
systems dynamically. It supports the modification of fundamental aspects, such as the type structures and
function call mechanisms. In this pattern, an application is split into two parts:
A Meta level provides information about selected system properties and makes the s/w self aware.
A base level includes application logic changes to information kept in the Meta level affect subsequent
base-level behavior.
Context: Building systems that support their own modification a prior
Problem:Designing a system that meets a wide range of different requirements a prior can be an
overwhelming task.
A better solution is to specify an architecture that is open to modification and extension i.e., we have to
design for change and evolution.
Several forces are associated with the problem: Changing software is tedious, error prone and often
expensive. Adaptable software systems usually have a complex inner structure. Aspects that are subject to
change are encapsulated within separate components.The more techniques that are necessary for keep in a
system changeable the more awkward and complex its modifications becomes Changes can be of any
scale, from providing shortcuts for commonly used commands to adapting an application framework for a
specific customer. Even fundamental aspects of software systems can change for ex. communication
mechanisms b/w components. Make the software self-aware, and make select aspects of its structure
and behavior accessible for adaptation and change.
Structure:
1.Meta level
2.Meta objects protocol(MOP)
3.Base level
1.Meta level
Meta level consists of a set of Meta objects. Each Meta object encapsulates selected information about a
single aspect of a structure, behavior, or state of the base level.
There are three sources for such information.
It can be provided by run time environment of the system, such as C++ type identification objects.
The general structure of a reflective architecture is very much like a Layered system
3. Identify structural aspects of the system, which when changed, should not affect the implementation
of the base level.
4. Identify system services that support both the variation of application services identified
In step 2 and the independence of structural details identified in step 3 Eg: for system services are
Resource allocation
Garbage allocation
Page swapping
Object creation.
5. Define the meta objects
For every aspect identified in 3 previous steps, define appropriate Meta objects.
Encapsulating behavior is supported by several domain independent design patterns, such as objectifier
strategy, bridge, visitor and abstract factory.
6. Define the MOP
There are two options for implementing the MOP.
Integrate it with Meta objects. Every Meta object provides those functions of the MOP that operate on it.
Implement the MOP as a separate component.
Robustness is a major concern when implementing the MOP. Errors in change specifications should be
detected wherever possible.
7. Define the base level
Implement the functional core and user interface of the system according to the analysis model developed
in step 1.
Use Meta objects to keep the base level extensible and adaptable. Connect every base level component
with Meta objects that provide system information on which they depend, such as type information etc.
Provide base level components with functions for maintaining the relationships with their associated Meta
objects. The MOP must be able to modify every relationship b/w base level and Meta level.
Q2) What are the steps involved in implementing micro kernel system?
(Jan 14,Jun 15,Jan 16)(12 Marks)
Soln:
Implementation:
1. Analyze the application domain:
Perform a domain analysis and identify the core functionality necessary for implementing ext servers.
2. Analyze external servers
That is polices ext servers are going to provide
3. Categorize the services
Group all functionality into semantically independent categories.
4. Partition the categories
Separate the categories into services that should be part of the microkernel, and those that should be
available as internal servers.
5. Find a consistent and complete set of operations and abstractions
for every category you identified in step 1.
6. Determine the strategies for request transmission and retrieval.
Specify the facilities the microkernel should provide for communication b/w components.
Communication strategies you integrate depend on the requirements of the application domain.
7. Structure the microkernel component
Design the microkernel using the layers pattern to separate system-specific parts from system-
independent parts of the kernel.
8. Specify the programming interfaces of microkernel
To do so, you need to decide how these interfaces should be accessible externally. You must take into an
account whether the microkernel is implemented as a separate process or as a module that is physically
shared by other component in the latter case, you can use conventional method calls to invoke the
methods of the microkernel. 9. The microkernel is responsible for managing all system resources such
as memory blocks, devices or device contexts - a handle to an output area in a GUI implementation. 10.
9.Design and implement the internal servers as separate processes or shared libraries
Perform this in parallel with steps 7-9, because some of the microkernel services need to access internal
servers. It is helpful to distinguish b/w active and passive servers Active servers are implemented as
processes Passive servers as shared libraries. Passive servers are always invoked by directly calling their
interface methods, where as active server process waits in an event loop for incoming requests.
11 Implement the external servers
Each external server is implemented as a separate process that provide its own service interface
The internal architecture of an external server depends on the policies it comprises
Specify how external servers dispatch requests to their internal procedures.
12. Implement the adapters
Primary task of an adapter is to provide operations to its clients that are forwarded to an external server.
You can design the adapter either as a conventional library that is statically linked to client during
complication or as a shared library dynamically linked to the client on demand.
13. Develop client applications
or use existing ones for the ready-to-run microkernel system.
Q3) Explain the known uses of reflection pattern(Jun 15,Jan 16)(10 Marks)
Soln:
Known uses:
CLOS.
This is the classic example of a reflective programming language [Kee89]. In CLOS, operations defined
for objects are called generic functions, and their processing is referred to as generic function invocation.
Generic function invocation is divided into three phases:
The system first determines the methods that are applicable to a given invocation.
It then sorts the applicable methods in decreasing order of precedence.
The system finally sequences the execution of the list of applicable methods.
MIP
It is a run-time type information system for C++. The functionality of MIP is separated into four layers:
The first layer includes information and functionality that allows software to identify and compare types.
The second layer provides more detailed information about the type system of an application.
The third layer provides information about relative addresses of data members, and offers functions for
creating 'empty' objects of user-defined types.
The fourth layer provides full type information, such as that about friends of a class, protection of data
members, or argument and return types of function members.
PGen
It allows an application to store and read arbitrary C++ object structures.
NEDIS
NEDIS includes a meta level called run-time data dictionary. It provides the following services and
system information:
Properties for certain attributes of classes, such as their allowed value ranges.
Functions for checking attribute values against their required properties.
Default values for attributes of classes, used to initialize new objects.
Functions specifying the behavior of the system in the event of errors
Country-specific functionality, for example for tax calculation.
Information about the 'look and feel' of the software, such as the layout of input masks or the language to
be used in the user interface.
OLE 2.0
It provides functionality for exposing and accessing type information about OLE objects and their
interfaces.
Q4) Explain the components of microkernel pattern (Jun 15/Jan 16)(10 Marks)
Soln:
Microkernel pattern defines 5 kinds of participating components.
Internal servers
External servers
Adapters
Clients
Microkernel
Microkernel
The microkernel represents the main component of the pattern.
It implements central services such as communication facilities or resource handling.
The microkernel is also responsible for maintaining system resources such as processes or files.
It controls and coordinates the access to these resources.
A microkernel implements atomic services, which we refer to as mechanisms.
These mechanisms serve as a fundamental base on which more complex functionality called policies are
constructed.
Different external servers implement different policies for specific application domains.
Client:
o It is an application that is associated with exactly one external server. It only accesses the programming
interfaces provided by the external server.
o Problem arises if a client accesses the interfaces of its external server directly ( direct dependency)
Such a system does not support changeability
If ext servers emulate existing application platforms clients will not run without modifications.
Adapter (emulator)
Represents the interfaces b/w clients and their external servers and allow clients to access the services of
their external server in a portable way.
They are part of the clients address space.
The following OMT diagram shows the static structure of a microkernel system.
Soln:
The reflection architecture provides the following Benefits:
Unit VII
Q1) What are the application areas of master slave pattern? (Jan 14,Jun 15,Jan 16) ( 10 Marks)
Soln:
There are 3 application areas for master slave pattern.
Master-slave for fault tolerance
In this variant the master just delegates the execution of a service to a fixed number of replicated
implementations, each represented by a slave.
Master-slave for parallel computation
In this variant the master divides a complex task into a number of identical sub-tasks, each of which is
executed in parallel by a separate slave.
Master-slave for computational concurrency.
In this variant the execution of a service is delegated to at least three different implementations, each of
which is a separate slave.
Other variants
Slaves as processes
To handle slaves located in separate processes, you can extend the original Master-Slave structure with
two additional components
Slaves as threads
In this variant the master creates the threads, launches the slaves, and waits for all threads to complete
before continuing with its own computation.
Master-slave with slave co ordination
In this case the computation of all slaves must be regularly suspended for each slave to coordinate itself
with the slaves on which it depends, after which the slaves resume their individual computation.
Static relationship between whole and its part are illustrated in the OMT diagram below
Q4) Discuss the 5 steps implementation of master slave pattern?(Jun 15,Jan 16)(10 Marks)
Soln:
Implementation:
1. Divide work:
Specify how the computation of the task can be split into a set equal sub tasks. Identify the sub services
that are necessary to process a subtask.
2. Combine sub-task results
Specify how the final result of the whole service can be computed with the help of the results obtained
from processing individual sub-tasks.
3. Specify co operation between master and slaves
Define an interface for the subservice identified in step1 it will be implemented by the slave and used by
the master to delegate the processing of individual subtask. One option for passing subtasks from the
master to the slaves is to include them as a parameter when invoking the subservice.
Another option is to define a repository where the master puts sub tasks and the slaves fetch them.
4. Implement the slave components according to the specifications developed in previous step.
5. Implement the master according to the specifications developed in step 1 to 3
There are two options for dividing a task into subtasks.
The first is to split work into a fixed number of subtasks.
The second option is to define as many subtasks as necessary or possible.
Use strategy pattern to support dynamic exchange and variations of algorithms for subdividing a task.
Q5) Define Proxy Design.Discuss benefits and liabilities of same?(Jun 14,Jun 15,Jan 16)(10 Marks)
Soln:
Proxy design pattern makes the clients of a component communicate with a representative rather than to
the component itself. Introducing such a place holder can serve many purposes, including enhanced
efficiency, easier access and protection from unauthorized access.
The Proxy pattern provides the following Benefits:
Enhanced efficiency and lower cost
The Virtual Proxy variant helps to implement a 'load-on-demand' strategy. This allows you to avoid
unnecessary loads from disk and usually speeds up your application
Decoupling clients from the location of server components
By putting all location information and addressing functionality into a Remote Proxy variant, clients are
not affected by migration of servers or changes in the networking infrastructure. This allows client code
to become more stable and reusable.
Separation of housekeeping code from functionality.
A proxy relieves the client of burdens that do not inherently belong to the task the client is to perform.
The Proxy pattern has the following Liabilities:
Less efficiency due to indirection
All proxies introduce an additional layer of indirection.
Over kill via sophisticated strategies
Be careful with intricate strategies for caching or loading on demand they do not always pay.
Q6) How the whole-part can be implemented? Also mention the advantages and disadvantages of
whole-part(Jun 15,Jan 16)(10 Marks)
Soln:
Implementation:
1. Design the public interface of the whole
Analyze the functionality the whole must offer to its clients.
Only consider the clients view point in this step.
Think of the whole as an atomic component that is not structured into parts.
2. Separate the whole into parts, or synthesize it from existing ones.
There are two approaches to assembling the parts either assemble a whole ‘bottom-up’ from existing
parts, or decompose it ‘top-down’ into smaller parts.
Mixtures of both approaches is often applied
3. If you follow a bottom up approach, use existing parts from component libraries or class libraries and
specify their collaboration.
4. If you follow a top down approach, partition the Wholes services into smaller collaborating
services and map these collaborating services to separate parts.
5. Specify the services of the whole in terms of services of the parts.
Decide whether all part services are called only by their whole, or if parts may also call each other. Two
are two possible ways to call a Part service: @ If a client request is forwarded to a Part service, the Part
does not use any knowledge about the execution context of the Whole, relying on its own environment
instead. @ A delegation approach requires the Whole to pass its own context information to the Part.
6. Implement the parts
If parts are whole-part structures themselves, design them recursively starting with step1 . if not reuse
existing parts from a library.
7. Implement the whole
Implement services that depend on part objects by invoking their services from the whole.
The whole-part pattern offers several Benefits:
8.Changeability of parts:
Part implementations may even be completely exchanged without any need to modify other parts or
clients.
9.Separation of concerns:
Each concern is implemented by a separate part.
10.Reusability in two aspects:
Parts of a whole can be reused in other aggregate objects
Encapsulation of parts within a whole prevents clients from ‘scattering’ the use of part objects all over its
source code.
The whole-part pattern suffers from the following Liabilities:
11.Lower efficiency through indirection
Since the Whole builds a wrapper around its Parts, it introduces an additional level of indirection between
a client request and the Part that fulfils it.
12.Complexity of decomposition into parts.
An appropriate composition of a Whole from different Parts is often hard to find, especially when a
bottom-up approach is applied.
The introduction of the master separates slave and client code from the code for partitioning work,
delegating work to slaves, collecting the results from the slaves, computing the final result and handling
slave failure or inaccurate slave results.
Efficiency
The Master-Slave pattern for parallel computation enables you to speed up the performance of computing
a particular service when implemented carefully.
Q8) Briefly comment on the different steps carried out to realize the implementation of Proxy
pattern?(Jan 14,Jun 15)(6 Marks)
Soln:
1. Identify all responsibilities for dealing with access control to a component
Attach these responsibilities to a separate component the proxy.
2. If possible introduce an abstract base class that specifies the common parts of the interfaces of
both the proxy and the original.
Derive the proxy and the original from this abstract base.
3. Implement the proxy’s functions
To this end check the roles specified in the first step
4. Free the original and its client from responsibilities that have migrated into the proxy.
5. Associate the proxy and the original by giving the proxy a handle to the original. This handle may be
a pointer a reference an address an identifier, a socket, a port, and so on.
6. Remove all direct relationships between the original and its client
Replace them by analogous relationships to the proxy.
Unit-VIII
Q2) Explain with neat diagram, evolutionary delivery life cycle model?(Jun 15)(10 Marks)
Soln:
Any organization that embraces architecture as a foundation for its software development processes needs
to understand its place in the life cycle. Several life-cycle models exist in the literature, but one that puts
architecture squarely in the middle of things is the evolutionary delivery life cycle model shown in figure
The intent of this model is to get user and customer feedback and iterate through several releases before
the final release. The model also allows the adding of functionality with each iteration and the delivery of
a limited version once a sufficient set of features has been developed.
Q3) What are the suggested standard organization points for interface
documentation?(Jun 15)(12 Marks)
Soln:
An interface is a boundary across which two independent entities meet and interact or communicate with
each other.
1. Interface identify
When an element has multiple interfaces, identify the individual interfaces to distinguish them. This
usually means naming them. You may also need to provide a version number.
2. Resources provided:
The heart of an interface document is the resources that the element provides.
Resource syntax – this is the resource’s signature
Resource Semantics:
x Assignment of values of data
x Changes in state
x Events signaled or message sent
x how other resources will behave differently in future
x humanly observable results
x Resource Usage Restrictions
x initialization requirements
x limit on number of actors using resource
3. Data type definitions:
If used if any interface resources employ a data type other than one provided by the underlying
programming language, the architect needs to communicate the definition of that type. If it is defined by
another element, then reference to the definition in that element’s documentation is sufficient.
4. Exception definitions:
These describe exceptions that can be raised by the resources on the interface. Since the same exception
might be raised by more than one resource, if it is convenient to simply list each resource’s exceptions but
define them in a dictionary collected separately.
5. Variability provided by the interface.
Does the interface allow the element to be configured in some way? These configuration parameters and
how they affect the semantics of the interface must be documented.
6. Quality attribute characteristics:
The architect needs to document what quality attribute characteristics (such as performance or reliability)
the interface makes known to the element's users
7. Element requirements:
What the element requires may be specific, named resources provided by other elements. The
documentation obligation is the same as for resources provided: syntax, semantics, and any usage
restrictions.
8. Rationale and design issues:
Why these choices the architect should record the reasons for an elements interface design. The rationale
should explain the motivation behind the design, constraints and compromises, what alternatives designs
were considered.
9. Usage guide:
Item 2 and item 7 document an element's semantic information on a per resource basis. This sometimes
falls short of what is needed. In some cases semantics need to be reasoned about in terms of how a broad
number of individual interactions interrelate.
Q4) List the steps of ADD and explain?(Jan 14,Jan 16)(10 Marks)
Soln:
ADD Steps:
Steps involved in attribute driven design (ADD)
1. Choose the module to decompose
Start with entire system
Inputs for this module need to be available
Constraints, functional and quality requirements
2. Refine the module
a) Choose architectural drivers relevant to this decomposition
b) Choose architectural pattern that satisfies these drivers
c) Instantiate modules and allocate functionality from use cases representing using multiple views
d) Define interfaces of child modules
e) Verify and refine use cases and quality scenarios
3. Repeat for every module that needs further decomposition
1. Choose The Module To Decompose
x the following are the modules: system->subsystem->submodule
x Decomposition typically starts with system, which then decompose into subsystem and then into
sub-modules.
x In our Example, the garage door opener is a system
x Opener must interoperate with the home information system
x Less important requirements are satisfied within constraints obtained by satisfying more
important requirements
This is a difference of ADD from other architecture design methods
Q5) What are the uses of architectural documentation? Bring out the concept of view as
applied to architectural documentation?(Jun 15,Jan 16)(10 Marks)
Soln:
The Uses of Architectural Documentation are:
Architecture documentation is both prescriptive and descriptive. That is, for some audiences it prescribes
what should be true by placing constraints on decisions to be made. For other audiences it describes what
is true by recounting decisions already made about a system's design.
All of this tells us that different stakeholders for the documentation have different needs—different kinds
of information, different levels of information, and different treatments of information.
One of the most fundamental rules for technical documentation in general, and software architecture
documentation in particular, is to write from the point of view of the reader. Documentation that was easy
to write but is not easy to read will not be used, and "easy to read" is in the eye of the beholder—or in this
case, the stakeholder.
Documentation facilitates that communication. Some examples of architectural stakeholders and the
information they might expect to find in the documentation are given in Table 9.1.
In addition, each stakeholders come in two varieties: seasoned and new. A new stakeholder will want
information similar in content to what his seasoned counterpart wants, but in smaller and more
introductory doses. Architecture documentation is a key means for educating people who need an
overview: new developers, funding sponsors, visitors to the project, and so forth.
The concept of a view, which you can think of as capturing a structure, provides us with the basic
principle of documenting software architecture Documenting an architecture is a matter of documenting
the relevant views and then adding documentation that applies to more than one view. This principle is
useful because it breaks the problem of architecture documentation into more tractable parts, which
provide the structure for the remainder of this chapter:
Choosing the relevant views
Documenting view
Documenting information that applies to more than one view
A view catalog is the reader's introduction to the views that the architect has chosen to include in the suite
of documentation. There is one entry in the view catalog for each view given in the documentation suite.
Each entry should give the following: The name of the view and what style it instantiates, A description
of the view's element types, relation types, and properties A description of what the view is for
Management information about the view document, such as the latest version, the location of the view
document, and the owner of the view document
View Template
A view template is the standard organization for a view. It helps a reader navigate quickly to a section of
interest, and it helps a writer organize the information and establish criteria for knowing how much work
is left to do.
Q7) What are the suggested standard organization points for view documentation?
(Jan 15,Jun 15)(8 Marks)
Soln:
Primary presentation- elements and their relationships, contains main information about these system ,
usually graphical or tabular.
Element catalog- details of those elements and relations in the picture,
Context diagram- how the system relates to its environment
Variability guide- how to exercise any variation points a variability guide should include documentation
about each point of variation in the architecture, including
The options among which a choice is to be made
The binding time of the option. Some choices are made at design time, some at build time, and others at
runtime.
Architecture background –why the design reflected in the view came to be? an architecture background
includes
o rationale, explaining why the decisions reflected in the view were made and why alternatives were
rejected
o analysis results, which justify the design or explain what would have to change in the face of a
modification
o assumptions reflected in the design
Glossary of terms used in the views, with a brief description of each.
Other information includes management information such as authorship, configuration control data, and
change histories. Or the architect might record references to specific sections of a requirements document
to establish traceability