Object Oriented Analysis and Design (part 7)

Objective: Architecture
In designing your application, there may be times that multiple threads will be processing requests simultaneously. You can instruct each thread how to behave in this type of environment by setting the concurrency level on each operation.

Which of the following are concurrency options that you can set on operations?

Synchronous
Guarded
Asynchronous
Sequential
Answer Explanation: There are three behaviors that an operation will react to in the presence of multiple threads of control, which are:

Sequential – Only one thread will run at one time. Once the initial thread completes its execution, the second thread of control will run.

Guarded – Classes will collaborate together to ensure each thread is completing its task exclusively. This allows the operations to run smoothly with multiple threads of control.

Synchronous – Operations will perform correctly when run with multiple threads of control. The operation will complete one thread; however, other operations can run other threads simultaneously. Collaboration is not required, since the class takes care of mutual exclusion issues.

The option “Asynchronous” is incorrect. Asynchronous is not a behavior of how an operation will react in the presence of multiple threads of control.

==================================================================================
Objective: Static Modeling
Which of the following statements are true concerning delegation?

Delegation can be used as an alternative to inheritance.
Delegation is a mechanism for implementing polymorphism.
Delegation is specified in a UML diagram with a broken line and hollow triangular arrowhead.
Delegation promotes reuse.
Answer Explanation: Delegation is implemented by an object issuing a message to another object in response to a message. Instead of using inheritance to have a class implement functionality, the class can simply delegate or pass requests or messages to another class for processing. This can achieve the same results as inheritance in an environment where inheritance is not desired. Delegation is a form of interface reuse whereas inheritance is a form of implementation reuse.

The “Delegation is a mechanism for implementing polymorphism” option is incorrect. Delegation is a way to employ reuse of interfaces. Polymorphism is realized by having objects that can take on new forms in subclasses.

The “Delegation is specified in a UML diagram with a broken line and hollow triangular arrowhead” option is incorrect. Since delegation is basically a passing of responsibility, it can be modeled with normal association or aggregation relationships. The broken line and hollow triangular arrowhead signifies an interface implementation relationship.

==================================================================================
Objective: Requirements Modeling
In the Unified Modeling Language, which BEST represents potential actors for an online music store? (Choose all that apply)

An order form
A database administrator
A customer
A compact disc
A printer
Answer Explanation: An actor is an entity that interacts with but is external to the application. Typically, an actor either inputs information into or receives information from the application. This can be a human actor, such as a customer or database administrator, or a non-human actor, such as an external computer system or printer.

The “An order form” option is incorrect. An order form would be part of the system and therefore, is not an actor.

The “A compact disc” option is incorrect. A compact disc is an entity but is not external to the system. It may be better represented as a class within your system.

==================================================================================
Objective: Design and Implementation Techniques
You are redesigning an application that has only a few large classes, which serve the responsibility of the application. You want to make these classes smaller and more efficient.

What is the term that represents this type of design?

Cohesion
Refactoring
Coupling
Pattern
Answer Explanation: When designing an application, you may find it necessary to rename classes, redesign code into multiple methods, or even move classes between packages. This is known as refactoring. You can reassign responsibilities to other classes, resulting in lowering the cohesion of a class. Refactoring an application results in changing the internal structure, in small steps, to make it easier to understand and use.

The option “Cohesion” is incorrect. Cohesion is a measure of the responsibilities of a class. If a class has low cohesion, it means that the class does too much work or many unrelated tasks. These types of classes are hard to comprehend, reuse and maintain. This type of class is good to redesign through refactoring.

The option “Coupling” is incorrect. Coupling defines how much one class depends on another class. Low coupling occurs when a class does not largely depend on another class, whereas a class with high coupling greatly depends on another class for its existence. Refactoring deals with renaming and moving classes in your program design.

The option “Pattern” is incorrect. A pattern is a description of general principles and idiomatic solutions that help you develop software. The type of design in this question is best represented by refactoring.

