Object Oriented and Analysis with UML (part 2)

Objective: Architecture

You are designing an application that will be responsible for a library of books. These books are stored in a SQL 2000 database called pubs.

What is the term called that signifies a general design pattern of wrapping the infrastructure logic into a component?

Generalization
Facade
Brokering
Cohesion

Answer Explanation: Brokering is defined as an agent that acts for others (as negotiating contracts, purchases, or sales), in return for a fee or commission. In the case of programming terms, brokering is a general design pattern of wrapping the infrastructure logic inside a set of special-purpose classes that hides the logic from your domain model. An example of the infrastructure logic would be to access a database. You could have a class that accesses a particular type of database that could be re-used with many applications.

The option “Generalization” is incorrect. Generalization is the activity of finding a common set of concepts. A concept can be defined as a supertype (general concept) or subtype (specialized concept) relationship. This is not a term that signifies a general design pattern of wrapping the infrastructure logic into a component.

The option “Facade” is incorrect. A facade is a common interface to a disparate set of interfaces. This is not a term that signifies a general design pattern of wrapping the infrastructure logic into a component.

The option “Cohesion” is incorrect. Cohesion is a measure of the responsibilities of a class. How do the responsibilities measure to one particular task? A class with a high amount of responsibility and does not do much work has high cohesion.
================================================================================which of the following purposes should a use case be implemented?Answer: To document the high-end functionality a system provides to an actorTo illustrate the behavioral requirements of a process
Answer Explanation: The main purpose of a use case is to capture the high-end functionality requirements of a system or subsystem, without specifying any technical details about how the functionality will be realized. Use cases describe the sequence of events that should take place, including alternate and error sequences, when an actor interacts with a system.

The “To map the implementation of a discrete unit of functionality within a system” option is incorrect. A use case should not include any details about the internal structure or the implementation of the system functionality being described.

The “To illustrate the interaction between two or more classes” option is incorrect. A collaboration diagram is normally used to illustrate the interaction between classes. A use case documents the interaction between the system and an actor external to the system.

The “To document an individual step or activity within a larger scenario” option is incorrect. A use case normally includes a main path of events as well as alternate paths and error paths. Each specific path through the use case is known as a use case instance. Each instance describes a particular scenario. There are normally multiple scenarios associated with each use case.
=================================================================================Since superstates cannot be directly accessed, substates are used to enter superstates. Which of the following options are similar to this feature of superstates?

Abstract class
Concrete class
Aggregate class
Composite class

Answer Explanation: Superstates are represented by large rectangles with rounded corners that encompass the states. Superstates are like abstract classes, since abstract classes cannot be directly instantiated; instead, abstract classes need to be instantiated as part of a derivative. Superstates cannot be entered directly; superstates can only be entered as part of a substate. Substates are states within a superstate.

The option “Concrete class” is incorrect. Concrete classes can be directly instantiated. Since a superstate cannot be directly accessed, superstates are not similar to concrete classes. Abstract classes cannot be instantiated, making abstract classes very similar to superstates.

The option “Aggregate class” is incorrect. An aggregate class is the class that represents the whole part in an aggregation association, which does not make aggregate classes similar to superstates.

The option “Composite class” is incorrect. A composite class is a class that is related to one or more other classes by a composition relationship, which does not make composite classes similar to superstates.
=================================================================================
Which of the following symbols would best represent a condition-clause in the UML?

[x > y]
x > y
< x >
[x y]

Answer Explanation: A conditional clause is an iteration expression that represents the condition under which a particular message will be executed. You can represent conditionals based on the truth of a condition-clause. In the UML diagrams, you can express a condition-clause either using pseudocode or an actual programming language. An example of a condition clause ([condition-clause]) would be as follows:[x < y]

The option “x > y” is incorrect. A condition-clause in the UML is best represented by [x > y].

The option “< x >“ is incorrect. In this expression, there is no comparison that would represent the condition-clause.

The option “[x y]” is incorrect. In this expression, there is no comparison that would represent the condition-clause.
================================================================================
You are designing an interaction diagram. If the quantity of a product currently in stock falls below a certain level, you need to create a new order to replenish the inventory. You decide that this is best done by using a conditional message in your collaboration diagram.

Which of the following diagrams BEST represents a conditional message in your collaboration diagram?

Answer: A
Answer Explanation: Conditional messages mean that under certain conditions an action will be taken. Conditional messages are a means to determine if a certain message will be sent. To illustrate the message, you use square brackets ([]). When the condition in the square brackets becomes true, the message is sent. In this case, when the inventory falls beneath a determined level, the InventoryLow variable is set to true and the proper stock will be reordered. This can be demonstrated using an illustration presented in the image labeled A.

The “B” option is incorrect. The proper way to illustrate conditional messages in collaboration diagrams is by using syntax similar to [InventoryLow]: Reorder to conditionally order new inventory if the InventoryLow variable is set to true.

