Cooperation Between Concurrent Objects
Cooperation Between Concurrent Objects
Cooperation Between Concurrent Objects
• A concurrent object (active object) has its own thread of control and can execute
independently of other objects.
• In the design of concurrent systems, several problems need to be considered that do not
arise in the design of sequential systems.
• In most concurrent applications, concurrent objects must cooperate with each other in
order to perform the services required by the application.
Problems
• The mutual exclusion problem occurs when concurrent objects need to have exclusive
access to a resource, such as shared data or a physical device. A variation on this problem, in
which the mutual exclusion constraint can sometimes be relaxed, is the multiple readers and
writer's problem.
• The synchronization problem occurs when two concurrent objects need to synchronize their
operations with each other.
• Thus, the producer sends a message and continues without waiting for a response.
• When the message arrives, the consumer accepts the message, processes it, generates a
reply, and then sends the reply.
• Often the context of the problem is different; it might be a different application, a different
platform, or a different programming language.
• Because of the different context, one usually ends up redesigning and reimplementing the
solution, thereby falling into the “reinventing the wheel” trap.
• The field of software patterns, including architectural and design patterns, is helping
developers avoid unnecessary redesign and reimplementation.
• The description specifies objects and classes that are customized to solve a general design
problem in a particular context.
• A design pattern is a larger-grained form of reuse than a class because it involves more than
one class and the interconnection among objects from different classes.
• Product line–specific patterns: These are patterns used in specific application areas, such as
factory automation
• Idioms: Idioms are low-level patterns that are specific to a given programming language and
describe implementation solutions to a problem that use the features of the language
• This section describes the design of component interfaces, an important issue in software
architecture.
• It describes how interfaces are specified before describing provided and required
interfaces, and connectors that interconnect components.
• The modules could be developed in different ways depending on the particular platform
and the software architecture.
Connectors
• In addition to defining the components, a software architecture must define the connectors
that join the components.
• The interaction protocols for each of these types of communication can be encapsulated in
a connector.
• Modifiability.
The extent to which software is capable of being modified during and after initial development.
• Testability.
• Traceability.
The extent to which products of each phase can be traced back to products of previous phases.
• Scalability. The extent to which the system is capable growing after its initial deployment.
• Performance. The extent to which the system meets its performance goals, such as
throughput and response times.
• Availability. The extent to which the system is capable of addressing system failure.
What is User Interface Design (UID)?
• User interface design creates an effective communication medium between a human and a
computer.
• Following a set of interface design principles, design identifies interface objects and actions
• and then creates a screen layout that forms the basis for a user interface prototype.
• A software engineer designs the user interface by applying an iterative process that draws
on predefined design principles.
Importance:
• If software is difficult to use,
• you won’t like it, regardless of the computational power it exhibits, the content it delivers,
or the functionality it offers.
• The interface has to be right because it molds a user’s perception of the software.
• Once user tasks have been identified, user scenarios are created and analyzed to define a
set of interface objects and actions.
• These form the basis for the creation of screen layout that depicts graphical design and
placement of icons, definition of descriptive screen text, specification and titling of windows,
and specification of major and minor menu items.
• Tools are used to prototype and ultimately implement the design model, and the result is
evaluated for quality.
• Streamline interaction as skill levels advance and allow the interaction to be customized
• Design for direct interaction with objects that appear on the screen
Design Principles to Reduce the User’s Memory Load
• Reduce demand on short-term memory
• If past interactive models have created user expectations, do not make changes unless there
is a compelling reason to do so
• the end user develops a mental image that is often called the user’s mental model or the
system perception,
• Your role, as an interface designer, is to reconcile these differences and derive a consistent
representation of the interface
• The user model establishes the profile of end users of the system.
• To build an effective user interface, “all design should begin with an understanding of the
intended users, including profiles of their age, gender, physical abilities, education, cultural
or ethnic background, motivation, goals and personality”
• The user’s mental model (system perception) is the image of the system that end users
carry in their heads
• Each of these tasks will occur more than once, with each pass around the spiral representing
additional elaboration of requirements and the resultant design.
• In most cases, the construction activity involves prototyping—the only practical way to
validate what has been designed.
Interface Analysis
• Interface analysis focuses on the profile of the users who will interact with the system.
• Skill level, business understanding, and general receptiveness to the new system are
recorded; and different user categories are defined.
• Once general requirements have been defined, a more detailed task analysis is conducted.
• Those tasks that the user performs to accomplish the goals of the system are identified,
described, and elaborated (over a number of iterative passes through the spiral)
• Finally, analysis of the user environment focuses on the characteristics of the physical work
environment (e.g., location, lighting, position constraints).
• The information gathered as part of the analysis action is used to create an analysis model
for the interface.
• In the case of user interface design, understanding the problem means understanding
(1) the people (end users) who will interact with the system through the interface,
(2) the tasks that end users must perform to do their work,
User Analysis
• Are users trained professionals, technicians, clerical, or manufacturing workers?
• Do users work normal office hours or do they work until the job is done?
• Is the software to be an integral part of the work users do or will it be used only occasionally?
• What are the consequences if a user makes a mistake using the system?
• Are users experts in the subject matter that is addressed by the system?
• Do users want to know about the technology that sits behind the interface?
• What tasks and subtasks will be performed as the user does the work?
• What specific problem domain objects will the user manipulate as work is performed?
• Object Elaboration: Objects can be categorized into classes. Attributes of each class are
defined, and an evaluation of the actions applied to each object provides a list of operations.
• Workflow Analysis: Allows you to understand how a work process is completed when
several people are involved.
• Will mechanisms be available for moving directly to summary information for large
collections of data?
• Will graphical output be scaled to fit within the bounds of the display device that is used?
• They are influenced by the activity around them, the physical characteristics of the
workplace, the type of equipment they are using, and the work relationships they have with
other people.
• In some applications the user interface for a computer-based system is placed in a “user-
friendly location” (e.g., proper lighting, good display height, easy keyboard access),
• but in others (e.g., a factory floor or an airplane cockpit), lighting may be suboptimal, noise
may be a factor, a keyboard or mouse or touch screen may not be an option, display
placement may be less than ideal.
• In addition to physical environmental factors, the workplace culture also comes into play
Interface Design:
• Once interface analysis has been completed, all tasks (or objects and actions) required by
the end user have been identified in detail and the interface design activity commences.
• Each user interface design step occurs a number of times, elaborating and refining
information developed in the preceding step.
2. Identify events (user actions) that will cause the state of the user interface to change,
3. Depict the representation of each state, and
4. Indicate how the user interprets each state from information provided through the
interface.
3. Nouns (objects) and verbs (actions) are isolated to create a list of objects and actions.
4. Once the objects and actions have been defined and elaborated iteratively, they are
categorized by type.
6. A source object (e.g., a report icon) is dragged and dropped onto a target object (e.g., a
printer icon).
7. When you are satisfied that all important objects and actions have been defined (for one
design iteration), screen layout is performed.
Design Issues:
• Response Time
• Help Facilities
• Error Handling
• Application Accessibility
• Internationalization
Where am I?
• Answers to these questions allow a user to understand context and navigate more
effectively through the app.
• Because of the sheer volume of competing Web-Apps and mobile apps in virtually every
subject area, the interface must “grab” a potential user immediately.
• Communication. The interface should communicate the status of any activity initiated by the
user.
• Consistency. The use of navigation controls, menus, icons, and aesthetics (e.g., colour,
shape, layout) should be consistent throughout
• Controlled Autonomy. The interface should facilitate user movement throughout the
application, but it should do so in a manner that enforces navigation conventions that have
been established for the application
• Efficiency. The design of the application and its interface should optimize the user’s work
efficiency, not the efficiency of the developer who designs and builds it or the client-server
environment that executes it.
• Flexibility. The interface should be flexible enough to enable some users to accomplish tasks
directly and others to explore the application in a somewhat random fashion
• Focus. The interface (and the content it presents) should stay focused on the user task(s) at
hand
• Human Interface Objects. A vast library of reusable human interface objects has been
developed for both Web and mobile Apps. Use them.
• Latency Reduction. Rather than making the user wait for some internal operation to
complete, the application should use multitasking in a way that lets the user proceed with
work.
• Learnability. An application interface should be designed to minimize learning time and once
learned, to minimize relearning required when the app is revisited.
• Metaphors. An interface that uses an interaction metaphor is easier to learn and easier to
use, as long as the metaphor is appropriate for the application and the user.
• Readability. All information presented through the interface should be readable by young
and old.
• Track State. When appropriate, the state of the user interaction should be tracked and
stored so that a user can logoff and return later to pick up where she left off.
• Visible Navigation. A well-designed interface provides “the illusion that users are in the
same place, with the work brought to them
A few pragmatic “don’ts” for interface design
• Don’t force the user to read voluminous amounts of text, particularly when the text
explains the operation of the WebApp or assists in navigation.
• Don’t force the user to search the display to determine how to link to other content or
services.
Define a set of user tasks that are associated with each action
Refine interface layout and storyboards using input from aesthetic design
Identify user interface objects that are required to implement the interface
Design Evaluation
• Once you create an operational user interface prototype, it must be evaluated to determine
whether it meets the needs of the user.
• It ranges from an informal “test drive,” in which a user provides impromptu feedback to a
formally designed study that uses statistical methods for the evaluation of questionnaires
completed by a population of end users.
• After the design model has been completed, a first-level prototype is created.
• The prototype is evaluated by the user, who provides you with direct comments about the
efficacy of the interface.
• In addition, if formal evaluation techniques are used (e.g., questionnaires, rating sheets),
you can extract information from these data.
• Design modifications are made based on user input, and the next level prototype is created.
• The evaluation cycle continues until no further modifications to the interface design are
necessary.
• The prototyping approach is effective, but is it possible to evaluate the quality of a user
interface before a prototype is built?
• If you identify and correct potential problems early, the number of loops through the
evaluation cycle will be reduced and development time will shorten.
• If a design model of the interface has been created, a number of evaluation criteria can be
applied during early design reviews
2. The number of user tasks specified and the average number of actions per task provide an
indication of interaction time and the overall efficiency of the system.
3. The number of actions, tasks, and system states indicated by the design model imply the
memory load on users of the system.
4. Interface style, help facilities, and error handling protocol provide a general indication of
the complexity of the interface and the degree to which it will be accepted by the user.
5. Once the first prototype is built, you can collect a variety of qualitative and quantitative
data that will assist in evaluating the interface.
6. To collect qualitative data, questionnaires that allow users to assess the interface prototype
can be distributed.
8. Users are observed during interaction, and data—such as number of tasks correctly
completed over a standard time period, frequency of actions, sequence of actions, time
spent “looking” at the display, number and types of errors, error recovery time, time spent
using help, and number of help references per standard time period—are collected and used
as a guide for interface modification.
• A design pattern isn't a finished design that can be transformed directly into code.
• It is a description or template for how to solve a problem that can be used in many
different situations.
• Each design pattern provides you with a proven approach to one part of the problem to be
solved.
Importance:
• Have you ever heard the phrase “reinventing the wheel”?
• It happens all the time in software development, and it’s a waste of time and energy.
• By using existing design patterns, you can acquire a proven solution for a specific problem.
• As each pattern is applied, solutions are integrated and the application to be built moves
closer to a complete design.
Design Patterns:
• A design pattern can be characterized as “a three-part rule which expresses a relation
between a certain context, a problem, and a solution”.
• For software design, context allows the reader to understand the environment in which the
problem resides and what solution might be appropriate within that environment.
• A set of requirements, including limitations and constraints, acts as a system of forces that
influences how the problem can be interpreted within its context and how the solution can
be effectively applied.
• It is a proven concept : Patterns capture solutions with a track record, not theories or
speculation.
• The solution isn’t obvious : Many problem-solving techniques (such as software design
paradigms or methods) try to derive solutions from first principles.
• The best patterns generate a solution to a problem indirectly—a necessary approach for
the most difficult problems of design.
• It describes a relationship : Patterns don’t just describe modules but describe deeper system
structures and mechanisms.
• All software serves human comfort or quality of life; the best patterns explicitly appeal to
aesthetics and utility.
• Reusing design patterns helps to prevent subtle issues that can cause major problems and
improves code readability for coders and architects familiar with the patterns.
• Often, people only understand how to apply certain software design techniques to certain
problems.
• Design patterns provide general solutions, documented in a format that doesn't require
specifics tied to a particular problem.
• Common design patterns can be improved over time, making them more robust than ad-
hoc designs.
• Data patterns describe recurring data-oriented problems and the data modelling solutions
that can be used to solve them.
• Component patterns address problems associated with the development of subsystems and
components, the manner in which they communicate with one another, and their placement
within a larger architecture.
• Interface design patterns describe common user interface problems and their solution with
a system of forces that includes the specific characteristics of end users.
• WebApp patterns address a problem set that is encountered when building Web-Apps and
often incorporates many of the other patterns categories just mentioned.
• Mobile patterns describe commonly encountered problems when developing solutions for
mobile platforms.
• Structural patterns focus on problems and solutions associated with how classes and
objects are organized and integrated to build a larger structure.
• That is, you can select a “ reusable mini-architecture that provides the generic structure and
behaviour for a family of software abstractions, along with a context . . .
Describing a Pattern
• How do you find patterns that fit your needs?
• Pattern-based design begins with the recognition of patterns within the application you
intend to build,
• continues with a search to determine whether others have addressed the pattern,
• and concludes with the application of an appropriate pattern to the problem at hand.
• Context— describes the environment in which the problem resides including the application
domain
• Forces— lists the system of forces that affect the manner in which the problem must be
solved; includes a discussion of limitation and constraints that must be considered
• Solution— provides a detailed description of the solution proposed for the problem
• Consequences —describes the potential trade-offs that must be considered when the
pattern is implemented and the consequences of using the pattern
• Known uses —provides examples of actual uses of the design pattern in real applications
3. Examining the big picture, extract the patterns that are present at that level of abstraction.
4. Begin your design with “big picture” patterns that establish a context or skeleton for further
design work.
5. “Work inward from the context” looking for patterns at lower levels of abstraction that
contribute to the design solution.
7. Refine the design by adapting each pattern to the specifics of the software you’re trying to
build.
Design Tasks
1. Examine the requirements model and develop a problem hierarchy.
2. Determine if a reliable pattern language has been developed for the problem domain.
3. Beginning with a broad problem, determine whether one or more architectural patterns
are available for it.
4. Using the collaborations provided for the architectural pattern, examine subsystem or
component-level problems and search for appropriate patterns to address them.
5. Repeat steps 2 through 4 until all broad problems have been addressed.
6. If user interface design problems have been isolated (this is almost always the case), search
the many user interface design pattern repositories for appropriate patterns.
8. Be certain to refine the design as it is derived from patterns using design quality criteria as a
guide.
Common Design Mistakes
• A number of common mistakes occur when pattern-based design is used.
• In some cases, not enough time has been spent to understand the underlying problem and
its context and forces,
• and as a consequence, you select a pattern that looks right but is inappropriate for the
solution required.
• Once the wrong pattern is selected, you refuse to see your error and force-fit the pattern.
• In other cases, the problem has forces that are not considered by the pattern you’ve
chosen, resulting in a poor or erroneous fit.
• Sometimes a pattern is applied too literally and the required adaptations for your problem
space are not implemented.
Architectural patterns
• An Architectural Pattern expresses a fundamental structural organization schema for
software systems.
• It provides a set of predefined subsystems, their responsibilities, and includes rules and
guidelines for organizing the relationships between them.
• The architectural patterns address various issues in software engineering, such as computer
hardware performance limitations, high availability and minimization of a business risk.
Software Architecture
The software architecture separates the overall structure of the system, in terms of subsystems and
their interfaces, from the internal details of the individual subsystems.
A software architecture is structured into subsystems, in which each subsystem should be relatively
independent of other subsystems.
“The software architecture of a program or computing system is the structure or structures of the
system, which comprise software elements, the externally visible properties of those elements, and
the relationships among them.”
Thus, a component can be considered a black box, because its implementation is hidden from other
components.
Components communicate with each other in different ways using predefined communication
patterns.
• In particular, a subsystem class diagram depicts the static structural relationship between
the subsystems.
• In which there are multiple instances of the ATM Client subsystem and a single instance of
the Banking Service subsystem.
And in particular how the subsystems of the architecture are allocated to physical nodes in a
distributed configuration.
A deployment diagram can depict a specific deployment with a fixed number of nodes.
Alternatively, it can depict the overall structure of the deployment – for example, identifying that a
subsystem can have many instances, each deployable to a separate node, but not depicting the
specific number of instances.
architectural structure patterns, which address the static structure of the architecture,
and architectural communication patterns, which address the dynamic communication among
distributed components of the architecture.
This chapter introduces the concept of software architectural patterns and describes one
architectural structure pattern, the Layers of Abstraction pattern
Operating systems, database management systems, and network communication software are
examples of software systems that are often structured as hierarchies.
Call/Return Pattern
The simplest form of communication between objects uses the Call/Return pattern.
A sequential design consists of passive classes, which are instantiated as passive objects.
The only possible form of communication between objects in a sequential design is operation (also
known as method) invocation, which is also referred to as the Call/Return pattern.
In this pattern, a calling operation in the calling object invokes a called operation in the called object
■ Strengths of solution
■ Weaknesses of solution
■ Related patterns
■ Reference. Where you can find more information about the pattern.
Service-oriented architecture: typically consist of multiple distributed autonomous services that can
be composed into distributed software applications
Concurrent and real-time software architecture: describes the design of real-time software
architectures, which are concurrent architectures usually having to deal with multiple streams of
input events
Software product line architecture: are architectures for families of products that need to capture
both the commonality and variability in the family
During design modelling, the solution is synthesized by designing a software architecture that
defines the structural and behavioural properties of the software system.
After performing this decomposition, each subsystem can then be designed independently
Designing software architecture
Several decisions need to be made in designing the software architecture:
Integrate the use case–based interaction models into an initial software architecture.
Determine the subsystems using separation of concerns and subsystem structuring criteria.
The design goal is for each subsystem to perform a major function that is relatively independent of
the functionality provided by other subsystems.
A subsystem can be structured further into smaller subsystems, consisting of a subset of the
functionality provided by the parent subsystem.
After the interface between subsystems has been defined, subsystem design can proceed
independently.
To structure the system into subsystems, start with the use cases.
Objects that realize the same use case have higher coupling because they communicate with each
other and have lower (or no) coupling with objects in other use cases.
Whereas an object can participate in more than one use case, it can only be part of one subsystem;
thus, an object that participates in more than one use case needs to be allocated to a single
subsystem, usually the subsystem with which it is most highly coupled.
This is done by integrating the use case–based interaction diagrams developed as part of the
dynamic model.
Although dynamic interaction between objects can be depicted on either sequence diagrams or
communication diagrams,
this integration uses communication diagrams because they visually depict the interconnection
between objects, as well as the messages passed between them.
In the analysis model, at least one communication diagram is developed for each use case.
The integrated communication diagram is a synthesis of all the communication diagrams developed
to support the use cases.
The integrated communication diagram is, in effect, a merger of the communication diagrams
This guideline can be viewed as a special case of the geographical location rule because clients and
services are usually at different locations.
User Interaction
Users often use their own PCs as part of a larger distributed configuration, so the most flexible
option is to keep user interaction objects in separate subsystems.
Because user interaction objects are usually clients, this guideline can be viewed as a special case of
the client/service guideline.
Scope of Control
A control object and all the entity and I/O objects it directly controls should all be part of one
subsystem and not split among subsystems.
Subsystem types
Client Subsystem
A client subsystem is a requester of one or more services.
There are many different types of clients; some may be wholly dependent on a given service, and
some may be only partially dependent.
User Interaction Subsystem
A user interaction subsystem provides the user interface and performs the role of a client in a
client/server system, providing user access to services.
There may be more than one user interaction subsystem – one for each type of user
Service Subsystem
A service subsystem provides a service for client subsystems.
It responds to requests from client subsystems, although it does not initiate any requests.
A service subsystem is any subsystem that provides a service, servicing client requests.
Control Subsystem
A control subsystem controls a given part of the system.
The subsystem receives its inputs from the external environment and generates outputs to the
external environment, usually without any human intervention.
Coordinator Subsystem
Coordinator subsystems coordinate the execution of other subsystems, such as control subsystems
or service subsystems.
Input/Output Subsystem
An input, output, or input/output subsystem is a subsystem that performs input and/or output
operations on behalf of other subsystems.