==================================================================================
You are developing an ordering application that will be used at a local shoe factory. The application will take an order, and process the order line by line to fill the order. You are designing the activity diagram that will be used to show the concurrent action of the order line items being filled.

Which of the following diagrams is the BEST example to show dynamic concurrency in the Fill line order transition in an activity diagram?

Answer: C
Answer Explanation: Dynamic concurrency invokes actions or sub activities multiple times in parallel, based on an expression. They show iterations without the need to construct a loop in an activity diagram. A multiplicity marker (*) is used to show that an activity occurs many times. The final transition to complete the delivery is only executed once the Fill Line Items transition has finished.

The “A” option is incorrect. The percent sign (%) is not used to show multiplicity in a dynamic concurrency model in an activity diagram. To show dynamic concurrency in an activity diagram, you would use the multiplicity marker (*).

The “B” option is incorrect. The dollar sign ($) is not used to show multiplicity in a dynamic concurrency model in an activity diagram. You must use the multiplicity marker (*) to show dynamic concurrency in an activity diagram.

The “D” option is incorrect. The ampersand sign (&) is not used to show multiplicity in a dynamic concurrency model in an activity diagram. A multiplicity marker (*) is used to show dynamic concurrency in an activity diagram.

=================================================================================
Which of the following diagrams illustrates a package dependency?

Answer: C

Answer Explanation: The proper method to illustrate a package dependency in the Unified Modeling Language (UML) is to draw the packages with a connected broken line and point to the package on which the first package depends. The presence of a dependency in a package implies that elements inside of one package depend on elements inside the second package. Package-level dependency does not contain further information; it is only a summary.

The “A” option is incorrect. This option suggests that there is no dependency between the two packages.

The “B” option is incorrect. This option suggests that there is no dependency between the two classes.

The “D” option is incorrect. This option suggests that there is a dependency between two classes, not two packages.

=================================================================================
Objective: Architecture
Which of the following are reasons to group classes into packages? (Choose all that apply)

When the classes share the same use cases
When the classes have strong associations with one another
When the classes are closely related to the same subject area
When the classes share the same class hierarchy
Answer Explanation: There are a number of reasons why classes should be grouped together into packages, including:

When classes are closely related to the same subject area, concept, or purpose
When classes have the same class hierarchy or use case
When classes have a strong association with one another
When classes are used by many packages

In order for a package to be workable, the allocation must follow a rational process, such as common functionality, common viewpoint, or tightly coupled implementation.

==================================================================================
You are designing a system that schedules seating for hockey games. The diagram of the TicketSales use case is as follows,
Which of the following labels would best describe lines 1, 2, and 3 respectively?

Extends, includes, includes
Includes, extends, extends
Includes, includes, extends
Extends, extends, includes
Includes, includes, includes
Answer Explanation: You would use the «includes» relationship when you have a chunk of material that is repeated in two or more separate use cases and you wish to avoid this repetition. In this case, the Purchase Ticket use case would include the Search for seats for hockey games use case. You would use the «extends» relationship when describing a variation on normal behavior and need further control, by declaring your extension points in your base use case. In this case, the Ticket Delivery use case can be mailed or picked up at the box office, which is represented by the Pickup Ticket and Mail Ticket use cases.

The option “Extends, includes, includes” is incorrect. These are not the proper relationships between the use cases presented in the diagram. The first relationship should be the «includes» relationship, since the Purchase Ticket use case would include a search feature for available seats. The second and third relationship would be «extends» relationships, since the Pickup Ticket and the Mail Ticket use cases would extend the Ticket Delivery use case.

The option “Includes, includes, extends” is incorrect. These are not the proper relationships between the use cases presented in the diagram. The first relationship should be the «includes» relationship, since the Purchase Ticket use case would include a search feature for available seats. The second and third relationship would be «extends» relationships, since the Pickup Ticket and the Mail Ticket use cases would extend the Ticket Delivery use case.