The “C” option is incorrect. Using round brackets do not illustrate conditional messages. To show conditional messages in collaboration diagrams, syntax similar to [InventoryLow]: Reorder is used to conditionally order new inventory if the InventoryLow variable is set to true.

The “D” option is incorrect. Double quotes do not show conditional messages. The proper way to illustrate conditional messages in collaboration diagrams is using syntax similar to [InventoryLow]: Reorder to conditionally order new inventory if the InventoryLow variable is set to true.
==================================================================================
Multiplicity is a specification of the range of legal values for a particular component or set.

Which diagrams normally use multiplicity? (Choose all that apply)

Use case diagrams
Class diagrams
State diagrams
Activity diagrams

Only class diagram

Answer Explanation: Class diagrams usually use multiplicity to specify the number of objects in the particular role. The multiplicity is attached to each association end.

The “Use case diagrams” option is incorrect. Use case diagrams specify the relationship between actors and the requirements of the system. Multiplicity is not needed in this type of diagram, since there is usually only one actor related to one instance of a use case.

The “State diagrams” option is incorrect. State diagrams show the possible states that an object can be in at any given time and specify the events that can change the object’s state. Since they normally deal with a single class, state diagrams have no use for multiplicity.

The “Activity diagrams” option is incorrect. An activity diagram shows the sequence of activities within a process or system. It does not show multiplicity.
===============================================================================
You are using certain OOAD artifacts to determine the functional requirements for a system.

Which one of the following cannot be used to capture non-functional requirements?

Class diagrams
Use cases
Interaction diagrams
State diagrams

Answer: Use Cases
Answer Explanation: Use cases cannot be used to capture non-functional requirements. Non-functional requirements include scalability, maintainability, etc. Use cases can however, capture functional requirements, and they drive all other project activities.

The option “Class diagrams” is incorrect. Class diagrams represent the structure of the system under development.

The option “Interaction diagrams” is incorrect. Interaction diagrams are used to model the dynamic behavior of the system.

The option “State diagrams” is incorrect. State diagrams are used to show how a single object behaves across many use cases.
=================================================================================
You are updating an existing project that handles car rentals. You need to modify the existing model. You are given a legacy database diagram, the use case requirements for the project, and an existing partial modeling class diagram

You note that the class diagrams and database schema do not exactly match the model and table relationships; however, all state data exists in both. Based on this information, what advice can you offer? (Choose all that apply)

The relationships that exist in the class diagram and the database schema do not have to precisely match and no changes are needed in this aspect.
The relationships in the class diagram should be changed to match the database schema, since the database is used by legacy systems.
The class diagram should be changed to capture the database fields, since the most important portion of a class diagram is the data.
The class diagram should be expanded to include all of the required behaviors.

Answer Explanation: The database schema contains a description of the data model to be used for storage and retrieval of data in a database. To represent the database schema in a UML model, you use the «schema» stereotype in a package. Class diagrams can be used to represent the database schema. The class diagrams in this scenario are unnecessary to change, since all state data exists in both the database schema and class diagrams. Class diagrams are used to show you the static nature of your system. In a class diagram, the first compartment represents the class name, the second shows the class’ structure (attributes), and the third compartment represents the class’ behavior. A class diagram should include classes that have the structure and behaviors defined.

The option “The relationships in the class diagram should be changed to match the database schema, since the database is used by legacy systems” is incorrect. The class diagrams in this scenario are unnecessary to change, since all state data exists in both the database schema and class diagrams.

The option “The class diagram should be changed to capture the database fields, since the most important portion of a class diagram is the data” is incorrect. Class diagrams are used to show you the static nature of your system. In a class diagram, the first compartment represents the class name, the second shows the class’s structure (attributes), and the third compartment represents the class’s behavior.
=================================================================================
Which diagram displays the correct use of generalization?

Answer: B
Answer Explanation: A generalization relationship between classes is indicated by a line with a hollow triangular arrowhead running from the more specific to the more general class.

The “A” option is incorrect. The hollow triangular arrowhead is the correct representation of a generalization relationship but must run from the more specific to the more general class.

The “C” and “D” options are incorrect. A line with an open arrowhead between classes represents an association relationship.

=================================================================================
You are discussing the requirements of a department store system with the manager of the store. After taking notes in an informal requirements document, you decide to create use cases.

Which list contains the most appropriate terms to be used in your use cases?

End user, manager object, customer object, and product array
Employee interface, customer interface, product container, and print queue
Employee, customer, products, and receipt
Employee ID, customer, product cache, and printer interface

Answer Explanation: Use cases should always use the language of the domain. They are created from the point of view of users of the system (in this case, most will be cashiers), who may know very little about object-oriented design or programming terms.

All other options are incorrect. Programming terms such as object, array, interface, container, queue or cache should not be included in use cases.
=================================================================================

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: