Object-Oriented Software Engineering Practical Software Development using UML and Java Chapter 3: Basing Software Development on Reusable Technology.

Slides:



Advertisements
Similar presentations
Executional Architecture
Advertisements

Fundamentals of Information Systems, Second Edition 1 Telecommunications, the Internet, Intranets, and Extranets Chapter 4.
9.5 Software Architecture
Computer Monitoring System for EE Faculty By Yaroslav Ross And Denis Zakrevsky Supervisor: Viktor Kulikov.
Real-Time Authentication Using Digital Signature Schema Marissa Hollingsworth BOISECRYPT ‘09.
Object-Oriented Software Engineering Practical Software Development using UML and Java Chapter 3: Basing Software Development on Reusable Technology.
Introduction To System Analysis and Design
CSE 240 Lecture 8. © Lethbridge/Laganière 2001 Chapter 5: Modelling with classes2 Overview Begin discussing Chapter 3 - Reuse.
Basic Socket Programming with Java. What is a socket?  Generally refers to a stream connecting processes running in different address spaces (across.
Software Reuse, Frameworks, and Client-server Systems September 8, 2005 Motivation for Software Reuse Frameworks Definition Object Oriented Model Client-server.
Socket Programming.
A CHAT CLIENT-SERVER MODULE IN JAVA BY MAHTAB M HUSSAIN MAYANK MOHAN ISE 582 FALL 2003 PROJECT.
1 Java Networking – Part I CS , Spring 2008/9.
1 L53 Networking (2). 2 OBJECTIVES In this chapter you will learn:  To understand Java networking with URLs, sockets and datagrams.  To implement Java.
McGraw-Hill©The McGraw-Hill Companies, Inc., 2004 Application Layer PART VI.
Liang, Introduction to Java Programming, Sixth Edition, (c) 2007 Pearson Education, Inc. All rights reserved L22 (Chapter 25) Networking.
© Lethbridge/Laganière 2001 Chap. 3: Basing Development on Reusable Technology 1 Let’s get started. Let’s start by selecting an architecture from among.
Liang, Introduction to Java Programming, Sixth Edition, (c) 2007 Pearson Education, Inc. All rights reserved Chapter 25 Networking.
Systems Architecture, Fourth Edition1 Internet and Distributed Application Services Chapter 13.
Object-Oriented Software Engineering Practical Software Development using UML and Java Chapter 3: Basing Software Development on Reusable Technology.
1 First app – simplechat1 Reminder: what’s the point?  To build on ocsf framework.  Simple requirements: echo all messages to all clients.  Use only.
Fundamentals of Python: From First Programs Through Data Structures
Lecture slides prepared for “Business Data Communications”, 7/e, by William Stallings and Tom Case, Chapter 8 “TCP/IP”.
INTRODUCTION TO WEB DATABASE PROGRAMMING
Software Engineering Muhammad Fahad Khan
©Ian Sommerville 2004Software Engineering, 7th edition. Chapter 18 Slide 1 Software Reuse.
The Little Caesars Cory, Sean, Seth, James, Madison.
Guide to TCP/IP, Second Edition1 Guide To TCP/IP, Second Edition Chapter 6 Basic TCP/IP Services.
TCP/IP protocols Communication over Internet is mostly TCP/IP (Transmission Control Protocol over Internet Protocol) TCP/IP "stack" is software which allows.
Taken from Chapter 3 of Object-Oriented Software Engineering: Practical Software Development using UML and Java by T. Lethbridge and R. Laganiere Basing.
Internet Software Development Lecture 14: Basing Software Development on Reusable Technology From: Object-Oriented Software Engineering, by Lethbridge.
Introduction to distributed systems Dr. S. Indran 23 January 2004.
Understanding the CORBA Model. What is CORBA?  The Common Object Request Broker Architecture (CORBA) allows distributed applications to interoperate.
Remote Access Chapter 4. Learning Objectives Understand implications of IEEE 802.1x and how it is used Understand VPN technology and its uses for securing.
Remote Access Chapter 4. Learning Objectives Understand implications of IEEE 802.1x and how it is used Understand VPN technology and its uses for securing.
An Introduction to Software Architecture
9.4 Software Architecture
Introduction to Interprocess communication SE-2811 Dr. Mark L. Hornick 1.
Jozef Goetz, Application Layer PART VI Jozef Goetz, Position of application layer The application layer enables the user, whether human.
Introduction To System Analysis and Design
Object-Oriented Software Engineering Practical Software Development using UML and Java Chapter 1: Software and Software Engineering.
How computer’s are linked together.
Object-Oriented Software Engineering Practical Software Development using UML and Java Chapter 1: Software and Software Engineering.
Module 1 Object-Oriented Software Engineering. Section 1: Software and Software Engineering.
Object-Oriented Software Engineering Practical Software Development using UML and Java Chapter 3: Basing Software Development on Reusable Technology 1.
Object-Oriented Software Engineering Practical Software Development using UML and Java Chapter 3: Basing Software Development on Reusable Technology.
Software Engineering, Lecture 4 Mohamed Elshaikh.
© Lethbridge/Laganière 2005 Chap. 3: Basing Development on Reusable Technology The Client-Server Architecture A distributed system is a system in.
1 Chapter 28 Networking. 2 Objectives F To comprehend socket-based communication in Java (§28.2). F To understand client/server computing (§28.2). F To.
L 2 - 1 3( 1/ 20) : Java Network Programming. The Socket API The previous contents describe client-server interaction that application programs use when.
9 Systems Analysis and Design in a Changing World, Fourth Edition.
CS 501: Software Engineering Fall 1999 Lecture 12 System Architecture III Distributed Objects.
Object-Oriented Software Engineering Practical Software Development using UML and Java Chapter 3: Basing Software Development on Reusable Technology.
CSI 3125, Preliminaries, page 1 SERVLET. CSI 3125, Preliminaries, page 2 SERVLET A servlet is a server-side software program, written in Java code, that.
Basing software development on Reusable Technology.
UNIT-6. Basics of Networking TCP/IP Sockets Simple Client Server program Multiple clients Sending file from Server to Client Parallel search server.
Java Networking I IS Outline  Quiz #3  Network architecture  Protocols  Sockets  Server Sockets  Multi-threaded Servers.
Subtopics: 1. Frameworks :Reusable systems 2. Design Patterns 1.
Network Programming. These days almost all devices.
Object-Oriented Software Engineering Practical Software Development using UML and Java Chapter 3: Basing Software Development on Reusable Technology.
Liang, Introduction to Java Programming, Ninth Edition, (c) 2013 Pearson Education, Inc. All rights reserved. 1 Chapter 33 Networking.
Module 1 Object-Oriented Software Engineering
MCA – 405 Elective –I (A) Java Programming & Technology
Chapter 1: Software and Software Engineering
Distribution and components
Networks and Client/Server Applications
Chapter 3: Windows7 Part 4.
An Introduction to Software Architecture
Snippet Engine as a Database Server
Module 1 Object-Oriented Software Engineering
Presentation transcript:

Object-Oriented Software Engineering Practical Software Development using UML and Java Chapter 3: Basing Software Development on Reusable Technology

© Lethbridge/Laganière 2005 Chap. 3: Basing Development on Reusable Technology 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

© Lethbridge/Laganière 2005 Chap. 3: Basing Development on Reusable Technology Reusability and Reuse in SE Reuse and design for reusability should be part of the culture of software development organizations But there are problems to overcome: Why take the extra time needed to develop something that will benefit other projects/customers? Management may only reward the efforts of people who create the visible ‘final products’. Reusable software is often created in a hurry and without enough attention to quality.

© Lethbridge/Laganière 2005 Chap. 3: Basing Development on Reusable Technology 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

© Lethbridge/Laganière 2005 Chap. 3: Basing Development on Reusable Technology 5 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

© Lethbridge/Laganière 2005 Chap. 3: Basing Development on Reusable Technology 6 Types of frameworks A horizontal framework provides general application facilities that a large number of applications can use A vertical framework (application framework) is more ‘complete’ but still needs some slots to be filled to adapt it to specific application needs

© Lethbridge/Laganière 2005 Chap. 3: Basing Development on Reusable Technology The Client-Server Architecture 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

© Lethbridge/Laganière 2005 Chap. 3: Basing Development on Reusable Technology 8 A server program communicating with two client programs

© Lethbridge/Laganière 2005 Chap. 3: Basing Development on Reusable Technology 9 Example of client-server systems The World Wide Web Network File System Transaction Processing System Remote Display System Communication System Database System

© Lethbridge/Laganière 2005 Chap. 3: Basing Development on Reusable Technology 10 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 1.Must cleanly terminate

© Lethbridge/Laganière 2005 Chap. 3: Basing Development on Reusable Technology 11 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 1.responds to messages 2.handles server disconnection 5.Must cleanly terminate

© Lethbridge/Laganière 2005 Chap. 3: Basing Development on Reusable Technology Technology Needed to Build Client- Server Systems Internet Protocol (IP) Route messages from one computer to another Long messages are normally split up into small pieces Transmission Control Protocol (TCP) Handles connections between two computers Computers can then exchange many IP messages over a connection Assures that the messages have been satisfactorily received A host has an IP address and a host name Several servers can run on the same host. Each server is identified by a port number (0 to 65535). To initiate communication with a server, a client must know both the host name and the port number

© Lethbridge/Laganière 2005 Chap. 3: Basing Development on Reusable Technology The Client Side Consists of a single class: AbstractClient Must be subclassed —Any subclass must provide an implementation for handleMessageFromServer -Takes appropriate action when a message is received from a server Implements the Runnable interface —Has a run method which -Contains a loop that executes for the lifetime of the thread

© Lethbridge/Laganière 2005 Chap. 3: Basing Development on Reusable Technology 14 Exchanging information in Java Each program uses an instance of — InputStream to receive messages from the other program — OutputStream to send messages to the other program —These are found in package java.io

© Lethbridge/Laganière 2005 Chap. 3: Basing Development on Reusable Technology 15 The callback methods of AbstractClient Methods that may be overridden: connectionEstablished connectionClosed Method that must be implemented: handleMessageFromServer

© Lethbridge/Laganière 2005 Chap. 3: Basing Development on Reusable Technology 16 Using AbstractClient Create a subclass of AbstractClient Implement handleMessageFromServer slot method Write code that: —Creates an instance of the new subclass —Calls openConnection —Sends messages to the server using the sendToServer service method Implement the connectionClosed callback Implement the connectionException callback

© Lethbridge/Laganière 2005 Chap. 3: Basing Development on Reusable Technology 17 Internals of AbstractClient Instance variables: A Socket which keeps all the information about the connection to the server Two streams, an ObjectOutputStream and an ObjectInputStream A Thread that runs using AbstractClient’s run method

© Lethbridge/Laganière 2005 Chap. 3: Basing Development on Reusable Technology The Server Side Two classes: One for the thread which listens for new connections (AbstractServer) One for the threads that handle the connections to clients (ConnectionToClient)

© Lethbridge/Laganière 2005 Chap. 3: Basing Development on Reusable Technology 19 The callback methods of AbstractServer Methods that may be overridden: serverStarted clientConnected clientDisconnected clientException serverStopped listeningException serverClosed Method that must be implemented: handleMessageFromClient

© Lethbridge/Laganière 2005 Chap. 3: Basing Development on Reusable Technology 20 The public interface of ConnectionToClient Controlling methods: sendToClient close Accessing methods: getInetAddress setInfo getInfo

© Lethbridge/Laganière 2005 Chap. 3: Basing Development on Reusable Technology 21 Using AbstractServer and ConnectionToClient Create a subclass of AbstractServer Implement the slot method handleMessageFromClient Write code that: —Creates an instance of the subclass of AbstractServer —Calls the listen method —Sends messages to clients, using: - the getClientConnections and sendToClient service methods -or sendToAllClients Implement one or more of the other callback methods

© Lethbridge/Laganière 2005 Chap. 3: Basing Development on Reusable Technology 22 Internals of AbstractServer and ConnectionToClient The setInfo and getInfo methods make use of a Java class called HashMap Many methods in the server side are synchronized The collection of instances of ConnectionToClient is stored using a special class called ThreadGroup The server must pause from listening every 500ms to see if the stopListening method has been called —if not, then it resumes listening immediately

© Lethbridge/Laganière 2005 Chap. 3: Basing Development on Reusable Technology 23 The server.. EchoServer is a subclass of AbstractServer The main method creates a new instance and starts it —It listens for clients and handles connections until the server is stopped The three callback methods just print out a message to the user — handleMessageFromClient, serverStarted and serverStopped The slot method handleMessageFromClient calls sendToAllClients —This echoes any messages

© Lethbridge/Laganière 2005 Chap. 3: Basing Development on Reusable Technology 24 The client When the client program starts, it creates instances of two classes: ChatClient —A subclass of AbstractClient —Overrides handleMessageFromServer -This calls the display method of the user interface ClientConsole —User interface class that implements the interface ChatIF -Hence implements display which outputs to the console —Accepts user input by calling accept in its run method —Sends all user input to the ChatClient by calling its handleMessageFromClientUI -This, in turn, calls sendToServer

© Lethbridge/Laganière 2005 Chap. 3: Basing Development on Reusable Technology Risks when reusing technology Poor quality reusable components —Ensure that the developers of the reusable technology: -follow good software engineering practices - are willing to provide active support Compatibility not maintained —Avoid obscure features —Only re-use technology that others are also re-using

© Lethbridge/Laganière 2005 Chap. 3: Basing Development on Reusable Technology 26 Risks when adopting a client-server approach Security —Security is a big problem with no perfect solutions: consider the use of encryption, firewalls,... Need for adaptive maintenance —Ensure that all software is forward and backward compatible with other versions of clients and servers

Summary In this chapter we have studied reusable technology, which should be the basis for most software development projects. When we developing the software, you can reuse many kinds of things, ranging from the expertise of people who have worked on past projects up to complete applications. You should also strive to make any thing you develop as reusable as possible. An important types of reuse is reuse of frameworks. Frameworks are software systems that are not immediately usable, but can be quickly extend to build an application or part of an application, by providing essential details that are missing. We studied in depth a client – server framework written in java. © Lethbridge/Laganière 2005 Chap. 3: Basing Development on Reusable Technology 27