The option “Extends, extends, includes” is incorrect. These are not the proper relationships between the use cases presented in the diagram. The first relationship should be the «includes» relationship, since the Purchase Ticket use case would include a search feature for available seats. The second and third relationship would be «extends» relationships, since the Pickup Ticket and the Mail Ticket use cases would extend the Ticket Delivery use case.

The option “Includes, includes, includes” is incorrect. These are not the proper relationships between the use cases presented in the diagram. The first relationship should be the «includes» relationship, since the Purchase Ticket use case would include a search feature for available seats. The second and third relationship would be «extends» relationships, since the Pickup Ticket and the Mail Ticket use cases would extend the Ticket Delivery use case.

================================================================================
Objective: Development Process
Basically, a use case is a chunk of functionality that will be provided to the overall system. Use cases can be thought of as services that a customer requires. Use cases are written in a manner that is easy for the end users to understand and describe what the system will do. Interaction diagrams are created from these use cases.

When scheduling project activities based on use cases, which of the following are good candidates to consider for development in early iterations? (Choose all that apply)

Options that may impact the architectural design
Options that may involve new technologies
Options that represent the primary line of business
Options that involve well-established existing technologies
Answer Explanation: Iterations are ranked on risks, coverage, and criticality. Criticality refers to the amount of business value that the requirement provides for the business. Early iterations may influence later analysis and design of your system. You can design project activities from use cases. Good candidates to consider for project activities early in your development include the following:

Options that impact the architectural design – Since the design of your system will be a major factor, redesigning parts of your system later may result in unnecessary additional work.

Options that may involve new technologies – New technologies may involve risky software that may change, which can result in a possible redesign of parts of your system.

Options that represent the primary line of business – Project activities that relate to the primary line of business should be dealt with early in the development process because these tasks are paramount to your software development.

The option “Options that involve well-established existing technologies” is incorrect. Use cases for well-established technologies do not need to be developed in the early stages of software development.

=================================================================================
Objective: Static Modeling
Which of the following are valid ways to specify an interface in a class diagram? (Choose two)

A rectangle symbol with the «interface» keyword
A small hollow circle symbol with the name of the interface below it
A rectangle with rounded edges with the name of the interface below it
A small solid circle with the name of the interface below it
Answer Explanation: An interface can be modeled in one of two ways; either with a class symbol with the «interface» keyword, or a small hollow circle symbol with the name of the interface below it. An interface basically specifies a set of operations that are visible to the client, without specifying the internal structure of the operations.

The “A rectangle with rounded edges with the name of the interface below it” option is incorrect. Rounded rectangles are used to represent states in state diagrams.

The “A small solid circle with the name of the interface below it” option is incorrect. A solid circle is used to represent the starting point in an activity diagram or state diagram.

=================================================================================
Objective: Dynamic Modeling
You are creating a state diagram for a local college. In your state diagram, you will show how events affect an object.

Which of the following statements are true concerning the use of events in state diagrams? (Choose all that apply)

State diagrams can show events in a sequential sequence.
State diagrams can show events in a concurrent sequence.
State diagrams can show events in a recursion sequence.
State diagrams can show events in an abstract sequence.
Answer Explanation: State diagrams are used to show how an object will live throughout various states within your system. State diagrams can show sequential sequence and concurrent sequence. Events will occur one after another (sequential sequence) or in parallel (concurrent sequence).

The option “State diagrams can show events in a recursion sequence” is incorrect. A sequence diagram can show recursion, where an object will send a message to itself. State diagrams can show events in a sequential and concurrent sequence.

The option “State diagrams can show events in an abstract sequence” is incorrect. Abstract is a keyword used with classes. An abstract class is a class that does not have enough state to be instantiated on its own. Abstract classes need to be subclassed to be instantiated. State diagrams can show events in a sequential and concurrent sequence.

=================================================================================
Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: