Object Oriented Analysis and Design (part 8)

Objective: Requirements Modeling

You are part of the development team that has just been hired to design the system for a small online music store. You are under time and budget constraints. After consulting with various employees, you have extracted the following requirements.

A customer will be able to create an account with the site if they do not already have one. To purchase a CD, customers will be able to browse the catalog or search for a particular CD. Once a customer selects a CD and payment type and commits their purchase, the system will log the transaction, adjust the inventory, and print a receipt. Once the transaction is logged, the system will send an email to the sales department, which then uses the system to fill the order.

Which is the BEST list of possible use cases?

Create account, buy CD, and fill order
Create account, buy CD, print receipt, and fill order
Create account, select CD, buy CD, print receipt, and fill order
Create account, browse catalog, search for CD, select CD, buy CD, log transaction, adjust inventory, print receipt, send email, and fill order
Answer Explanation: A use case is normally used to explain a process in its entirety, from beginning to end. It involves the complete sequence of events in the process, including alternate and error sequences. Use cases, especially initial use cases, normally illustrate high-level functionality based on business requirements that must be implemented in the system. Create account, buy CD, and fill order are all essential business processes.

All other options are incorrect. Procedures such as print receipt and log transaction are not very well suited to be separate use cases. Since actions such as these would contain some implementation details, which are not included in use cases, it is better to include them as a step in a larger use case.

=================================================================================
Objective: Design and Implementation Techniques
You are using a model of your application to generate code. The generated code directly reflects the model of your unfinished application, including associations between classes and the operations and attributes that make up the classes. When you are developing the application, you find it necessary to add classes, attributes, and operations to existing classes.

Which of the following terms updates your model with any changes that you may make during coding?

Reverse engineering
Reverse tripping
Round tripping
Round engineering
Answer Explanation: Round tripping engineering helps to keep your code synchronized with your model. If modifications are made during the coding process, you can reverse engineer your code to keep your model synchronized with your application code. Reverse engineering refers to creating models from existing components and applications.

The option “Reverse engineering” is incorrect. Reverse engineering refers to creating models from existing components or applications. Round tripping synchronizes your code with your model and vice versa.

The option “Reverse tripping” is incorrect. This is a fictitious term in relation to the UML.

The option “Round engineering” is incorrect. This is a fictitious term in relation to the UML.

=================================================================================
Which of the classes properly use stereotypes?
Answer: A, C, D
Answer Explanation: Stereotypes are a kind of model element, defined in the model itself. Stereotypes are used to classify elements and are normally shown in text between guillemets (« »).

The “b” option is incorrect. An element can have at most one stereotype.

==================================================================================
Objective: Static Modeling
Which of the following are true regarding interfaces? (Choose all that apply)

An interface can provide implementation for some of its methods, but not all.
Interfaces cannot have attributes.
Interfaces can have generalization relationships.
All operations in an interface have to be public.
Answer Explanation: An interface is a set of operations that make up the externally visible functionality of a class. Interfaces provide only the specification and do not include any implementation details. There can be no attributes specified in an interface. If attributes are required, an abstract class must be used instead. All operations of an interface are public. Since there is no inside implementation in an interface, there would be no purpose to restricting the visibility of the operations. Interfaces can extend other interfaces. A child interface inherits the operations of the parent interface and can also add operations of its own.

The “An interface can provide implementation for some of its methods, but not all” option is incorrect. An interface cannot provide an implementation for any of its operations. Only abstract classes can be used to accomplish this.

=================================================================================
Objective: Dynamic Modeling
You are creating models that are the result of various development phases within the iterative development process. The development process consists of the inception, elaboration, construction, and transition phases.

Which of the following best represents the correct order of the modeling stage?

Analysis, deployment, design, implementation
Analysis, design, implementation, deployment
Implementation, analysis, deployment, design
Design, analysis, deployment, implementation
Answer Explanation: The development processes have one or more iterations, represented by the modeling stage. The iterations contain model elements that are moved along a path of analysis, design, implementation, and deployment.

The option “Analysis, deployment, design, implementation” is incorrect. The deployment process is the final process within the modeling stage, making the suggested order in this option incorrect.

The option “Implementation, analysis, deployment, design” is incorrect. The analysis process is the first process within the modeling stage and the design process comes before the implementation process, making the suggested order presented in this option incorrect.

The option “Design, analysis, deployment, implementation” is incorrect. The analysis process is the first process within the modeling stage and the design process comes before the implementation process. Also, the deployment process is the final process, making the suggested order presented in this option incorrect.

=================================================================================
Objective: Static Modeling
While working on the first iteration of a project, you discover that a class you have created does not have an identity that is important to the system, in the context of your application, but still needs to be implemented in the system.

Which would be the most likely way to implement the class?

