Unit1 SW
Unit1 SW
1
Overview
2
Software reuse
3
Reuse-based software engineering
✧ System reuse
▪ Complete systems, which may include several application
programs may be reused.
✧ Application reuse
▪ An application may be reused either by incorporating it without
change into other or by developing application families.
✧ Component reuse
▪ Components of an application from sub-systems to single objects
may be reused.
✧ Object and function reuse
▪ Small-scale software components that implement a single well-
defined object or function may be reused.
Benefit Explanation
Accelerated development Bringing a system to market as early as possible is
often more important than overall development costs.
Reusing software can speed up system production
because both development and validation time may be
reduced.
Effective use of specialists Instead of doing the same work over and over again,
application specialists can develop reusable software
that encapsulates their knowledge.
Increased dependability Reused software, which has been tried and tested in
working systems, should be more dependable than
new software. Its design and implementation faults
should have been found and fixed.
Benefit Explanation
Lower development costs Development costs are proportional to the size of the
software being developed. Reusing software means that
fewer lines of code have to be written.
Reduced process risk The cost of existing software is already known, whereas
the costs of development are always a matter of
judgment. This is an important factor for project
management because it reduces the margin of error in
project cost estimation. This is particularly true when
relatively large software components such as
subsystems are reused.
Standards compliance Some standards, such as user interface standards, can
be implemented as a set of reusable components. For
example, if menus in a user interface are implemented
using reusable components, all applications present the
same menu formats to users. The use of standard user
interfaces improves dependability because users make
17/11/2014 fewer Chapter
mistakes whenreuse
15 Software presented with a familiar interface. 6
Problems with reuse
Problem Explanation
Creating, maintaining, Populating a reusable component library and ensuring the
and using a component software developers can use this library can be expensive.
library Development processes have to be adapted to ensure that
the library is used.
Finding, understanding, Software components have to be discovered in a library,
and adapting reusable understood and, sometimes, adapted to work in a new
components environment. Engineers must be reasonably confident of
finding a component in the library before they include a
component search as part of their normal development
process.
Increased maintenance If the source code of a reused software system or
costs component is not available then maintenance costs may be
higher because the reused elements of the system may
become increasingly incompatible with system changes.
Problem Explanation
Lack of tool support Some software tools do not support development with
reuse. It may be difficult or impossible to integrate these
tools with a component library system. The software
process assumed by these tools may not take reuse into
account. This is particularly true for tools that support
embedded systems engineering, less so for object-
oriented development tools.
Not-invented-here Some software engineers prefer to rewrite components
syndrome because they believe they can improve on them. This is
partly to do with trust and partly to do with the fact that
writing original software is seen as more challenging than
reusing other people’s software.
18
CBSE
19
Continued…
20
Continued…
21
CBSE Essentials
23
CBSE are sound design principles that support the
construction of understandable and maintainable
software:
24
Several different protocols and standards have been developed to
support this view of a component, such as Sun’s Enterprise Java Beans
(EJB), Microsoft’s COM and .NET, and CORBA’s CCM.
25
Components and component models
27
A useful way of thinking about a component is as a
provider of one or more services. When a system needs a
service, it calls on a component to provide that service
without caring about where that component is executing or
the programming language used to develop the
component.
For example, a component in a library system might
provide a search service that allows users to search
different library catalogs.
A component that converts from one graphical format to
another (e.g., TIFF to JPEG) provides a data conversion
service, etc.
28
Component interfaces
29
The ‘requires’ interface specifies what services must be provided by
other components in the system if a component is to operate correctly.
If these are not available, then the component will not work.
This does not compromise the independence or deployability of a
component because the ‘requires’ interface does not define how these
services should be provided.
In the UML, the symbol for a ‘requires’ interface is a semicircle at the
end of a line from the component icon.
30
Component interface
31
A model of a data collector component
32
Explanation
34
Diagram
35
Explanation
36
3. Component certification is the process of checking a
component and certifying that it meets its specification.
4. Components maintained by an organization may be stored
in a component repository that includes both the
components and information about their use.
37
Two types of CBSE processes:
38
Development for Reuse
40
Advantages
41
Development with Reuse
43
CBSE for reuse
44
CBSE for reuse
45
CBSE with reuse
46
Explanation
48
Component composition
49
Glue code
50
Examples of Glue code
Middleware: Code that translates between APIs or wraps third-party libraries to integrate
them into a system.
● Example: A Python script that converts data from a REST API into a format usable
by a database system.
Adapters: Code that conforms one interface to another.
● Example: In Java, an adapter class wrapping a legacy service so it can be used in a
new microservices application.
Wrappers: Encapsulation of libraries or APIs to make them compatible with the host
system.
● Example: A wrapper function in JavaScript to make a third-party library fit with the
application's asynchronous workflow.
Event Handling: Code that listens for events from one component and triggers
appropriate actions in another.
● Example: Glue code in an event-driven architecture, where a message from Kafka is
consumed and forwarded to a processing component.
51
Types of Component Composition
1. Sequential Composition
○ In this method, components are composed in a sequence, where the
output of one component is the input to the next.
○ Common in workflows or data processing pipelines.
○ Example: A data processing system where a data validation
component feeds into a data transformation component, which then
passes data to a reporting component.
52
2. Hierarchical Composition
53
3. Additive Composition
● Combines components by adding their functionalities together to
extend system capabilities.
● Often used in systems requiring feature aggregation.
● Example: Adding authentication and logging components to a core
application to enhance its functionality.
54
Distributed software engineering
55
Key Features of Distributed Systems
1. Decentralization:
○ The system does not rely on a single central server. Instead, tasks are distributed across
multiple nodes.
2. Concurrency:
○ Multiple processes run concurrently on different nodes, collaborating to achieve the
desired functionality.
3. Transparency:
○ The system hides the complexity from the user, making it appear as a single system.
○ Types of transparency include location, access, replication, concurrency, and failure
transparency.
4. Scalability:
○ These systems can handle growth by adding more nodes without significant changes to
the system architecture.
5. Fault Tolerance:
○ Distributed systems can continue functioning even if some nodes fail, making them
reliable.
6. Communication:
○ Nodes communicate through a network using standard protocols like TCP/IP or 56
Examples of Distributed System & Advantages
Advantages
58
Advantages of using a distributed approach to systems
development(Continued…)
5. Fault tolerance The availability of several computers and the potential for
replicating information means that distributed systems can be tolerant of some
hardware and software failures (see Chapter 13). In most distributed systems,
a degraded service can be provided when failures occur; complete loss of
service only occurs when there is a network failure
59
Challenges & Common application
Challenges:
Common Applications:
61
The types of attacks that a distributed system must defend
itself against are the following:
63
Models of Interaction
64
Models of Interaction
○ Procedural Interaction:
One system requests a service from another, waits for a response, and
proceeds step-by-step.
■ Example: A client making a request to a server and waiting for the result.
○ Message-Based Interaction:
One system sends a message to another with all necessary details, and the
receiver processes it independently.
■ Example: Sending an email or a queued task in a distributed system.
Context:
Models of interaction are critical in distributed computing, software design, and human-
computer interaction (HCI). They shape how systems are designed to handle
communication and processing.
65
Example in Real Life: Restaurant Order
● Procedural Interaction:
○ A diner interacts with a waiter to place an order.
○ The conversation proceeds step-by-step: the waiter asks questions,
and the diner responds (e.g., "What would you like to eat?").
● Message-Based Interaction:
○ After taking the orders from all diners, the waiter sends the entire
order to the kitchen at once.
66
Models of Interaction
1. Procedural Interaction
○ Definition: One computer calls a known service from another
computer and typically waits for the result (synchronous interaction).
○ Example:
■ Scenario: Ordering food from a waiter.
■ Interaction:
■ Diner: What would you like?
■ Customer: Tomato soup, please.
■ Waiter: Acknowledged.
■ Customer: Fillet steak cooked rare with salad.
■ Waiter: Noted.
■ Analogy in Computing:
■ A software component calls a method in another component,
waits for the response, and proceeds step by step.
67
Example : Procedural interaction between a diner
and a waiter
70
Explanation
71
Middleware
72
Middleware in a distributed system(Diagram)
73
which shows that middleware is a layer between the
operating system and application programs. Middleware is
normally implemented as a set of libraries, which are
installed on each distributed computer, plus a run-time
system to manage communications.
74
In a distributed system, middleware normally
provides two distinct types of support:
77
Explanation
For example, on your PC, you may run a mail client that
downloads mail from a remote mail server. You may also
run a web browser that interacts with a remote web server
and a print client that sends documents to a remote printer.
78
Mapping of clients and servers to networked
computers(Diagram)
79
Explanation
80
Layered architectural model for client–server
application
81
Explanation
83
4. Distributed component architecture, which is used when
resources from differ ent systems and databases need to be
combined, or as an implementation model for multi-tier client–
server systems.
5. Peer-to-peer architecture, which is used when clients
exchange locally stored information and the role of the server
is to introduce clients to each other. It may also be used when
a large number of independent computations may have to be
made.
84
A traffic management system with a master-slave
architecture(Example)
85
Explanation
89
Explanation
Thin-Client Model:
● The presentation layer is implemented on the client device.
● All other layers (data management, application processing,
and database) are implemented on the server.
● Client Software:
○ May be a custom-written program.
○ Commonly, a web browser is used for data presentation.
Fat-Client Model:
● Some or all application processing occurs on the client
device.
● Data management and database functions are handled by
the server.
90
Thin-Client Model Advantages & Disadvantages
Advantages:
● Ease of Management: Simple to manage clients, even with a large
number of them.
● No Software Installation: No need to install software if a web
browser is used as the client.
Disadvantages:
● Server Load: Places a heavy processing load on the server.
● Network Traffic: Generates significant network traffic between the
client and server.
● Infrastructure Costs: May require additional investment in network
and server capacity.
● Limited Local Processing: Although browsers can execute scripts
(e.g., JavaScript), they still rely heavily on the server for
91
computations.
Fat-Client Model Advantages & Disadvantages
Fat-Client Model
● Advantages:
○ Efficient Use of Client Resources: Utilizes the processing
power of client computers.
○ Distributed Processing: Distributes application processing
and presentation to the client.
○ Simplified Server Role: Server functions mainly as a
transaction server managing database transactions.
○ Straightforward Data Management: No need to manage
interactions between the client and application processing
system.
● Disadvantages:
○ System Management Complexity: Requires additional effort
92
to deploy and maintain software on client computers.
A fat-client architecture for an ATM system
93
Situation Where Fat-Client Architecture is
Used:Bank ATM System
Definition:
● A multi-tier client-server architecture divides different layers of the
system into separate processes.
● These layers may execute on different processors.
Key Layers in Multi-Tier Architecture:
1. Presentation Layer: Managed by the client (e.g., user's Internet
browser).
2. Data Management Layer: Managed by web servers for data
handling and web page generation.
3. Application Processing Layer: Handles logic like transferring
cash, generating statements, paying bills, etc.
4. Database Layer: Managed by a database server (often hosted on
a mainframe). 96
Example:Three-tier architecture for an Internet
banking system
Three-Tier Model:
○ Customer Database: Hosted on a mainframe to store
customer account information.
○ Web Server: Manages data management and application
services like generating web pages and executing customer
actions.
○ Client (User's Internet Browser): Acts as the front end for
users to interact with the system.
98
Advantages of the Three-Tier Model:
99
Extensions to Multi-Tier Architecture
Multi-Tier Variants:
○ Additional servers can be added to separate data
management, application processing, and database
functions further.
○ Integration Servers: Used to combine data from multiple
distributed databases into a unified view for application
servers.
■ Ensures seamless data access across systems by
aggregating data and presenting it as a single database.
● Distributed Component Architectures:
○ Implement multi-tier systems with distributed services.
100
Key Considerations for Designers:
101
Use of client–server architectural patterns
102
Service -oriented Architecture
Definition:
Service-Oriented Architecture (SOA) is a design pattern used to create distributed systems that provide services to applications or
other services through standard protocols. It is an architectural approach, not tied to any specific programming language or
platform.
103
Key features of SOA
1. Loosely Coupled:
○ Services interact with minimal dependencies, making them flexible and reusable.
2. Message-Based Communication:
○ Communication between services is typically done using standard message formats like XML or JSON over
protocols like HTTP, SOAP, or REST.
3. Interoperability:
○ Services can interact regardless of the underlying technology stack, enabling cross-platform integration.
4. Reusability:
○ Services are designed to be reusable across different applications.
5. Abstraction:
○ Service details are hidden from the consumer, who only interacts through a defined interface.
6. Scalability:
○ SOA systems can scale horizontally by adding more service instances.
7. Discoverability:
○ Services are registered in a directory and can be discovered by consumers dynamically.
104
What is Service?
What is a Service?
Example Services:
● Authentication Service
● Payment Processing Service
● Weather Forecasting Service
105
Service connection
The figure given below illustrates the service-oriented architecture. Service consumer sends a service request
to the service provider, and the service provider sends the service response to the service consumer. The
service connection is understandable to both the service consumer and service provider.
106
Service oriented Terminologies
Service-Oriented Terminologies
107
Explanation
○ Services - The services are the logical entities defined by one or more published interfaces.
○ Service provider - It is a software entity that implements a service specification.
○ Service consumer - It can be called as a requestor or client that calls a service provider. A service
consumer can be another service or an end-user application.
○ Service locator - It is a service provider that acts as a registry. It is responsible for examining service
provider interfaces and service locations.
○ Service broker - It is a service provider that pass service requests to one or more additional service
providers.
108
Components of SOA
The service-oriented architecture stack can be categorized into two parts - functional aspects and quality of
service aspects.
109
Explanation
○ Transport - It transports the service requests from the service consumer to the service provider
and service responses from the service provider to the service consumer.
○ Service Communication Protocol - It allows the service provider and the service consumer to
communicate with each other.
○ Service Description - It describes the service and data required to invoke it.
○ Service - It is an actual service.
○ Business Process - It represents the group of services called in a particular sequence associated
with the particular rules to meet the business requirements.
○ Service Registry - It contains the description of data which is used by service providers to publish
their services.
110
Quality of Service Aspects
○ Policy - It represents the set of protocols according to which a service provider make and provide
the services to consumers.
○ Security - It represents the set of protocols required for identification and authorization.
○ Transaction - It provides the surety of consistent result. This means, if we use the group of services
to complete a business function, either all must complete or none of the complete.
○ Management - It defines the set of attributes used to manage the services.
111