Title: Developing%20Object-Oriented%20Systems
1Developing Object-Oriented Systems
2Course Topics
- Introduction to Object-Oriented Analysis and
Design - Object-Oriented Concepts
- Visual Modeling with UML
- Developing Object-Oriented Systems
- Transition from OO models to code
- Distributed architecture
- OO and Persistence
3Moving From OO Design to Code
- The UML is simply a language used for designing
OO systems - Development of an object-oriented software system
also requires tools and a process - Tools IDEs, compilers, test tools,
configuration management, etc. - Process RUP, unified process, waterfall, RAD,
agile, etc.
4Characteristics of OO Systems
- Object-oriented software solutions are
- Use Case driven
- Visually modeled
- Iteratively developed
- Continuously verified
- Reuse focused
- Component based
- Architecture centric
5Unified Process - Reviewed
Phases
Disciplines
Business Modeling Requirements Analysis and
Design Implementation Test Deployment Configuratio
n Management Project Management Environment
Iterations
6Iterative Development
3. Requirements
4. Analysis Design
2. Planning
1. Initial Planning
5. Implementation
Management Environment (on-going)
6. Test
8. Evaluation
7. Deployment
7From Use Cases to Design
- The process starts with Use Cases to
- Capture requirements
- Model the business rules of the system in terms
that all can understand - Describe the system at a very high level
- Plan for development
- Plan for testing
8Realizing Use Cases
9Steps in Realizing the Use Case
- The completed Use Case model includes
- Use Case diagram
- Detailed descriptions
- Activity diagrams to model the descriptions
10Steps in Realizing the Use Case (Cont)
- From completed Use Cases, the next steps are
- Generate a conceptual class diagram for the
classes in the use case - Generate high-level interaction diagrams
(communication diagrams?) - Generate state machine diagrams as needed
- Refine interaction diagrams (sequence diagrams?)
with fully specified methods - Refine and fully specify the class diagram based
on the preceding diagrams - Develop code from fully specified classes
- Test unit, integration, sub-system, etc.
11Class Design Considerations
- Look at each class and define
- Methods
- Found in sequence diagrams and state machine
diagrams - Consider object construction and destruction
- Data
- Found in state machine diagrams
- Inferred from roles designated in class diagram
- Specify type and meaningful name
- Be sure to specify access levels correctly
public and private - Look for reuse through inheritance
- Consider opportunities to exploit polymorphism
12A Fully Defined Class ?
- Details of the class begin to take shape as we
search other diagrams for content
Access Symbols private public
protected package
13Converting from Traditional Languages
- Problem developing in a pure object-oriented
language like Java requires a developer to think
about application logic in very abstract ways - Remember that objects are created to accept
messages and exist in an event-driven environment - Efficient development in Java requires
partitioning application logic GUI design,
remote data access and execution mechanisms,
network features, OS specific features, etc. - The developer has to learn to deal with
client-server architecture also
14Distributed Processing
- Distributed processing Computer processing in
which different parts of a program run
simultaneously on two or more computers
communicating over a network - Versions
- File Server
- Early implementations
- Supports the distribution of data only
- Client / Server
- More versatile and commonly used today
- Supports the distribution of both data and
processing
15Distributed Processing - File Server
- Client
- Process/scan tables
- Application programs
- user interface
- database processing
- generate queries
- Handle integrity and security
- Full DBMS
- Entire file is transferred
Client request for data Server entire file
transferred
- File Server
- File storage
- Record locking
- Significant LAN traffic
16Distributed Processing Client/Server
- Typically client is smaller PC and server is
larger processor - Application software divided (not equally)
between client and server - Client typically manages user interface
- Server typically responsible for database storage
and access, including query processing
Client request for data
Only result of request
Client
Server
17Variations of Client / Server Architecture
- Four flavors of client / server architecture
- Thick client much application processing in the
client server acts more as a database server - Three tier normal client, business object
server, database server - Thin client client handles most of the
presentation logic, all other processing done in
server - Peer-to-peer any process node can be both
client and server
18Three-Tier Client / Server Architecture
- Logical partitions may be more than three
physical nodes - Provides a pattern for scalability by adding
servers and rebalancing processing across data
and business servers
19Components
- Components self-contained elements of software
that can be controlled dynamically and assembled
to form reusable applications - Another exploitation of the OO principle of
encapsulation - Will typically have a controlled, well-defined
interface and will support polymorphic behavior - Can be used in an application without
modification and are used independently of the
context in which their services are requested
20Component Technology Examples
- Common Object Model (COM)
- Microsoft standard for component architecture
- ActiveX - technology used for developing reusable
object oriented software components - Somewhat replaced by the .NET capabilities
- JavaBeans
- Reusable Java components
- Generally deal with visual capabilities screen
controls
21Distributed Components
- For components to be completely reusable and
plug-able, they must have a standardized
interface which allows for - Components developed in different programming
languages - To communicate seamlessly over different
networks - To be executed on different platforms
- The interface must allow for execution of an
object on a host machine by an object on a
connected machine as if they were in the same
machine - There are many products and technologies that
support this standard called Object Request
Brokers (ORBs)
22Object Request Brokers
- ORB A mechanism for invoking operations on an
object in a different process that may be running
on the same or a different computer - At a programming level, these remote calls look
similar to local calls - Sometimes referred to as middleware allowing
stand-alone applications to communicate with each
other - A few middleware implementations
- CORBA The open-source daddy of all ORBs
- SOAP Simple Object Access Protocol
- RMI Javas Remote Method Invocation
- COM and .NET Microsoft
- MQSeries IBM
23Generic ORB Architecture
- Brokers are message-passing media which keep
track of the client/server objects they manage - Proxies implement the same interface as the
client/server objects the Client calls the
server Proxy, and the Server returns information
to the Client Proxy
24CORBA
- CORBA Common Object Request Broker Architecture
- Managed and controlled by the OMG
- Specifies a set of services for object creation,
deletion, access, persistence, defining external
relationships, etc. - Some vendor products that provide these services
- Orbix (Iona) an enterprise CORBA implementation
product - VisiBroker (Borland) a CORBA infrastructure
product - ObjectBroker (BEA Systems) a CORBA compliant
production tool - CORBA objects are
- Implemented as an instance of an interface type
- Written in the Interface Definition Language
(IDL) - C like data declarative language (no control
statements) - Creates a binary form of the object
25CORBA Architecture
- The ORB transmits method calls from Client to
Server, and back to Client
26Remote Method Invocation - Java
- RMI is Javas built-in middleware technology
- Works for java built objects only not supported
by Microsoft - In RMI the client proxy is called a stub and the
server proxy is called a skeleton
27More on RMI
- Java has a special tool called remote method
invocation compiler (rmic ) that produces the
stub and skeleton for the remote call - Information about available remote methods is
kept in the RMI registry this is where the
stub will look up the location of the method to
be called - Another tool called rmiregistry should be run at
the time of execution to establish the registry - Because the method call uses the network, the
client code must provide for possible network or
I/O exceptions
28Simple Object Access Protocol - SOAP
- SOAP stands for Simple Object Access Protocol
- SOAP is a communication protocol between remote
applications sending messages via the internet - SOAP is based on XML and is platform independent
and language independent - SOAP is simple and extensible
- SOAP allows you to get around firewalls
29More on SOAP
- SOAP uses the Internet application layer protocol
(HTTP) as its transport protocol - Because SOAP uses XML as its language, it is
extensible users can create their own tags - SOAP is a key element of Microsoft's .NET
architecture for internet application
development. - SOAP has been developed as a W3C standard
- W3C a consortium of companies setting standards
for web behavior
30OO and Persistence
- Persistence is simply the concept of saving and
restoring data from a program to and from a data
base - In OO systems this involves saving and restoring
complex objects - Remember, just the data or state of the object
must be saved and restored - The most common data base management systems in
use today are relational (RDBMS) like Oracle,
Informix, DB2, etc.
31Difficulties In OO Persistence
- There are difficulties with persistence and
complex objects - If the to-be-saved/restored object has aggregated
objects, they must be saved and restored also - If the object involves inheritance, both child
and parent data parts must be saved and restored - Storing and retrieving complex objects using a
RDBMS poses a problem of - Flattening out the object for writing to the
data base called serialization - Re-inflating the object when read back into
your OO program called deserialization - Moving the data back and forth (in serialized
format) is called marshalling
32OODBMS
- OODBMS Object-Oriented Data Base Management
System Combines object-oriented programming
principles with database management principles - Stores objects in a format nearly
indistinguishable from the objects supported by
the target programming language accommodates
aggregation and inheritance - Industry tends to lean away from OODBMS and use
RDBMS with some form of transformation capability
to deal with complex objects
33Moving OO Data To/Form an RDBMS
- A solution
- Identify classes that have persistent objects and
add load() and store() methods to each class to
handle formatting, writing and reading directly
to the database - This presents a tight coupling problem
- A better solution
- Create an abstraction layer that has classes that
deal with objects and the database - Create a special class for each persistent class
a Data Manager (DM) class - Knows how to pack/unpack an object for an SQL
statement - Create a special class for dealing with the
database directly a DBServer class - Handles connectivity
- Generates and issues SQL commands
34OO Data To/From a RDBMS
Tightly Coupled
- Problems with the tightly coupled version
- Changing the DB vendor becomes a nightmare
- Lots of extra processing in each problem domain
class that must be saved
Layered
Problem Domain
Data Management Domain
CourseOffering
35Review
- What are the three components of software design?
- Name four of the seven characteristics of OO
systems. - What is distributed processing? Why is it so
popular? - What is a component?
- What are Object Request Brokers?
- What is the Java ORB or middleware technology
called? How does it work? - What are the problems with reading and writing a
complex object to a relational data base?
36Any Questions?