Docsity

Object-Oriented Software Engineering: Reusable Technology in Software Development, Slides of Banking and Finance

Partial preview of the text

Download Object-Oriented Software Engineering: Reusable Technology in Software Development and more Slides Banking and Finance in PDF only on Docsity!

Object-Oriented Software Engineering

Practical Software Development using UML and Java

Chapter 3: Basing Software Development on Reusable Technology

3.1 Building on the Experience of Others

Software engineers should avoid re-developing software already developed

Types of reuse:

  • Reuse of expertise
  • Reuse of standard designs and algorithms
  • Reuse of libraries of classes or procedures
  • Reuse of powerful commands built into languages and operating systems
  • Reuse of frameworks
  • Reuse of complete applications

A vicious cycle

Developers tend not develop high quality reusable components, so there is often little to reuse

To solve the problem, recognize that:

  • This vicious cycle costs money
  • Investment in reusable code is important
  • Attention to quality of reusable components is essential —So that potential reusers have confidence in them —The quality of a software product is only as good as its lowest-quality reusable component
  • Developing reusable components can often simplify design

3.3 Frameworks: Reusable Subsystems

A framework is reusable software that implements a generic solution to a generalized problem.

  • It provides common facilities applicable to different application programs.

Principle : Applications that do different, but related, things tend to have quite similar designs

Object-oriented frameworks

In the object oriented paradigm, a framework is composed of a library of classes.

  • The API is defined by the set of all public methods of these classes.
  • Some of the classes will normally be abstract and there are often many Interfaces

Example:

  • A framework for payroll management
  • A framework for frequent buyer clubs
  • A framework for university registration
  • A framework for e-commerce web sites

Frameworks and product lines

  • A product line (or product family) is a set of products built on a common base of technology. —The various products in the product line have different features to satisfy different markets —The software technology common to all products in included in a framework —Each product is produced by filling the available hooks and slots —E.g. software products offering ‘demo’, ‘lite’ or ‘pro’ versions

3.4 The Client-Server Architecture

A distributed system is a system in which:

  • computations are performed by separate programs
  • … normally running on separate pieces of hardware
  • … that co-operate to perform the task of the system. Server:
  • A program that provides a service for other programs that connect to it using a communication channel Client
  • A program that accesses a server (or several servers) to obtain services
  • A server may be accessed by many clients simultaneously

Sequence of activities in a client-server

system

  1. The server starts running
  2. The server waits for clients to connect. ( listening )
  3. Clients start running and perform operations — Some operations involve requests to the server
  4. When a client attempts to connect, the server accepts the connection (if it is willing)
  5. The server waits for messages to arrive from connected clients
  6. When a message from a client arrives, the server takes some action in response, then resumes waiting
  7. Clients and servers continue functioning in this manner until they decide to shut down or disconnect

Alternatives to the client server architecture

  • Have a single program on one computer that does everything
  • Have no communication — Each computer performs the work separately
  • Have some mechanism other than client-server communication for exchanging information —E.g. one program writes to a database; the other reads from the database

Advantages of client-server systems

  • The work can be distributed among different machines
  • The clients can access the server’s functionality from a distance
  • The client and server can be designed separately
  • They can both be simpler
  • All the data can be kept centrally at the server
  • Conversely, data can be distributed among many different geographically-distributed clients or servers
  • The server can be accessed simultaneously by many clients
  • Competing clients can be written to communicate with the same server, and vice-versa

Activities of a server

  1. Initializes itself
  2. Starts listening for clients
  3. Handles the following types of events originating from clients
    1. accepts connections
    2. responds to messages
    3. handles client disconnection
  4. May stop listening
  5. Must cleanly terminate

Activities of a client

  1. Initializes itself
  2. Initiates a connection
  3. Sends messages
  4. Handles the following types of events originating from the server
  5. responds to messages
  6. handles server disconnection
  7. Must cleanly terminate

Thin- versus fat-client systems

Thin-client system (a)

  • Client is made as small as possible
  • Most of the work is done in the server.
  • Client easy to download over the network Fat-client system (b)
  • As much work as possible is delegated to the clients.
  • Server can handle more clients

Communications protocols

  • The messages the client sends to the server form a language. — The server has to be programmed to understand that language.
  • The messages the server sends to the client also form a language. — The client has to be programmed to understand that language.
  • When a client and server are communicating, they are in effect having a conversation using these two languages
  • The two languages and the rules of the conversation, taken together, are called the protocol