Title: Practical ObjectOriented Development with UML and Java
1Practical Object-Oriented Development with UML
and Java
- Chapter 4Finding the Objects
2Building The OO Model
- Historically two distinct activities are taking
place simultaneously - problem analysis
- product description
- In actuality we are building a model of reality
that captures both aspects
3The Results
- A Model that
- Organizes the data into objects and classes, and
gives the data a structure via relationships of
inheritance, aggregation, and association - Organizes the services into classes or interfaces
and gives them conceptual grouping via the
generalization/specialization hierarchical
structure - Defines the external interfaces (services
prototypes) for all the class and interface
services. - Specifies local functional behaviors and defines
their external interfaces - Captures control or global behavior
- Captures constraints (limits and rules)
4Categories Of Objects (Coad and Yourdon)
- Structure
- Other systems
- Devices
- Events
- Roles
- Locations
- Organizational units
5Categories of objects (Shlaer and Mellor)
- Tangibles
- Roles
- Incidents
- Interactions
- Specification
6Object Categories (Ross)
- People
- Places
- Things
- Organizations
- Concepts
- Events
7Identification Of Objects
- Many methodologists have their own favorite
approaches - All techniques have short comings
- fail to identify all objects
- identifies false objects
- Current and traditional methods are covered here.
8Using The Things To Be Modeled
- Basic Steps Are
- Identify individual or group things, such as
persons, roles, organizations, logs, reports,
forms, etc. in the application domain - Identify the corresponding objects and classes
- Requires significant experience with OO to apply
successfully
9Using Definitions of Objects and Classes
- This is a direct and effective approach in which
the developer - uses object abstraction,
- knowledge of the domain,
- and the definition of class to intuitively
identify them - Requires significant training, practice,
intuition, and experience.
10Using Object Decomposition
- Assumes most object are composed of other objects
- Basic approach is
- Find the aggregate objects or class
- Use object decomposition to identify their
component objects or classes
11Using Generalization
- Assumes objects are identified prior to their
classes, that every object is an instance of some
class, and that commonalties among objects can be
used to generalize classes. - Steps are
- Identify all objects
- Look for two or more objects that share the same
attributes and services - Generalize the common aspects to form a class
- To continue, use the method Using Subclasses
12Using Subclasses
- The steps are
- Identify classes that share common resources
- Factor out the common resources to form a super
class, and then use inheritance for all classes
that share these resources to form simpler
subclasses
13Using OO Domain Analysis
- This technique assumes that an OO Domain Analysis
has already been performed in the same problem
domain. - The steps are
- Analyze the results of the give OODA
- Reuse objects or classes from the OODA
14Reusing an Application Framework
- This approach assumes that at least one OODA has
been done to create an application framework of
reusable classes - Steps are
- Identify one ore more relevant application
frameworks in the same application domain - Reuse both objects and classes from previously
developed frameworks.
15Reusing Class Hierarchies
- This technique assumes that a reuse repository
with relevant reusable class hierarchies has been
developed - Steps are
- Look for classes in the reuse repository that can
be reused - After identifying the classes, attempt to reuse
the associated class hierarchies - After modifying the classses, attempt to create
new abstract classes by grouping common
attributes and methods - If the classes are parameterized, supply the
generic formal parameters
16Reusing Individual Objects and Classes
- If a reuse repository with relevant reusable
objects and classes has been developed, we an
reuse specific objects and classes. - Steps are
- Look for relevant objects and classes in the
reuse repository that can be applied to the
application - If necessary, modify the objects and/or classes
- Supply generic, formal parameters to
parameterized classes as necessary.
17Using Subassemblies
- Assumes developers are incrementally developing
subassemblies using a recursive development
process - The steps are
- Identify all of the objects (classes) at the
current level that must remain temporarily
complext because they depend on one or more as
yet unidentified objects and classes - Develop a skeleton specification/design for the
methods of the temporarily incomplete object. - Create the appropriate child subassemblies at the
next lower level to handle the messages for the
incomplete object at the higher level - Repeat all steps at the current level that has
new subassemblies
18Using Personal Experience
- This assumes that the developer has already
performed an analysis and can use that experience
for this analysis - Steps are
- Find the objects and classes that correspond to
ones found in previous models that are in the
same application domain. - Modify the classes as necessary to support the
present project
19Using Nouns
- This assumes that written documents about the
domain exist - Steps are
- Obtain or author a narrative English text that
represents an informal description of the problem
to be solved. - Use the nouns, pronouns, and noun phrases to
identify objects and classes - Verbs and predicate phrases are used to identify
services
20Using Traditional Data Flow Diagrams
- This technique exploits existing DFD to identify
objects and classes - Steps are
- Map each terminator on the Context Diagram to an
object to encapsulate the interface - Identify one class to encapsulate the interface
of each set of similar or identical terminator
objects - Map each data store on the DFD to an object
- Map data stores that contain more than one data
field to an aggregate object - Map all or part of the data transformation
associated with the data store to a service of
the object and thus of the class - Map complex data flows to an object
- Identify subtransformations associated with the
parts of the data flow and map these
subtransformations to services of the object.
21Using Class-Responsibility-Collaboration (CRC)
Cards
- Based on the observations that identifying
objects and classes is a human activity that can
be stimulated by use of small pieces of paper to
represent objects/classes. - Steps are
- One a CRC card, document the name of the class
and list both the responsibilities and
collaborators. - Identify missing objects and/or classes that
should be added to the existing set of CRC.
22Recommendation
- Most Novices Find That A Mixture Of Approaches
Helps - Using Nouns To Identify Objects and Classes
- Using CRC Cards To Promote Discussion
- Using the Using Things To Be Modeled to Elicit
More Potential Objects