Bcse301l Se Module-4 Smsatapathy
Bcse301l Se Module-4 Smsatapathy
L T P C
BCSE301L - 3 0 0 3
BCSE301P - 0 0 2 1
Dr. S M SATAPATHY
Associate Professor Sr.,
School of Computer Science and Engineering,
VIT Vellore, TN, India – 632 014.
SOFT WARE
DESIGN
Module – 4
Software Design
1. Cohesion, Coupling
2. Architectural Design
3. Detailed Design
3
INTRODUCTION
• Items designed:
– module structure,
– control relationship among the modules
• call relationship or invocation relationship
– interface among different modules,
• data items to be exchanged among different modules,
– data structures of individual modules,
– algorithms for individual modules.
INTRODUCTION
• Good software designs:
– seldom arrived through a single step procedure:
– but through a series of steps and iterations.
Degree of
cohesion
COINCIDENTAL COHESION
• The module performs a set of tasks:
– which relate to each other very loosely, if at all.
• the module contains a random collection of functions.
• functions have been put in the module out of pure coincidence
without any thought or design.
• Coincidental cohesion exists in modules that contain instructions that
have little or no relationship to one another.
LOGICAL COHESION
• All elements of the module perform similar operations:
– e.g. error handling, data input, data output, etc.
• An example of logical cohesion:
– a set of print functions to generate an output report arranged into a
single module.
• Logical cohesion occurs in modules that contain instructions that appear
to be related because they fall into the same logical class of functions.
TEMPORAL COHESION
• The module contains tasks that are related by the fact:
– all the tasks must be executed in the same time span.
• Example:
– The set of functions responsible for
• initialization,
• start-up, shut-down of some process, etc.
• Module exhibits temporal cohesion when it contains tasks that
are related by the fact that all tasks must be executed in the
same time-span.
PROCEDURAL COHESION
• The set of functions of the module:
– all part of a procedure (algorithm)
– certain sequence of steps have to be carried out in a certain order for
achieving an objective,
• e.g. the algorithm for decoding a message.
• Procedural Cohesion occurs in modules whose instructions although
accomplish different tasks yet have been combined because there is a
specific order in which the tasks are to be completed.
COMMUNICATIONAL COHESION
• All functions of the module:
– reference or update the same data structure,
• Example:
– the set of functions defined on an array or a stack.
• X and Y both operate on the same input data or contribute towards the
same output data. But we might consider making them separate
procedures.
SEQUENTIAL COHESION
• Elements of a module form different parts of a sequence,
– output from one element of the sequence is input to the next.
– Example:
•
sort
search
display
FUNCTIONAL COHESION
• Different elements of a module cooperate:
– to achieve a single function,
– e.g. managing an employee's pay-roll.
• When a module displays functional cohesion,
– we can describe the function using a single sentence.
Degree of
coupling
DATA COUPLING
• Two modules are data coupled,
– if they communicate via a parameter:
• an elementary data item,
• e.g an integer, a float, a character, etc.
– The data item should be problem related:
• not used for control purpose.
• The dependency between module A and B is said to be data coupled if
their dependency is based on the fact they communicate by only passing of
data. Other than communicating through data, the two modules are
independent.
STAMP COUPLING
• Two modules are stamp coupled,
– if they communicate via a composite data item
• such as a record in PASCAL
• or a structure in C.
• Stamp coupling occurs between module A and B when complete data
structure is passed from one module to another.
CONTROL COUPLING
• Data from one module is used to direct
– order of instruction execution in another.
• With common coupling, module A and module B have shared data. Global
data areas are commonly found in programming languages. Making a
change to the common data means tracing back to all the modules which
access that data to evaluate the effect of changes.
COMMON COUPLING
CONTENT COUPLING
• Content coupling exists between two modules:
– if they share code,
– e.g, branching from one module into another module.
• The degree of coupling increases
– from data coupling to content coupling.
• In OOD:
– state information is not shared in a centralized data.
– but is distributed among the objects of the system.
OOD VS. FOD
• In an employee pay-roll system, the following can be global data:
– names of the employees,
– their code numbers,
– basic salaries, etc.
• Whereas, in object oriented systems:
– data is distributed among different employee objects of the system.
• Objects communicate by message passing.
– one object may discover the state information of another object by
interrogating it.
• Of course, somewhere or other the functions must be implemented:
– the functions are usually associated with specific real-world entities
(objects)
– directly access only part of the system state information.
OOD VS. FOD
• Function-oriented techniques group functions together if:
– as a group, they constitute a higher level function.
• On the other hand, object-oriented techniques group functions together:
– on the basis of the data they operate on.
– Manager Model
• Applicable to concurrent systems
• One subsystems controls , starts and stops the coordination of other
subsystems.
CONTROL MODELS
• Event-based control
• It is driven by externally generated events. Timing of the event is with the subsystem
that process the event.
• Broadcast models.
– Broadcast is sent to all subsystems.
– Any sub system which can handle the broadcast will react
CONTROL MODELS
• Interrupt-driven models.
– Used in real-time systems
– Interrupt handler components handles the interrupts
AGILITY AND ARCHITECTURE
• To avoid rework, user stories are used to create and evolve an
architectural model (walking skeleton) before beginning any coding.
• Use models which allow software architects to add user stories to the
evolving storyboard and works with the product owner to prioritize the
architectural stories as “sprints” (work units) are planned.
• Well run agile projects include delivery of architectural documentation
during each sprint.
• After the sprint is completed, the architect reviews the working prototype
for quality before the team presents it to the stakeholders in a formal
sprint review.
ARCHITECTURAL STYLES
• Each style describes a system category that encompasses:
– set of components (for example: a database, computational modules) that
perform a function required by a system.
– set of connectors that enable “communication, coordination and
cooperation” among components.
– constraints that define how components can be integrated to form the
system.
– semantic models that enable a designer to understand the overall
properties of a system by analyzing the known properties of its constituent
parts.
DATA CENTERED ARCHITECTURE
• The circular diagram has four layers: core layer, utility layer, application layer, and
user interface layer from inner to outer level. The outer level is in a semicircle
form. Each layer has components displayed with squares which are decreasing
in number from outer to inner layers.
LAYERED ARCHITECTURAL STYLE
• Under this style application functionality is broken down into various
layers by grouping relevant functions into one layer and placing the layers
one after another in vertical fashion. Each layer is assigned a particular role,
the interaction between layers is through interfaces.
• For example, the interaction of users over internet with first layer, say,
presentation is through http, interaction between middle layer (business
logic) and back layer (database) is through JDBC
• The layers can come all on a single hardware machine or each layer on
one separate hardware computer. If layers are mapped to individual
hardware machines, it is known as n-tier.
• Generally, web applications are spread over minimum 3 layers, first layer is
presentation layer, second layer consists of business logic processing and
third layer is data access.
N-TIER / 3-TIER ARCHITECTURAL STYLE
• It is an improved way of designing layered architecture style, here instead of
assigning all layers to one physical server, each layer is assigned and hosted to a
separate physical computer.
• The tiers interact with each other using platform specific protocol of
communication- HTTP, JDBC, etc.
MODEL VIEW CONTROLLER ARCHITECTURE
• Model View Controller or MVC, it is a software design pattern for developing
web applications.
• MVC pattern has three parts:
– Model - The lowest level of the pattern which is responsible for maintaining data.
It accepts requests from View and responds to instructions from the controller to
update its data. It is the data base layer.
– View - This is responsible for displaying all or a portion of the data to the user.
This is screen form design portion. They are script based systems such as JSP, ASP,
PHP. etc..
– Controller – This is Software Code that controls the interactions between the
Model and View.
• It receives the input, validates it and then performs the business operation that
modifies the state of the data model. Typically, it reads data from a view (form),
control user input, and send input data to the model (database).
• MVC isolates the application logic from the user interface layer and supports
separation of concerns.
MODEL VIEW CONTROLLER ARCHITECTURE
MODEL VIEW CONTROLLER ARCHITECTURE
• The diagram shows a model view controller architecture. The architecture
contains three section. The client, the server and the external data.
• A client accessed a browser. The browser connects to the server via two paths.
• The server contains controller, model and view. The browser sends a user
request or data to the controller or the browser accesses H T M L data in the
view.
– The controller manages user requests, selects model behaviour and selects view
response. The controller sends a view selection to view and sends a sends a state
change behaviour request to model.
– The view prepares data from model, requests update from model and presents
view selected by controller. View receives the data from model and sends an
updated request to model.
– The model, encapsulates functionality, encapsulates content objects and
incorporates all web app states. Model has a two data exchange with external
data.
OBJECT-ORIENTED ARCHITECTURE
• In an object oriented architecture, the functionality is broken down into sub
systems using the constructs of object oriented data models such as object
classes, attributes and operations.
• It is a modular decomposition architectural style which is applied at application
design level.
• This architecture is based on breaking the responsibilities of an application into
separate reusable independent objects.
• Data and methods, i.e., structure and behaviour both are kept in the object.
This kind of style views the system as a collection of cooperating objects
instead of set of sub programs or procedures.
• Objects are solid, independent and loosely coupled. Interfaces or messages are
used by the objects to communicate with each other.
OBJECT-ORIENTED ARCHITECTURE
• In this diagram, an actor connects to a security logon and requests logon and
enters name password on logon. The security logon has an internal loop that
relays: display, display message, and display logon. If the security logon is valid,
the actor accesses the account data base. After selecting the user type the
actor accessed the system.
INTER ORGANIZATIONAL COMMUNICATION
• Some time organizations follow distributed architecture or they need to talk to
each other to get specialized services from other organizations.
• It then interacts with its port on the web site called as endpoint on behalf of
Service consumer application acting as proxy for Service Provider.
• So all service consumers only talk to single point of contact, i.e., enterprise
service bus.
• Loose coupling of services: Services interact with each other through well
defined interfaces so their maintenance is easy as it does not impact
application.
• Services share schema and binding agreement, not class: Schema and binding
agreement are used to share information with service consumers allowing
them to use services it is a better way of sharing compared to sharing internal
details of classes.
• Easy of Testing: Loose coupling and cohesion are the cornerstone of domain
modelling, which make this style easy to test the application.
• Extensible: As this style is based upon object oriented design, which in turn
supports the principles of inheritance so it implies that this style is extensible.
CLOUD COMPUTING ARCHITECTURE STYLE
• Cloud computing is defined as delivering compute power as service instead of
a product to the customers. Thus shared resources such as storage box,
software and information are provided to customers as utility like water or
phone connection over an internet. The customers pay for resources as per
usage.
• It supports multi tenancy architecture whereby it enables sharing of resources
and costs across a large number of users by centralizing infrastructure at those
locations which has lower costs of land, electricity, labour. It also enables
better utilization and efficiency of system resources which are not utilized fully.
• Platform as a Service: Besides, building the pool of Infrastructure, the cloud providers
are expected to install both open source and proprietary Web Servers, Application
Servers, Databases and tools so that a technology agnostic development platform
becomes available for application development. The development platform should be
available in an on-demand provision mode to the customer organizations.
• Software as a Service: The cloud Providers, install on the Infrastructure pool, some
commonly used finished products both COTS and be spoke applications such e-mail,
Customer Relationship Module (CRM)MS office, Star Office. It also includes other
customized applications which the organization is developing for sharing with others
such as HR, Payroll, Accounting, etc. on pay as per usage pattern.
GRID COMPUTING AND CLOUD COMPUTING
• Grid Computing is an aggregation, selection and sharing of geographically
distributed resources such as computers, storage, data sources and specialized
devices owned by different organizations for solving resource intensive specific
engineering and science problems.
• The operating system which runs inside the virtual machine is called as Guest
Operating System.
GRID COMPUTING AND CLOUD COMPUTING
• Hypervisor is positioned between the guest operating system running in the
virtual machine and hardware resources.
• This positioning enables the hypervisor to control how guest operating system
running inside a virtual machine uses hardware resources.
• The elements in the design range from concrete to abstract with concrete at
the top. The elements from concrete to abstract are: Surface, skeleton,
structure, scope, and strategy. The surface constitutes the visual design. The
skeleton is consists of interface design, navigation design and information
design. The structure consists of interaction design and information
architecture. Scope consists of functional specifications, and content
requirements. The strategy consists of user needs and business goals.
INFORMATION ARCHITECTURE
• Information architecture structures lead organization, labeling, navigation, and
searching of content objects.
• Accessibility is the degree to which people with special needs are provided
with a means to perceive, understand, navigate, and interact with computer
products.
• With it, a product draws its users into a world that embraces them on an
emotional as well as an intellectual level.
• Graphic design considers every aspect of the look and feel of a web or mobile
app.
• Not every software engineer has artistic talent. If you fall into this category,
hire an experienced graphic designer to help.
GOLDEN RULE 1: PLACE USER IN CONTROL
• Define interaction modes in a way that does not force a user into unnecessary
or undesired actions.
• If past interactive models have created user expectations, do not make changes
unless there is a compelling reason to do so.
USER INTERFACE DESIGN MODELS
• User model — a profile of all end users of the system.
• Mental model (system perception) — the user’s mental image of what the
interface is.
• Interface design defines a set of interface objects and actions that enable a user
to perform all defined tasks in a manner that meets every usability goal defined
for the system.
The material for the presentation has been compiled from various sources such
as prescribed text books by Roger S pressman and Ian Sommerville and other
tutorials and lecture notes. The information contained in this lecture/
presentation is for educational purpose only.
113
THANK YOU FOR YOUR ATTENTION !
114