As an attribute of another class
As an interface
As a method of another class
As an abstract method of another class
Answer Explanation: Objects can be broken down into two basic categories: reference objects and value objects. Reference objects are objects such as customer or order. These types of objects will almost always need to be implemented as classes in a system to capture all the necessary functionality of that class. Value objects are objects like date, or destination, which may or may not need to be implemented as a class depending on the context in which they are used. Consider the destination object for example. If you are designing a system in which an airplane is a major part, destination may be best implemented as a separate airport class. On the other hand, if an airplane is a miniscule part of the application, implementing destination as an attribute of the airplane class may suffice.

The “As an interface” option is incorrect. An interface allows you to define the interface but defer its implementation until later. However, the identity of an interface is still important.

The “As a method of another class” option is incorrect. A method implements a piece of functionality or behavior within a system. An object would not be implemented as a method.

The “As an abstract method of another class” option is incorrect. An abstract method is one that is declared but does not have any implementation details. An object would not be implemented as a method.

=================================================================================
Objective: Development Process
During an interview with your client, the following conversation occurred:

Client: “We need a system that allows entries of work time at the end of the day. Many of these entries will be entered simultaneously.”

You: “OK, so you want to develop a system that acts like a queue and processes each request in a first-in first-out basis, right?”

Client: “That is correct. The first user’s request will take place and the next request will wait for the update. The TimeSheet will then be updated with the new hours worked.”

You: “Excellent. So you need a TimeSheet that holds the time spent doing the daily routines at work….”

After analyzing the above scenario, what are some terms that you can use in related use cases?

Entry, Queue, Container
Entry, TimeSheet
Entry, Queue, TimeSheet, Container
Queue, Container
Answer Explanation: Both Entry and TimeSheet are good use cases that can be extracted from this scenario. Use cases are specifications of a sequence of interactions between an actor and the computer system. Use cases describe the user-visual functionality. Entering data in the Entry use case and viewing the time sheet information in the TimeSheet use case are the only valid options for use cases.

The option “Entry, Queue, Container” is incorrect. Neither Queue nor Container describes the user-visual functionality of a use case.

The option “Entry, Queue, TimeSheet, Container” is incorrect. Queue and Container do not describe the user-visual functionality of a use case.

The option “Queue, Container” is incorrect. The Queue and Container selections do not describe the user-visual functionality of a use case.

=================================================================================
Which component of the class diagram is considered a role name?
Answer Explanation: A line drawn between two classes specifies an association. Each association has two association ends, often called roles. A role name is a label attached to an association end, in this case, items.

The “*” option is incorrect. Multiplicity can also be indicated on an association end. It can be indicated with numbers or an asterisk, which signifies many.

The “name” option is incorrect. Name, as it appears in this class diagram, is an attribute of the Customer class.

The “Customer” option is incorrect. Customer is one of the classes in the diagram.

The “Product” option is incorrect. Product is a class in the diagram, even though it does not specify any attributes or methods.

The “authorizeCharge()” option is incorrect. This is a method of the Credit Card class.

================================================================================
Objective: Dynamic Modeling
Which of the following statements are true concerning incremental development?

Iterative development is composed of many incremental development phases.
Incremental development is composed of many iterative development cycles.
Incremental development refines the system through the same requirements.
Incremental development defines the system in one iterative step.
Answer Explanation: Incremental development is performed by refining the system through each release. As the builds of your project increase, the associated functionality is also increased. An incremental development is associated with many iterative development phases. With frequent incremental releases, you can gain benefits for your project, such as the following:

Early integration and system testing
Early feedback from client on proposed solution
Trust and satisfaction from the user community (assuming the early release of the system is a success)
Trust from the development team with development of the final product

The option “Iterative development is composed of many incremental development phases” is incorrect. Incremental development is composed of many iterative development cycles.

The option “Incremental development refines the system through the same requirements” is incorrect. Iterative development is used to refine the system through the same requirements.

The option “Incremental development defines the system in one iterative step” is incorrect. Incremental development defines the system through several release cycles. Incremental development contains many iterative development cycles, not just one.

=================================================================================
Objective: Static Modeling
Which of the following are true regarding subclassing? (Choose all that apply)

A subclass may have additional attributes of interest.
A subclass cannot have additional associations.
An instance of a subclass should always be able to serve as an instance of its superclass.
A subclass inherits only the interface of the superclass, not the implementation.
Answer Explanation: One good reason for subclassing is when the subclass has additional attributes that do not fit well with the superclass. A subclass has to support all methods and attributes of the superclass. This ensures that a subclass can fulfill the role of the superclass, which is the basis of polymorphic operations.

The “A subclass cannot have additional associations” option is incorrect. This statement is false. A subclass may have additional associations of interest, which is another good reason for subclasses to be created.

The “A subclass inherits only the interface of the superclass, not the implementation” option is incorrect. With subclassing, the subclass inherits both the interface and the implementation of the superclass.

================================================================================
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: