2 Marks

advertisement
2 MARKS QUESTIONS AND ANSWERS
S6 CSE
CS 63 OOAD
UNIT-I
1. What is object oriented analysis and design goals?
It is one of the methods of tracking problems by capturing the design that is easy to
communicate, review, implement and evolve.
2. Define analysis.
Analysis emphasizes an investigation of problem rather than how a solution is defined.
“Do the right thing”.
3. Define design.
Design emphasizes conceptual solution of problem rather than implementation.
“Do the thing right”.
4. Define OOAD.
The essence of object oriented analysis and design is to consider a problem domain and
logical solution from the prescriptive of object.
5. Define OO analysis and design.
OO Analysis finds and describes the object.
OO Design emphasizes defining the object’s attribute and methods.
6. List the key steps in OOAD.
Define use cases
Define domain model
Define interaction diagram
Define design class diagram
7. Define use case.
Use case is a textual description or a story describing the system. Usecase are not an
object oriented, they are simply written stories. It is one of the popular tools in requirement
analysis.
8. Define domain model or conceptual object model.
The domain model is not a description of software object; it is a visualization of concepts
or mental models of a real world domain. It is also called as conceptual object model.
9. Mention the goal of interaction diagram.
The main goal of interaction diagram is to show the responsibilities of objects and how
they collaborate to fulfill the requirements.
10. Define UML.
Unified modeling language is a visual language used for specifying, constructing and
documenting a system. It is a standard diagrammatic notation used for drawing, presenting
pictures related to software engineering.
Prepared By S.Ramesh – AP/CSE
Page 1
2 MARKS QUESTIONS AND ANSWERS
S6 CSE
CS 63 OOAD
11. What are the three ways to apply UML?
UML as a sketch.
UML as a blue print.
UML as a programming language.

12. List the perspectives of UML.
Conceptual perspectives.
Specification perspectives.
Implementation perspectives.


13. Define conceptual perspectives.
UML diagrams are used to describe things in situations of real world. Raw UML object
diagram notation used to visualize.
14. Define specification perspectives.
It describes the real world things, software abstraction and component with specification
and interfaces. Raw UML class diagram notation used to visualize software components.
15. Define implementation perspectives.
UML diagram describe the software component implementation in a particular
technology.
16. Define Unified Process (UP).
Unified process is a iterative process, risk driven process and architecture centric
approach to software development. It comes under software development process.
17. List the phases of UP.
UP has four phases.
Inception.
Elaboration.
Construction.
Transition.
18. What are the advantages of inception?
Estimation or plans are expected to be reliable.
After inception, design architecture can be made easily because all the use cases are
written in detail.
19. Define actor and scenario.
Actor is something with behavior. It can be a system, person or a organization.
Scenario is a sequence of actions and interaction between actor and system. It is also
called as instance of use cases.
20. List the types of actors.
Primary actor.
Supporting actor.
Prepared By S.Ramesh – AP/CSE
Page 2
2 MARKS QUESTIONS AND ANSWERS
S6 CSE
CS 63 OOAD
Off stage actor.
21. Define inception.
Inception is the initial stage of project. It deals with approximate vision, business case,
scope of project and vague estimation.
22. What are the uses of use case
Use cases are very good way to keep everything simple.
It gives the user’s goal and perspectives.
23. Define primary actor and supporting actor.
Primary actor is used to find the user’s goal which drives the use cases.
Eg. Cashier.
Supporting actor is used to clarify external interfaces and protocols.
Eg. System or organization.
24. List the types of user interface free style.
Essential style writing.
Concrete style writing.
25. Define terse use case.
Terse use case is used for avoiding or deleting noisy words or fuzzy words.
26. What are the basic procedures for use case?
Choose the system boundary.
Identify the primary actor.
Identify the goal of the primary actor.
Define the use case.
27. What are the tests involved in use case.
There are three types of test used in use case.
a. Boss test.
b. EBP test.
c. Size test.
28. Define EBP test.
Elementary business process is related to business engineering. The task is performed by
one person in one place at one time in response to business events which gives measurable
business value.
29. List the types of use case relationships.
Include relationship.
External relationship.
Generalization.
Prepared By S.Ramesh – AP/CSE
Page 3
2 MARKS QUESTIONS AND ANSWERS
S6 CSE
CS 63 OOAD
UNIT-II
1. What is a domain model?
A domain model is a visual representation of conceptual classes or real-situation objects
in a domain. Domain models have also been called conceptual models, domain object models
and analysis object models.
2. Define domain model.
Domain model means a representation of real-situation or conceptual classes, not of
software objects. The term does not mean a set of diagrams describing software classes, the
domain layer of a software architecture, or software objects with responsibilities.
3. Is a domain model a Picture of Software Business Objects?
A UP Domain Model is a visualization of things in a real-situation domain of interest, not
of software objects such as Java or C# classes, or software objects with responsibilities.
Therefore, the following elements are not suitable in a domain model:
Software artifacts
Responsibilities or methods.
4. What are Conceptual Classes?
A conceptual class is an idea, thing, or object. A conceptual class may be considered in
terms of its symbol, intension, and extension.
Symbol: words or images representing a conceptual class.
Intension: the definition of a conceptual class.
Extension: the set of examples to which the conceptual class applies.
5. Are Domain and Data Models the Same Thing?
Data Model: It shows the persistent data to be stored somewhere else. It has relation
database design. It has some attributes and methods. Domain Model: Domain model is not a data
model because it does not have attributes and methods for a class.
6. How to create a Domain Model?
Bounded by the current iteration requirements under design:
1. Find the conceptual classes.
2. Draw them as classes in a UML class diagram.
3. Add associations and attributes.
7. What are Three Strategies to Find Conceptual Classes?
There are three strategies.
1. Reuse or modify existing models
2. Use a category list
3. Identify noun phrases.
8. When to Model with ‘Description’ Classes?
A description class contains information that describes something else. For example, a
product description that records the price, picture, and text description of an item.
Prepared By S.Ramesh – AP/CSE
Page 4
2 MARKS QUESTIONS AND ANSWERS
S6 CSE
CS 63 OOAD
9. When Are Description Classes Useful?
Add a Description Class when:
There needs to be a description about an item or service, independent of the current
existence of any examples of those items or services.
Deleting instances of things they describe results in a loss of information that needs to
be maintained.
It reduces redundant or duplicated information.
10. Define Association With Example.
Associations are defined as “the semantic relationship between two or more classifiers
that involve connections among their instances.”
Example:
11. Why Should We Avoid Adding Many Associations?
We need to avoid adding too many associations to a domain model. Too many creates
“visual noise” in a domain model.
12. How to name an association in UML?
Association names should start with a capital letter, since an association represents a classifier
of links between instances; in the UML, classifiers should start with a capital letter. Two
common and equally legal formats for a compound association name are:
Records-current
RecordsCurrent
13. What is role of association?
Each end of an association is called a role. Roles may optionally have:
Multiplicity expression
Name
Navigability
14. Define Multiplicity.
Multiplicity defines how many instances of a class A can be associated with one instance
of a class B. For example, a single instance of a Store can be associated with many” Item
instances.
15. Define attributes with example.
An attribute is a logical data value of an object. It is useful to identify those conceptual
classes that are needed to satisfy the information requirements of the current scenarios under
development.
For example, a receipt in the Process Sale use case normally includes a date and time, the store
name and address, and the cashier ID, among many other things.
Prepared By S.Ramesh – AP/CSE
Page 5
2 MARKS QUESTIONS AND ANSWERS
S6 CSE
CS 63 OOAD
16. When to show attributes?
Include attributes that the requirements suggest or imply a need to remember information.
Therefore,
Sale needs a dateTime attribute.
Store needs a name and address.
Cashier needs an ID.
17. What is the syntax for an attribute?
The full syntax for an attribute in the UML is:
Visibility name: type multiplicity = default {property-string}.
18. What is derived attribute?
The total attribute in the Sale can be calculated or derived from the information in the
SalesLineItem. It is derivable attribute, we use convention: a / symbol before the attribute name.
19. What is data type attribute in the domain model?
It is a primitive datatype such as numbers, character, Boolean, string and enumerations.
Here, currentRegister is not a data type.
20. When to define new datatype classes?
In the NextGen POS system an itemID attribute is needed; it is probably an attribute of an
Item or ProductDescription. For example, itemID : Integer or itemID : String. If itemID will be a
class in the domain model then use the attribute of the item as itemIdentifier in software
designing.
21. How to apply activity diagrams?
A UML activity diagram offers rich notation to show a sequence of activities, including
parallel activities. It may be applied to any perspective or purpose, but is popular for visualizing
business workflows and processes and use cases.
22. Define generalization.
Generalization is the activity of identifying commonality among concepts and defining
super class and subclass relationships. For example, the concepts CashPayment, CreditPayment
and CheckPayment are all very similar and it is possible to organize them into a generalization,
specification, class hierarchy.
23. What is 100% Rule?
100% of the conceptual super class definition should be applicable to the subclass. The
subclass must conform to 100% of the super class is attributes and associations.
24. Write guidelines to define conceptual subclasses.
1. The subclass s has additional attributes of interest.
2. The subclass has additional associations of interest.
3. The subclass concept is operated differently than the super class.
4. The subclass concept represents an animate thing that behaves differently than the
super class or other subclasses.
Prepared By S.Ramesh – AP/CSE
Page 6
2 MARKS QUESTIONS AND ANSWERS
S6 CSE
CS 63 OOAD
25. Write guidelines to define conceptual super class.
1. The potential conceptual subclasses represent variations of a similar concept.
2. The subclasses will conform to the 100% and Is-a rule.
3. All subclasses have the same attribute that can be factored out and expressed in the
super class.
4. All subclasses have the same association that can be factored out and expressed in the
super class.
26. What is Aggregation?
Aggregation is a vague kind of association in the UML that loosely suggests whole-part
relationships. It has no meaningful distinct semantics in the UML versus a plain association, but
the term is defined in the UML.
27. Define Composition.
Composition, also known as composite aggregation, is a strong kind of wholepart
aggregation and is useful to show in some models. It is an instance of a part belongs to only one
composite instance.
28. How to identify composition?
The lifetime of the part is bound within the lifetime of the composite there is a createdelete dependency of the part on the whole.
29. Guidelines for writing activity diagram.
1. This is used for very complex processor.
2. If your business process, then use the rake notation for sub activity system.
Sale SalesLineItem
3. On the first overview “level0” diagram, keep all the actions at a very high level of
abstraction, so that the diagram is short and sweet.
30. What are the UML activity notations?
The UML activity notations are,
Rake symbol
Merge symbol
Decision symbol
Prepared By S.Ramesh – AP/CSE
Page 7
2 MARKS QUESTIONS AND ANSWERS
S6 CSE
CS 63 OOAD
UNIT-III
1. What is SSD?
SSD stands for system sequence diagram during interaction and actor generates system
events to a system representing some system operation to handle the event the sequence diagram
also illustrates the actor’s interaction and the operation initiated by them
2. What are the things that the system should react?
External events from the actor
Time events
Fault or exceptions
3. What is the relationship between SSD and use cases?
SSD:
It shows the system events for one scenario of a use case
Use case:
System events are generated by use cases
SSD are the visual representation of usecase.
4. How to model SSD involving other external system?
SSD is used to illustrate collaboration between system.
It can illustrate collaboration between pos and credit payment authorization system
5. Define layers:
Layers are coarse grained grouping of classes /packages/subsystems these classes have
same responsibility for major aspects of the system
6. What are the types of layers?
lower layers
higher layers
7. What are the parts of the layers?
User interface
Application logic/domain object
Technical service
8. What are the types of layered architecture?
Strict layered architecture
Relaxed layer architecture
9. Define UML package diagram
It is used for the logical architecture of the system grouping of package is possible using
this package nesting of packages is common in uml package diagram.
10. What are the benefits of using the layers?
Prepared By S.Ramesh – AP/CSE
Page 8
2 MARKS QUESTIONS AND ANSWERS
S6 CSE
CS 63 OOAD
There is a separation of concern. (ie)Separation of higher level from lower level services
this reduces coupling and improves cohesion by using layers complexity is reduced.
11. What do you meant by separation of concern?
It is the responsibility of object in the layer should be strongly related to each other and
should not be mixed with the responsibility of other layer.
12. Define UI layer:
UI layer should focus on UI work such as creating windows, capturing mouse and
keyboard events.
13. Define domain layer:
It should focus on application logic such as calculating a sale total or taxes.
14. Define tier, layer and portioning:
Tier:
It always represents the logical layer. But not the physical node but the word has
become widely used to mean a physical processing node.
Layer:
In layered architecture, vertical slices are called as layers
Partitioning:
It represents horizontal division of relatively parallel subsystems of a layer.
15. What are the two types of interaction diagram?
sequence diagram
interaction diagram
16. Define sequence diagram:
It is in the form of fence format.
The new objects are added in the right side of the objects
17. What is the strength and weakness of sequence diagram?
Strength:
It clearly shows sequence or time ordering messages.
It has largest set of detailed notations
Weakness:
Forced to extent to the right when adding new object consumes horizontal spaces
18. What is the strength and weakness of communication diagram?
Strength:
Space is flexible to add new objects in two dimensions
Weakness:
More difficult to see sequences of messages only fewer notations are present
19. Give the syntax for basic message expressions:
Return: message(parameter parameterType):returntype
Prepared By S.Ramesh – AP/CSE
Page 9
2 MARKS QUESTIONS AND ANSWERS
S6 CSE
CS 63 OOAD
20. Define singleton objects:
If a class has only one instance, then it is called a singleton objects Object is marked with
one in the upper right corner of the lifeline boxes.
21. Define found messages:
Starting messages is called found messages. It is shown with a opening solid ball and
sender will not be specified and it is not shown where the messages is coming from.
22. What are the types of interaction frames?
o alt
o loop
o opt
o par
o region
23. Define classifier:
It is a model which describes the behavior and structure .it is also a specialized one in a
class diagram .They are the generalization of many of the elements including classes, interfaces
and use cases, actor.
24. Define abstract operation:
It is denoted by keyword called leaf
It is also denoted inside the curly braces. {Leaf}
25. Define dependency
The dependency relationship indicates the client element has the knowledge of another
supplier element. Any changes in the supplier element can affect the client. Dependency is
indicated as a dashed arrow line from the client to the supplier
26. Define constraints
Constraints are the conditions or instructions written in curly braces. It is commonly used
in class diagram. It is a restriction or condition in UML element
27. Define aggregation
It is a kind of association in UML and it is a whole part relationship the other name is
plane association it has no meaningful distinct semantics in UML
28. Define composition
It is a strong kind of relationship or whole part of aggregation the composition
relationship implies an instance of the path belongs to only one composite instance at a time.
29. What are the two types of notations for interface?
o socketline notation
o lollipop notation
Prepared By S.Ramesh – AP/CSE
Page 10
2 MARKS QUESTIONS AND ANSWERS
S6 CSE
CS 63 OOAD
30. Define active class
An active object runs on and controls its own thread of execution, then the class of an
active object is an active class
31. What are the three ways to show UML attribute?
attribute text notation
attribute as association in line notation
both together
Prepared By S.Ramesh – AP/CSE
Page 11
2 MARKS QUESTIONS AND ANSWERS
S6 CSE
CS 63 OOAD
UNIT-IV
1. What is GRASP?
General Responsibility Assignment Software Patterns (or Principles), abbreviated
GRASP, consists of guidelines for assigning responsibility to classes and objects in object
oriented design.
2. What is Responsibility-Driven Design?
A popular way of thinking about the design of software objects and also larger scale
Components are in terms of responsibilities, roles, and collaborations. This is part of a larger
approach called responsibility-driven design or RDD.
3. What is Responsibilities?
The UML defines a responsibility as “a contract or obligation of a classifier”.
Responsibilities are related to the obligations or behavior of an object in terms of its role.
4. What are the two responsibilities?
The responsibilities are of the following two types: doing and knowing.
Doing responsibilities of an object include:
doing something itself, such as creating an object or doing a calculation
initiating action in other objects
controlling and coordinating activities in other objects
Knowing responsibilities of an object include:
knowing about private encapsulated data
knowing about related objects
knowing about things it can derive or calculate
5. Define Pattern?
A pattern is a named and well-known problem/solution pair that can be applied in new
context, with advice on how to apply it in novel situations and discussion of its trade-offs,
implementations, variations, and so forth.
6. What are the GRASP patterns?
They describe fundamental principles of object design and responsibility assignment
which is expressed as patterns.
7. How to Apply the GRASP Patterns?
The following sections present the first five GRASP patterns:
Information Expert
Creator
High Cohesion
Low Coupling
Controller
Prepared By S.Ramesh – AP/CSE
Page 12
2 MARKS QUESTIONS AND ANSWERS
S6 CSE
CS 63 OOAD
8. Define Creator?
Creation of objects is one of the most common activities in an object-oriented system.
Which class is responsible for creating objects is a fundamental property of the relationship
between objects of particular classes.
9. What is Controller?
The Controller pattern assigns the responsibility of dealing with system events to a nonUI class that represents the overall system or a use case scenario. A Controller object is a nonuser interface object responsible for receiving or handling a system event.
10. Define Low Coupling?
Low Coupling is an evaluative pattern, which dictates how to assign responsibilities to
support:
low dependency between classes;
low impact in a class of changes in other classes;
high reuse potential
11. Define High Cohesion?
High Cohesion is an evaluative pattern that attempts to keep objects appropriately
focused, manageable and understandable. High cohesion is generally used in support of Low
Coupling. High cohesion means that the responsibilities of a given element are strongly related
and highly focused. Breaking programs into classes and subsystems is an example of activities
that increase the cohesive properties of a system.
12. What is Information Expert?
Information Expert is a principle used to determine where to delegate responsibilities.
These responsibilities include methods, computed fields and so on. Using the principle of
Information Expert a general approach to assigning responsibilities is to look at a given
responsibility, determine the information needed to fulfill it, and then determine where that
information is stored. Information Expert will lead to placing the responsibility on the class with
the most information required to fulfill it
13. What is singleton pattern?
The singleton pattern is a design pattern used to implement the mathematical concept of a
singleton, by restricting the instantiation of a class to one object. This is useful when exactly one
object is needed to coordinate actions across the system.
14. What is adapter pattern?
The adapter pattern is a design pattern that translates one interface for a class into a
compatible interface. An adapter allows classes to work together that normally could not because
of incompatible interfaces, by providing its interface to clients while using the original interface.
The adapter is also responsible for transforming data into appropriate forms.
Prepared By S.Ramesh – AP/CSE
Page 13
2 MARKS QUESTIONS AND ANSWERS
S6 CSE
CS 63 OOAD
15. What is Facade Pattern?
A facade is an object that provides a simplified interface to a larger body of code, such as
a class library. A facade can:
make a software library easier to use, understand and test, since the facade has convenient
methods for common tasks;
make code that uses the library more readable, for the same reason;
reduce dependencies of outside code on the inner workings of a library, since most code
uses the facade, thus allowing more flexibility in developing the system;
Wrap a poorly-designed collection of APIs with a single well-designed API (as per task
needs).
16. What is Observer pattern?
The observer pattern (a subset of the publish/subscribe pattern) is a software design
pattern in which an object, called the subject, maintains a list of its dependents, called observers,
and notifies them automatically of any state changes, usually by calling one of their methods. It
is mainly used to implement distributed event handling systems.
17. What is Visibility?
Visibility is the ability of an object to “see” or have reference to another object. More generally, it
is related to the issue of scope: Is one resource (e.g. instance) within the scope of another?
18. Give the types of Visibility?
There are four types of Visibilities. They are
Attribute Visibility
Parameter Visibility
Local Visibility
Global Visibility
19. What is attribute visibility?
Attribute visibility exists from an object A to object B when B is an attribute of A (Association).
It is a relatively permanent visibility because it persists as long as A and B exists. This is the most
common visibility in OO.
20. What is parameter visibility?
Parameter visibility exists from an object A to object B when B is passed as a parameter to a
method of A (Dependency). It is a relatively temporary visibility because it persists as only within the
scope of the method. This is the 2nd most common visibility in OO.
21. What is global visibility?
Global visibility exists from an object A to object B when B is globally visible (Dependency).
It is a relatively permanent visibility because it persists as long as A and B exists. This is the least
common visibility in OO. One way to achieve this, assign an instance to a global variable (possible in
C++but not in Java). The preferred method is to use the Singleton Pattern.
22. What is local visibility?
Local visibility exists from an object A to object B when B is declared as a local object in a
method of A (Dependency). It is a relatively temporary visibility because it persists only within the scope
of the method. This is the 3rd most common visibility in OO.
Prepared By S.Ramesh – AP/CSE
Page 14
2 MARKS QUESTIONS AND ANSWERS
S6 CSE
CS 63 OOAD
UNIT-V
1. What are UML state machine diagrams?
A UML state chart diagram illustrates the interesting events and states of an object, and the
behavior of an object in reaction to an event. Transitions are shown as arrows, labeled with their event.
States are shown in rounded rectangles.
2. Define events with an example
An event is a significant or noteworthy occurrence. It is a label associated with a transition that
identifies the message which causes a state change.
Example: A telephone receiver is taken off the hook.
3. Define state with an example
A state is the condition of an object at a moment in time—the time between events.
Example: A telephone is in the state of being "idle" after the receiver is placed on the hook and until it is
taken off the hook.
4. Define transition with an example
A transition is a relationship between two states that indicates that when an event occurs, the
object moves from the prior state to the subsequent state.
Example: When the event "off hook" occurs, transition the telephone from the "idle" to "active" state.
5. What are operation contracts?
Operation Contracts gives the more detailed or precise description of system behavior. Operation
Contracts use pre- and post- conditions to describe detailed changes to objects in the domain model, as a
result of the system operation.
6. Define pre and post conditions.
Preconditions are a constraint that must hold true before an operation is requested.
Post conditions are a constraint that must hold true after the completion of an operation.
7. What are the steps involved in mapping design to code?
Implementation in an object-oriented language requires writing source code for:
class and interface definitions
method definitions
8. What are deployment diagrams?
A deployment diagram shows the assignment of concrete software artifacts (such as executable
files) to computational nodes (something with processing services). It shows the deployment of software
elements to the physical architecture and the communication (usually on a network) between physical
elements
9. What is device node?
Device node (or device) is a physical (e.g., digital electronic) computing resource with processing
and memory services to execute software, such as a typical computer or a mobile phone.
10. What is execution environment node?
Execution environment node (EEN) is a software computing resource that runs within an outer
node (such as a computer) and which itself provides a service to host and execute other executable
software elements.
Example: an operating system (OS)
Prepared By S.Ramesh – AP/CSE
Page 15
2 MARKS QUESTIONS AND ANSWERS
S6 CSE
CS 63 OOAD
11. What is Component Diagrams?
The Component Diagram helps to model the physical aspect of an Object-Oriented
software system. It illustrates the architectures of the software components and the dependencies
between them.
12. What is State-Independent and State-Dependent Objects?
If an object always responds the same way to an event, then it is considered as state
independent (or modeless) with respect to that event.
State-dependent objects react differently to events depending on their state or mode.
13. What is a system operation?
System operations are operations that the system as a black box component offers in its
public interface
14. Define Operation in UML.
Operation is a specification of a transformation or query that an object may be called to execute.
An operation has a signature, specified by its name and parameters, and it is invoked via a message. A
method is specification of an operation with a specific algorithm.
15. Define a component.
A component represents a modular part of a system that encapsulates its contents and whose
manifestation is replaceable within its environment. A component defines its behavior in terms of
provided and required interfaces.
16. What is composite state?
Composite state can be broken down into substates. This can be done by nesting a state within a
state.
17. How to create code from interaction diagrams?
The sequence of messages in an interaction diagram will be translated into the series of
statements in method definitions
18. List out some complex reactive objects.
Physical devices controlled by software
Transactions and related objects
Role mutators
19. Define Guard Conditions.
Guard Conditions are a logical condition that will return only ”true” or “false”. A guarded
transition occurs only if the guard resolves to “true”.
20. What are the sections of the contract?
Operation
Cross reference
Preconditions
Postconditions
Prepared By S.Ramesh – AP/CSE
Page 16
Download