Ooad All Units
Ooad All Units
OOAD-UNIT-3 - R20
UNIT III:
Class & Object Diagrams: Terms, concepts, modeling techniques for Class & Object Diagrams.
Advanced Structural Modeling: Advanced classes, advanced relationships, Interfaces, Types and Roles,
Packages. Case Study: AI: Cryptanalysis.
Class Diagrams
Terms
Terms & concepts
A class diagram shows a set of classes, interfaces, and collaborations and their relationships.
Graphically, a class diagram is a collection of vertices and arcs.
Common Properties AClass diagram is a special kind of diagram and shares the same common properties
as all other diagrams—that is, a name and graphical contents that are a projection into a model. What
distinguishes a class diagram from all other kinds of diagram is its particular content.
Contents
Class diagrams commonly contain the following things:
o Classes
o Interfaces
o Collaborations
o Dependency, generalization, and association relationships
Like all other diagrams, class diagrams may contain notes and constraints
Class diagrams may also contain packages or subsystems
Note: Component diagrams and deployment diagrams are similar to class diagrams, except that instead of
containing classes, they contain components and nodes
Example
Common Uses
o You use class diagrams to model the static design view of a system. This view primarily supports the
functional requirements of a system
o We'll typically use class diagrams in one of three ways:
1. To model the vocabulary of a system
2. To model simple collaborations
3. To model a logical database schema
o Identify the mechanism you'd like to model. A mechanism represents some function or behavior of
the part of the system you are modeling that results from the interaction of a society of classes,
interfaces, and other things.
o For each mechanism, identify the classes, interfaces, and other collaborations that participate in this
collaboration. Identify the relationships among these things, as well.
o Use scenarios to walk through these things. Along the way, you'll discover parts of your model that
were missing and parts that were just plain semantically wrong.
o Be sure to populate these elements with their contents. For classes, start with getting a good balance
of responsibilities. Then, over time, turn these into concrete attributes and operations.
o To model a schema,
o Identify those classes in your model whose state must transcend the lifetime of their applications.
o Create a class diagram that contains these classes and mark them as persistent (a standard tagged
value). You can define your own set of tagged values to address database-specific details.
o Expand the structural details of these classes. In general, this means specifying the details of their
attributes and focusing on the associations and their cardinalities that structure these classes.
o Watch for common patterns that complicate physical database design, such as cyclic associations,
one-to-one associations, and n-ary associations. Where necessary, create intermediate abstractions to
simplify your logical structure.
o Consider also the behavior of these classes by expanding operations that are important for data
access and data integrity. In general, to provide a better separation of concerns, business rules
concerned with the manipulation of sets of these objects should be encapsulated in a layer above
these persistent classes.
o Where possible, use tools to help you transform your logical design into a physical design.
o Identify the rules for mapping to your implementation language or languages of choice. This is
something you'll want to do for your project or your organization as a whole.
o Depending on the semantics of the languages you choose, you may have to constrain your use of
certain UML features. For example, the UML permits you to model multiple inheritance, but
Smalltalk permits only single inheritance. You can either choose to prohibit developers from
modeling with multiple inheritance (which makes your models language-dependent)
o Use tagged values to specify your target language.
o Use tools to forward engineer your models.
Reverse engineering is the process of transforming code into a model through a mapping from a
specific implementation language.
Reverse engineering results in a flood of information, some of which is at a lower level of detail than
you'll need to build useful models.
Reverse engineering is incomplete. There is a loss of information when forward engineering models into
code, and so you can't completely recreate a model from code unless your tools encode information in
the source comments that goes beyond the semantics of the implementation language.
To reverse engineer a class diagram,
o Identify the rules for mapping from your implementation language or languages of choice. This
is something you'll want to do for your project or your organization as a whole.
o Using a tool, point to the code you'd like to reverse engineer. Use your tool to generate a new
model or modify an existing one that was previously forward engineered.
o Using your tool, create a class diagram by querying the model. For example, you might start with
one or more classes, then expand the diagram by following specific relationships or other
neighboring classes. Expose or hide details of the contents of this class diagram as necessary to
communicate your intent.
Object Diagram
Terms & Concepts
An object diagram is a diagram that shows a set of objects and their relationships at a point in time.
Graphically, an object diagram is a collection of vertices and arcs
Common properties
An object diagram is a special kind of diagram and shares the same common properties as all other
diagrams—that is, a name and graphical contents that are a projection into a model. What distinguishes a
class diagram from all other kinds of diagram is its particular content.
Contents
Object diagrams commonly contain
Objects
Links
Like all other diagrams, object diagrams may contain notes and constraints.
Object diagrams may also contain packages or subsystems
Example:
Common Uses
You use object diagrams to model the static design view or static process view of a system just as you do
with class diagrams
When you model the static design view or static process view of a system, you typically use object
diagrams in one way:
To model object structures
ADVANCED CLASSES
A classifier is a mechanism that describes structural and behavioral features. Classifiers include classes,
interfaces, datatypes, signals, components, nodes, use cases, and subsystems.
The most important kind of classifier in the UML is the class. A class is a description of a set of objects that
share the same attributes, operations, relationships, and semantics. Classes are not the only kind of classifier,
however. The UML provides a number of other kinds of classifiers to help you model.
• Interface A collection of operations that are used to specify a service of a class or a component
• Datatype A type whose values have no identity, including primitive built-in types (such as numbers and
strings), as well as enumeration types (such as Boolean)
• Signal The specification of an asynchronous stimulus communicated between instances
•Component A physical and replaceable part of a system that conforms to and provides the realization of a
set of interfaces
• Node A physical element that exists at run time and that represents a computational resource,
generally having at least some memory and often processing capability
• Use case A description of a set of a sequence of actions, including variants, that a system performs that
yields an observable result of value to a particular actor
• Subsystem A grouping of elements of which some constitute a specification of the behavior offered by the
other contained elements
Visibility
One of the most important details you can specify for a classifier's attributes and operations is its visibility.
The visibility of a feature specifies whether it can be used by other classifiers. In the UML, you can specify
any of three levels of visibility.
1. public Any outside classifier with visibility to the given classifier can use the feature; specified by
prepending the symbol +
2. protected Any descendant of the classifier can use the feature; specified by prepending the symbol #
3. private Only the classifier itself can use the feature; specified by prepending the symbol -
Scope
Another important detail you can specify for a classifier's attributes and operations is its owner scope. The
owner scope of a feature specifies whether the feature appears in each instance of the classifier or whether
there is just a single instance of the feature for all instances of the classifier. In the UML, you can specify
two kinds of owner scope.
1. instance Each instance of the classifier holds its own value for the feature.
2. class There is just one value of the feature for all instances of the classifier.
You use generalization relationships to model a lattice of classes, with more-generalized abstractions at the
top of the hierarchy and more-specific ones at the bottom. Within these hierarchies, it's common to specify
that certain classes are abstract—meaning that they may not have any direct instances. In the UML, you
specify that a class is abstract by writing its name in italics. For example, as Figure shows, Icon,
RectangularIcon, and ArbitraryIcon are all abstract classes. By contrast, a concrete class (such as Button
and OKButton) is one that may have direct instances.
However, you can also specify that a class may have no children. Such an element is called a leaf class and
is specified in the UML by writing the property leaf below the class's name
a class may have no parents. Such an element is called a root class, and is specified in the UML by writing
the property root below the class's name.
Operations have similar properties. Typically, an operation is polymorphic, which means that, in a
hierarchy of classes, you can specify operations with the same signature at different points in the hierarchy.
Ones in the child classes override the behavior of ones in the parent classes. When a message is dispatched
at run time, the operation in the hierarchy that is invoked is chosen polymorphically—that is, a match is
determined at run time according to the type of the object.
For example, display and isInside are both polymorphic operations. Furthermore, the operation
Icon::display() is abstract, meaning that it is incomplete and requires a child to supply an implementation of
the operation. In the UML, you specify an abstract operation by writing its name in italics, just as you do for
a class. By contrast, Icon::getID() is a leaf operation, so designated by the property leaf. This means that the
operation is not polymorphic and may not be overridden.
Multiplicity
The number of instances a class may have is called its multiplicity. Multiplicity is a specification of the
range of allowable cardinalities an entity may assume. In the UML, you can specify the multiplicity of a
class by writing a multiplicity expression in the upper-right corner of the class icon
Multiplicity applies to attributes, as well. You can specify the multiplicity of an attribute by writing a
suitable expression in brackets just after the attribute name. For example, in the figure, there are two or more
consolePort instances in the instance of NetworkController.
Attributes
At the most abstract level, when you model a class's structural features (that is, its attributes), you simply
write each attribute's name. That's usually enough information for the average reader to understand the intent
of your model. As the previous sections have described, however, you can also specify the visibility, scope,
and multiplicity of each attribute. There's still more. You can also specify the type, initial value, and
changeability of each attribute.
There are three defined properties that you can use with attributes.
Operations: At the most abstract level, when you model a class's behavioral features (that is, its operations
and its signals), you will simply write each operation's name. That's usually enough information for the
average reader to understand the intent of your model. As the previous sections have described, however,
you can also specify the visibility and scope of each operation. There's still more: You can also specify the
parameters, return type, concurrency semantics, and other properties of each operation.
Collectively, the name of an operation plus its parameters (including its return type, if any) is called
the operation's signature.
In an operation's signature, you may provide zero or more parameters, each of which follows the syntax
In addition to the leaf property described earlier, there are four defined properties that you can use with
operations.
1. isQuery Execution of the operation leaves the state of the system unchanged. In other words, the
operation is a pure function that has no side effects.
2. sequential Callers must coordinate outside the object so that only one flow is in the object at a time. In
the presence of multiple flows of control, the semantics and integrity of the object cannot
be guaranteed.
3. guarded The semantics and integrity of the object is guaranteed in the presence of multiple flows of
control by sequentializing all calls to all of the object's guarded operations. In effect,
exactly one operation at a time can be invoked on the object, reducing this to sequential
Downloaded by Ganesh Pavan Kumar Battula ([email protected])
lOMoARcPSD|41687779
lOMoAR cPSD| 19893192
semantics.
4. concurrent The semantics and integrity of the object is guaranteed in the presence of multiple flows of
control by treating the operation as atomic. Multiple calls from concurrent flows of control
may occur simultaneously to one object on any concurrent operation, and all may proceed
concurrently with correct semantics; concurrent operations must be designed so that they
perform correctly in the case of a concurrent sequential or guarded operation on the same
object.
Advanced Relationships
A relationship is a connection among things. In object-oriented modeling, the four most important
relationships are dependencies, generalizations, associations, and realizations.
Graphically, a relationship is rendered as a path, with different kinds of lines used to distinguish the
different relationships.
Dependency
A dependency is a using relationship, specifying that a change in the specification of one thing may
affect another thing that uses it, but not necessarily the reverse. Graphically, a dependency is rendered as
a dashed line
There are 17 such stereotypes, all of which can be organized into six groups.
First, there are eight stereotypes that apply to dependency relationships among classes and objects in
class diagrams.
Specifies that the source instantiates the target template using the given
1 bind actual parameters
2 derive Specifies that the source may be computed from the target
3 friend Specifies that the source is given special visibility into the target
4 instanceOf Specifies that the source object is an instance of the target classifier
* There are two stereotypes that apply to dependency relationships among packages.
Specifies that the source package is granted the right to reference the
9 access elements of the target package
A kind of access that specifies that the public contents of the target
package enter the flat namespace of the source, as if they had been
10 import declared in the source
Generalization
A generalization is a relationship between a general thing (called the superclass or parent) and a
more specific kind of that thing(called the subclass or child).
In a generalization relationship, instances of the child may be used anywhere instances of the parent
apply—meaning that the child is substitutable for the parent.
A plain, unadorned generalization relationship is sufficient for most of the inheritance relationships
you'll encounter. However, if you want to specify a shade of meaning,
The UML defines one stereotype and four constraints that may be applied to generalization
relationships.
Specifies that the child inherits the implementation of the parent but
does not make public nor support its interfaces, thereby violating
1 implementation substitutability
Next, there are four standard constraints that apply to generalization relationships
Specifies that all children in the generalization have been specified in the
1 complete model and that no additional children are permitted
Specifies that not all children in the generalization have been specified
2 incomplete (even if some are elided) and that additional children are permitted
Specifies that objects of the parent may have no more than one of the
3 disjoint children as a type
Specifies that objects of the parent may have more than one of the
4 overlapping children as a type
Association
An association is a structural relationship, specifying that objects of one thing are connected to
objects of another.
We use associations when you want to show structural relationships.
There are four basic adornments that apply to an association: a name, the role at each end of the
association, the multiplicity at each end of the association, and aggregation.
For advanced uses, there are a number of other properties you can use to model subtle details,
such as
Navigation
Vision
Qualification
various flavors of aggregation.
Navigation
unadorned association between two classes, such as Book and Library, it's possible to navigate from
objects of one kind to objects of the other kind. Unless otherwise specified, navigation across an
association is bidirectional.
However, there are some circumstances in which you'll want to limit navigation to just one direction.
Visibility
Given an association between two classes, objects of one class can see and navigate to objects of the
other, unless otherwise restricted by an explicit statement of navigation.
However, there are circumstances in which you'll want to limit the visibility across that association
relative to objects outside the association.
In the UML, you can specify three levels of visibility for an association end, just as you can for a
class's features by appending a visibility symbol to a role name the visibility of a role is public.
Private visibility indicates that objects at that end are not accessible to any objects outside the
association.
Protected visibility indicates that objects at that end are not accessible to any objects outside the
association, except for children of the other end.
Qualification
In the context of an association, one of the most common modeling idioms you'll encounter is the
problem of lookup. Given an object at one end of an association, how do you identify an object or set of
objects at the other end?
In the UML, you'd model this idiom using a qualifier, which is an association attribute whose
values partition the set of objects related to an object across an association.
You render a qualifier as a small rectangle attached to the end of an association, placing the
attributes in the rectangle
Interface Specifier
An interface is a collection of operations that are used to specify a service of a class or a
component
Collectively, the interfaces realized by a class represent a complete specification of the behavior
of that class.
However, in the context of an association with another target class, a source class may choose to
present only part of its face to the world
a Person class may realize many interfaces: IManager, IEmployee, IOfficer, and so on
you can model the relationship between a supervisor and her workers with a one-to-many
association, explicitly labeling the roles of this association as supervisor and worker
In the context of this association, a Person in the role of supervisor presents only the IManager face
to the worker; a Person in the role of worker presents only the IEmployee face to the supervisor. As
the figure shows, you can explicitly show the type of role using the syntax rolename : iname, where
iname is some interface of the other classifier.
Composition
Simple aggregation is entirely conceptual and does nothing more than distinguish a "whole" from
a "part."
Composition is a form of aggregation, with strong ownership and coincident lifetime as part of the
whole.
Parts with non-fixed multiplicity may be created after the composite itself, but once created they
live and die with it. Such parts can also be explicitly removed before the death of the composite.
This means that, in a composite aggregation, an object may be a part of only one composite at a
time
In addition, in a composite aggregation, the whole is responsible for the disposition of its parts,
which means that the composite must manage the creation and destruction of its parts
Association Classes
In an association between two classes, the association itself might have properties.
An association class can be seen as an association that also has class properties, or as a class that
also has association properties.
We render an association class as a class symbol attached by a dashed line to an association
Constraints
Realization
1. Realization is sufficiently different from dependency, generalization, and association relationships that it
is treated as a separate kind of relationship.
2. A realizationis a semantic relationship between classifiers in which one classifier specifies a contract that
another classifier guarantees to carry out.
3. Graphically, a realization is rendered as a dashed directed line with a large open arrowhead pointing to
the classifier that specifies the contract.
4. You'll use realization in two circumstances: in the context of interfaces and in the context of
collaborations
5. Most of the time, you'll use realization to specify the relationship between an interface and the class or
component that provides an operation or service for it
6. You'll also use realization to specify the relationship between a use case and the collaboration that
realizes that use case
Realization of an Interface
Interface
An interface is a collection of operations that are used to specify a service of a class or a
component
Type
A type is a stereotype of a class used to specify a domain of objects, together with the operations
(but not the methods) applicable to the object.
Role
A role is the behavior of an entity participating in a particular context.
Names
Every interface must have a name that distinguishes it from other interfaces.
A name is a textual string. That name alone is known as a simple name;
A path name is the interface name prefixed by the name of the package
Downloaded by Ganesh Pavan Kumar Battula ([email protected])
lOMoARcPSD|41687779
lOMoAR cPSD| 19893192
Operations
Relationships
Like a class, an interface may participate in generalization, association, and dependency
relationships. In addition, an interface may participate in realizationrelationships.
An interface specifies a contract for a class or a component without dictating itsimplementation.
A class or component may realize many interfaces
We can show that an element realizes an interface in two ways.
o First, you can use the simple form in which the interface and its realization relationshipare
rendered as a lollipop sticking off to one side of a class or component.
o Second, you can use the expanded form in which you render an interface as a stereotyped class,
which allows you to visualize its operations and other properties, and then draw arealization
relationship from the classifier or component to the interface.
Type is a stereotype of class, and you use it to specify a domain of objects, together with the
operations (but not the methods) applicable to the objects of that type. The concept of type is closely
related to that of interface, except that a type's definition may include attributes while an interface
may not.
The most common purpose for which you'll use interfaces is to model the seams in a system
composed of software components, such as COM+ or Java Beans.
Identifying the seams in a system involves identifying clear lines of demarcation in your architecture.
On either side of those lines, you'll find components that may change independently, without affecting
the components on the other side,
The above Figure shows the seams surrounding a component (the library ledger.dll) drawn from a
financial system. This component realizes three interfaces: IUnknown, ILedger, and IReports. In
this diagram, IUnknown is shown in its expanded form; the other two are shown in their simple
form, as lollipops. These three interfaces are realized by ledger.dll and are exported to other
components for them to build on.
As this diagram also shows, ledger.dll imports two interfaces, IStreaming and ITransaction, the
latter of which is shown in its expanded form. These two interfaces are required by the ledger.dll
component for its proper operation. Therefore, in a running system, you must supply components
that realize these two interfaces.
Downloaded by Ganesh Pavan Kumar Battula ([email protected])
lOMoARcPSD|41687779
lOMoAR cPSD| 19893192
o Model all the roles the of the object may take on at any point in time. You can doso in two
ways:
1.) First, in a class diagram, explicitly type each role that the class plays in itsassociation with
Other classes. Doing this specifies the face instances of that class put on inthe context of the
associated object.
2.) Second, also in a class diagram, specify the class-to-type relationships usinggeneralization.
o To show the change in role of an object, render the object once for each role itplays in the
interaction, and connect these objects with a message stereotyped as become.
Names
Every package must have a name that distinguishes it from other packages. A name is atextual
string.
That name alone is known as a simple name; a path name is the package name prefixedby the name
of the package in which that package lives
We may draw packages adorned with tagged values or with additional compartments toexpose their
details.
Owned Elements
A package may own other elements, including classes, interfaces, components, nodes,
collaborations, use cases, diagrams, and even other packages.
Owning is a composite relationship, which means that the element is declared in the package.
If the package is destroyed, the element is destroyed. Every element is uniquely owned by exactly one
package.
Elements of different kinds may have the same name within a package. Thus, you can have a
class named Timer, as well as a component named Timer, within the samepackage.
Packages may own other packages. This means that it's possible to decompose your models
hierarchically.
We can explicitly show the contents of a package either textually or graphically.
Generalization
There are two kinds of relationships you can have between packages: import and access
dependencies used to import into one package elements exported from another and generalizations, used
to specify families of packages
Generalization among packages is very much like generalization among classes Packages
involved in generalization relationships follow the same principle of
substitutability as do classes. A specialized package (such as WindowsGUI) can be usedanywhere a more
general package (such as GUI) is used
Downloaded by Ganesh Pavan Kumar Battula ([email protected])
lOMoARcPSD|41687779
lOMoAR cPSD| 19893192
Standard Elements
o The UML defines five standard stereotypes that apply to packages
Artificial Intelligence Artificial intelligence (AI) refers to the simulation of human intelligence in
machines that are programmed to think like humans and mimic their actions.
Problem to solve
Our problem is designing a system with artificial intelligence that performs
cryptanalysis.
The process of transforming ciphertext back to plaintext.
Manually converting the ciphertext back to plaintext through brute force or any
approachtakes time and more work.
So we have to apply software engineering concepts for designing the system.
INCEPTION –
Our problem is one of cryptanalysis, the process of transforming ciphertext back to plaintext. ourproblem is
relatively simple because we limit ourselves to single substitution ciphers.
Cryptanalysis Requirements
Cryptography “embraces methods for rendering data unintelligible to unauthorized parties” . Using
cryptographic algorithms, messages (plaintext) may be transformed into cryptograms (ciphertext) and
back again. One of the most basic kinds of cryptographic algorithms, employed since the time of the
Romans, is called a substitution cipher. With this cipher, every letter of the plaintext alphabet is mapped
to a different letter.
Cryptography – Cryptographic algorithms
-Methods
Trail and Error
Knowledge of spelling and grammar
Backtracking
-Knowledge of Artificial Intelligence and
Blackboard systems.Boundaries of the Problem
Assuming that the plaintext alphabet encompasses only the 26 uppercase English characters, there are 26!
(approximately 4.03 * 10 ^ 26) possible combinations.
Thus, we must try something other than a brute force attack.
An alternate technique is to make an assumption based on our knowledge of sentence, word, and letter
structure and then follow this assumption to its natural conclusions.
Elaboration
Now we are ready to design a solution to the cryptanalysis problem using the blackboard
framework.
The architecture of the blackboard framework suggests that among the highest level objects in our
system are a blackboard, several knowledge sources, and a controller.
Our next task is to identify the domain-specific classes and objects that specialize these general key
abstractions.
Blackboard Objects
Dependencies Affirmations
Dependency class
references - Collection of knowledge sources
add() - Add a reference to the knowledge source.
remove() - Remove a reference to the knowledge source.
Affirmation class
make - Make a statement.
retract - Retract a statement.
ciphertext - Given a plaintext letter, return its ciphertext equivalent.
plaintext - Given a ciphertext letter, return its plaintext equivalent.
target() - The blackboard object about which the assumption was made creator. The knowledge
source that created the assumption
reason() - The reason the knowledge source made the assumption. plainLetter() -
The plaintext letter about which the assumption is being made. cipherLetter() - The
assumed value of the plaintext letter.
3.Construction:
Design of the Sentence, Word, and Cipher Letter classes, followed by the Alphabet class, bydoing a little
isolated class design
1.Designing the Blackboard Objects
A sentence is quite simple: It is a Black board Object as well as a Dependent, and it denotes a list of words
that compose the sentence. We make the superclass Dependent abstract 1 (Figure 10–4)because we expect
there may be other Sentence subclasses that try to inherit from Dependent as well. By marking this
inheritance relationship abstract, we cause such subclasses to share a single Dependent superclass.
In addition to the operations register and resign defined by its superclass Black board Object,plus the four
operations defined in Dependent, we add the following two sentence-specific operations:
At the start of the problem, value returns a string representing the original cryptogram. OnceisSolved
evaluates as true, the operation value may be used to retrieve the plaintext solution. Accessing value
before isSolved is true will yield partial solutions.
the Sentence operations, we define the following two operations for the class Word:
This decision influences our design decisions about the Affirmation class, to which we add the following
operations:
■ most Recent A selector: returns the most recent assumption or assertion
■ statement At A selector: returns the nth statement.
Consider next the class named Alphabet. This class represents the entire plaintext and ciphertext alphabet,
plus the mappings between the two. This information is important because each knowledge source can use
it to determine which
mappings have been made and which are yet to be done.
For example, if we already have an assertion that the ciphertext letter C is really the letter M, then an
alphabet object records this mapping so that no other knowledge source can apply the plaintext letter
M. For efficiency, we need to query about the mapping both ways: Given a ciphertext letter, return its
plaintext mapping, and given a plaintext letter, return its ciphertextmapping.
Figure 10–6 illustrates the addition of the design of the Alphabet class.
The Cipher Letter Class, we also include a protected member object affirmations and provide suitable
operations to access its state.
To define the Blackboard class. This class has the simple responsibility of collecting instances of the
Black board Object class and its subclasses. Thus we may design Blackboard as a type of instance of a
Dynamic Collection.
We have chosen to inherit from rather than contain an instance of the Dynamic Collection class because
Blackboard passes our test for inheritance: A Blackboard is indeed a kind of collection. The Blackboard
class provides operations such as add and remove, which it inherits from the Collection class. Our
design includes five operations specific to the blackboard.
For each of these classes, we may provide another level of specification. For example, the subclasses of the
class Sentence Knowledge Source include the following:
Similarly, the subclasses of the intermediate class Word Knowledge Source include these:
the purpose of a pattern-matching knowledge source was to propose words that fit a certain pattern. We can use
regularexpression pattern matching symbols such as:
The reason for this simple interface is that knowledge sources are relatively autonomous entities: We point one
to an interesting Blackboard object and then tell it to evaluate its rules according to the current global state of the
Blackboard. As part of the evaluation of its rules, a given knowledge source might do any one of several things.
In fact, this class has only one critical operation that it makes visible to knowledge sources:
Finally, each knowledge source must have an association to a controller, with which it collaborates by
sending hints of solutions; in turn, the controller might trigger the knowledgesource from time to time.
Figure 10–10 illustrates these design decisions.
One of the responsibilities of this class is that when we create an instance of Knowledge Sources, we also
create the 13 individual Knowledge Source objects. We may perform threeoperations on instances of this
class:
Figure 10–11 The Refined Design of the Knowledge Source Class Diagram
Designing the Controller
Consider for a moment how the controller and individual knowledge sources interact. At each stage in
the solution of a cryptogram, a particular knowledge source might discover that it has a useful
contribution to make and so gives a hint to the controller.
How does the controller decide which knowledge source to activate? We may devise a fewsuitable rules.
For example, consider the state transition diagram shown in Figure 10–12. Here we see that a controller
may be in one of five major states: Initializing, Selecting, Evaluating, Stuck, and Solved. The controller’s
most interesting activity occurs between the Selecting and Evaluatingstates.
Sequence Diagram
Figure 10–14 illustrates the flow of control using a sequence diagram.
4.Post Transition –
In this section, we consider an improvement to the functionality of the cryptanalysis system and observe
how our design weathers the change.
1.System Encements:
In any intelligent system, it is important to know what the final answer is to a problem, but it isoften equally
important to know how the system arrived at this solution.
To add this new functionality, we need to do two things.
First, we must devise a mechanism for keeping track of the work that the controller and each knowledge
source perform, and second, we must modify the appropriate operations so that they record this
information. Basically, the design calls for the knowledge sources and the controller to register what they
did in some central repository.
First, we might define the class Action, which serves to record what a particular
knowledge source or controller did. Figure 10–16 presents the design of the Action
class as it fits intoour architectural design.
For example, if the controller selected a particular knowledge source for activation, it would create an
instance of this class, set the who argument to itself, set the what argument to the knowledge source, set
the why argument to some explanation (perhaps including the current priority of the hint), and set when
this occurred.
The first part of our task is done, and the second part is almost as easy. Consider for a moment where
important events take place in our application.
As it turns out, five primary kinds of operations are affected:
Important Questions
1. a) Describe terms and concepts of advanced classes. [7M]
b) Briefly explain about inception phase of Cryptanalysis. [7M]
2. a) Explain common modeling techniques of class and object diagrams. [9M]
b) Describe blackboard objects of Cryptanalysis.
3. a) What are common modeling techniques of advanced relationships? Explain. [7M]
b) Describe designing the knowledge sources of Cryptanalysis. [7M]
4. a) Write and explain terms and concepts of interfaces, types and roles. [7M]
b) Discuss about post transition of Cryptanalysis.
5. a) What is an object diagram? Explain identifying objects in object diagrams. [7M]
b) Discuss about designing the controller of Cryptanalysis.
6. a) How to identify classes in class diagrams? Explain. [7M]
b) Discuss about the elaboration phase of Cryptanalysis. [7M]
7. a) Describe common modeling techniques of Packages. [7M]
b) What are requirements of Cryptanalysis? Explain about analysis of knowledge
sources.
8. a) Enumerate steps to model vocabulary of a system. [7M]
b) What is Object diagram? Explain the purpose of Object diagram and also explain the
notations used in object diagrams.[7M]
9. a) Draw and explain the class diagram for credit card validation system. [7M]
b) Explain about the package used in UML and also draw the package diagram for hotel
management system