More Related Content Similar to Analysis & Design Method for OSGi-based Development (20) More from Linuxmalaysia Malaysia (20) Analysis & Design Method for OSGi-based Development1. Analysis and Design
Method for OSGi-based
Development
Azrinsyah Mirza Asfian,
Engineer at MIMOS Berhad
azrinsyah.asfian@mimos.my
www.mimos.my Β© 2008 MIMOS Berhad. All Rights Reserved.
2. Agenda
β’ Introduction
β’ Service-Oriented Programming and OSGi
β’ Object-Oriented Analysis and Design Method
β’ The Proposed Method
β Analysis and Design Method
β Example
β Applying the Analysis and Design Method to the Case Study
β’ Conclusions and Discussions
www.mimos.my Β© 2008 MIMOS Berhad. All Rights Reserved.
3. Introduction
β’ OSGi
β Open Services Gateway Initiative
β technology defined and promoted by the OSGi Alliance
β open specifications for network delivery of managed services to
local networks and devices.
β’ Service-orientation and component-orientation
β requirements of having a new analysis and design approach
β existing OOAD methodologies e.g. Booch, OMT and UML could
not be applied directly
β’ Proposes an analysis and design method for OSGi-based
development
www.mimos.my Β© 2008 MIMOS Berhad. All Rights Reserved.
4. Service-Oriented Programming
β’ Utilizes services as fundamental elements
β’ In OO, objects are building blocks while in SO, services
are its foundation blocks
β’ A service embedded in some component
β accepts one or more requests and returns one or more
responses
β’ Different from traditional methods, e.g. OO or structural
β’ Remarkable traits
β Dynamism
β Substitutability
β’ Discover and substitute at run-time
β’ Focuses on how services are described and organized of
appropriate services at run-time
www.mimos.my Β© 2008 MIMOS Berhad. All Rights Reserved.
6. Service-Oriented Programming (cont.)
β’ OOP
β problems can be modeled in terms of objects in the problem
domain
β’ SOP
β problems can be modeled in terms of services which can be
implemented and provided by any other components, based
solely on the contract
β’ SOA
β can discover, substitute and co-ordinate service
implementations at run-time
β because components publish and use services in a P2P manner
www.mimos.my Β© 2008 MIMOS Berhad. All Rights Reserved.
7. Contributions of Service-Oriented
Programming
β’ Fosters code reuse
β’ Rapid and dynamic system construction
β’ System upgrade without restarting and
β’ Independence from platforms, protocols and
deployment environments
www.mimos.my Β© 2008 MIMOS Berhad. All Rights Reserved.
8. OSGi Concepts
β’ Follows concept of SOP
β’ OSGi spec defines the service framework
β minimal component model
β management service for the components
β service registry
β Initially used for service gateways
β now, mainstream software devt e.g. Eclipse subproject called
Equinox
β’ Services (i.e., Java interfaces)
β packaged along with implementations and associated resources
into bundles
β conforms to SO interaction pattern
β deployed into the OSGi framework via WANs i.e., the Internet or
other means e.g. GSM or memory cards.
Β© 2008 MIMOS Berhad. All Rights Reserved.
9. OSGi Concepts
β’ Bundle is a Java JAR file that contains
β physical unit of deployment
β can be modified and updated without requiring system to be
restarted
β some combination of Java class files
β native code
β associated resources
β manifest - meta-data describing, Java packages that the bundle
requires or provides
β’ Other competing SO architectures are NetBeans module
and Java Plugin Framework
www.mimos.my Β© 2008 MIMOS Berhad. All Rights Reserved.
10. General Object-Oriented Analysis and
Design (OOAD) Method
β’ Steps available in both Booch and OMT:
1. Develop a problem statement
2. Identify the classes and objects
3. Identify the semantics (or attributes) of these classes and
objects
4. Identify the relationships among these classes and objects
5. Specify the interface and then the implementation of these
classes and objects
www.mimos.my Β© 2008 MIMOS Berhad. All Rights Reserved.
11. The Proposed Method
β’ An improvement over existing OOAD methods.
β’ Additional steps added:
β Extract or reuse existing OSGi services and components (or
bundles) based on their versions
β Determine dependencies between services
β Depict dynamic view of the system using service dependencies
diagram
www.mimos.my Β© 2008 MIMOS Berhad. All Rights Reserved.
12. Analysis and Design Method
β’ The resulting steps:
1. Develop a problem statement
2. Identify the services based on their intended responsibilities
3. Identify relationships between services during runtime.
4. Identify bundles that encapsulate a service (or services)
5. Identify classes and objects that make up a particular service
and bundle
6. Identify the semantics (or attributes) of these classes and
objects
7. Identify the relationships among these classes and objects
8. Specify the interface and then the implementation of these
classes and objects
www.mimos.my Β© 2008 MIMOS Berhad. All Rights Reserved.
13. Example
β’ Illustrate how to translate software requirements into
design using OSGi
β’ The requirements associated with this software:
β System must be able to display all users available
β When a user is selected, system must open a screen that
displays details of the user.
β All user information must be stored inside a centralized
database.
β System resides on a client computer which is remote from
server that stores all the user information.
www.mimos.my Β© 2008 MIMOS Berhad. All Rights Reserved.
14. Applying the Analysis and Design Method β
Overall System Architectural Diagram
www.mimos.my Β© 2008 MIMOS Berhad. All Rights Reserved.
15. Applying the Analysis and Design Method β
Step 2
β’ Step 2 of the method is applied to the requirement
specifications
β’ Services identified:
β Profile Persistence Service: Responsible in making used of Java
persistence classes to perform Read operation on profile of
users residing in centralized database
β User Detail Screen Service: Provides a screen to open detail of a
selected user
β Main Screen Service: Shows the screen of main application
β Table Screen Service: Provides table screen service
www.mimos.my Β© 2008 MIMOS Berhad. All Rights Reserved.
16. Applying the Analysis and Design Method β
Step 3, Service Dependencies Diagram
www.mimos.my Β© 2008 MIMOS Berhad. All Rights Reserved.
17. Applying the Analysis and Design Method β
Step 4 and Step 5
β’ Applying step 4
β results in each of the services to be in their respective bundles
β need not to depict this
β in complex systems where a bundle can provide more than one
services, it is necessary to have a diagram on its own
β’ Step 5 onwards will not be discussed here
β same steps likewise OOAD methods
β design patterns can be applied to further promote reusability
within a bundle
www.mimos.my Β© 2008 MIMOS Berhad. All Rights Reserved.
18. Conclusions and Discussions
β’ Suggested approach or step-by-step guidelines to build
software systems utilizing OSGi
β’ Weaknesses of this method are:
β No formal notation defined to depict relationships between
services during runtime
β System architectural diagram must be depicted upfront
β Identification and decompositions of services largely depends on
skills and experience
β’ A trend moving towards MDA and MDD is currently
underway by OMG
β’ In the future, this method can be improved to follow
such a trend
www.mimos.my Β© 2008 MIMOS Berhad. All Rights Reserved.
20. Object-Oriented Analysis and Design
(OOAD) Method
β’ In 1990s OO paradigm became popular
β OO languages have been the preferred programming language
β OO paradigm has introduced attributes which solve issues in
structured paradigm
β’ OOAD method
β invented, likewise the structured analysis and design method is
for structured paradigm
β step-by-step guidelines for architects and developers on
designing and developing their applications
β popular methods e.g. Booch, Object Modeling Technique (OMT)
and the Unified Modeling Language (UML)
www.mimos.my Β© 2008 MIMOS Berhad. All Rights Reserved.
21. OOAD Issues
β’ Analysis and design of OO systems only
β’ Resulting design is usually monolithic
β’ Invented in 1990s where service-oriented and
component-oriented paradigm was not common
β’ An improved version of OOAD method is required
β’ Do not cater for dynamism
β service required or depended on by another service becomes
unavailable
β all components must be made available for the dependent
components to be able to run or use
β in SO, requires handling of unavailable service to be clearly
specified during analysis and design phase
www.mimos.my Β© 2008 MIMOS Berhad. All Rights Reserved.
22. OOAD Issues (cont.)
β’ UML does not provide formal notations to depict
services
β’ Structural view
β bundle diagram that shows relationships and dependencies
against other bundles
β class diagram can still be used to illustrate classes within a
package in a bundle
β’ Dynamic view
β OSGi bundle together with services that it offers to other
services residing in other bundles
β ensure that system being designed has all required services to
be resolved and available during runtime
www.mimos.my Β© 2008 MIMOS Berhad. All Rights Reserved.
23. OOAD Issues (cont.)
β’ OSGi attributes
β possibility that different versions of same package providing a
service to be made available
β different versions of this package might be providing same
service with different behaviours
β Different parts of system might be using different versions of
same package
β’ Dynamic view of entire system is depicted by service
dependencies diagram
β’ Version of a service must be specified so that dependent
services can be connected
β’ Reactive approach in system development do exists
www.mimos.my Β© 2008 MIMOS Berhad. All Rights Reserved.
24. OOAD Method (cont.)
β’ Booch and OMT clearly specify the steps required to be
taken when converting system requirements into a
software design
β’ UML
β does not specify the exact method
β only specify the notations and type of diagrams available to
provide different architectural views of a software system
β designed to be compatible with those methods
β methods have been recast to take advantage of the new
notations available
www.mimos.my Β© 2008 MIMOS Berhad. All Rights Reserved.