Object Oriented and Analysis with UML (part 6)

Objective: Architecture

When designing packages that are to be cohesive, reusability is a key factor.

Which one of the following is a key factor in determining a package with a high level of cohesion?

Creating elements that do not have a specific purpose, but have a range of functionality
Creating many elements that complete individual tasks, which form together to complete an overall goal
Creating one element that completes many specific tasks to complete an overall goal
Creating course-grained elements
Answer Explanation: When you design a system, you should strive to get a high degree of cohesion in your system. The elements found in a system with a high level of cohesion are focused on performing individual tasks. Each task combines to complete the overall purpose of the system. Having classes that only perform an individual task will promote reuse within your classes. Cohesive packages with fine-grained classes promote reusability as the fine-grained classes can be combined together to provide course-grained functionality.

The option “Creating elements that do not have a specific purpose, but have a range of functionality” is incorrect. Elements designed in this nature will have a low cohesion factor, where the element cannot be easily reused in another application.

The option “Creating one element that completes many specific tasks to complete an overall goal” is incorrect. Elements formed in this manner do not conform to the rules of cohesion, where the overall goal of the element is not well defined. Elements of this type are coarse-grained, resulting in a lack of cohesion in your application, where the elements are not easily reused.

The option “Creating course-grained elements” is incorrect. Coarse-grained elements lack cohesion as they cannot easily be reused. For a highly cohesive system, you would want to design elements that are fine-grained. These fine-grained classes can be assembled together to complete the overall system.

==================================================================================
Objective: Architecture
You are designing a software system. There are five key views in designing your system: logical view, process view, use-case view, implementation view, and deployment view. The main actors in the process view are system integrators.

What will have the most influence on the actions of the system integrators in the process view?

Functionality
Structure
Software management
System topology
Performance
Answer Explanation: The process view of a system is a description of the system’s decomposition. It is broken down into processes and tasks, as well as the communication and synchronization among concurrent elements. This view is important to system integrators, who will address the performance, scalability, and throughput of the system.

The option “Functionality” is incorrect. The use case view deals with the functionality of a system and what the end user will see. The process view deals with performance of the system.

The option “Structure” is incorrect. The logical view structures the system and can be used to gain vocabulary to describe the system. The process view deals with performance of the system.

The option “Software management” is incorrect. The implementation view deals with software management. The implementation view of a system captures the artifacts as seen by programmers. The process view deals with performance of the system.

The option “System topology” is incorrect. The deployment view deals with the system that is necessary for deployment. The process view deals with performance of the system.

=================================================================================
Objective: Static Modeling
Through which type of relationship does a class connect to an interface?

Generalization
Realization
Association
Dependency
Answer Explanation: Although a realization relationship can be used in other situations, it is mainly used to connect a class to an interface. When a class realizes an interface, it must provide implementation for the operations specified in the interface.

The “Generalization” option is incorrect. A generalization relationship is a relationship between a more general component and a more specific component. This relationship is the basis of inheritance.

The “Association” option is incorrect. Associations are relationships between instances of classes; such as a company has employees. It cannot be a relationship between a class and an interface.

The “Dependency” option is incorrect. This is a relationship where one class delegates responsibility to another class.

=================================================================================
Objective: Development Process
You are designing a system. As the system grows, it becomes more complex, and contains many classes.

Which of the following can be done to structure and organize the architecture of your system? (Choose two)

Maximize dependencies between packages to improve performance.
Group classes with similar purposes into organized packages and define a public interface for each package.
Place view class, model classes, and infrastructure classes in every package.
Use layers to design your system.
Answer Explanation: Grouping classes with similar purposes into organized packages and using layers to design your system would structure and organize the architecture of a large complex program. Packages should contain elements that provide a common service with high coupling and collaboration. Packages should not have coupling and collaboration between elements of other packages. You should layer the design of your application so that common types of packages are in the same layer.

The option “Maximize dependencies between packages to improve performance” is incorrect. Packages that are dependent on other packages are coupled to the elements of the target package. Since changing one package may affect another package that is coupled to the package that you are changing, increasing the package dependencies will not organize or structure the architecture of your system.

The option “Place view class, model classes, and infrastructure classes in every package” is incorrect. Keeping the layers of your design separate, such as the view classes, model classes, and infrastructure classes, will keep coupling low and result in a well designed application.

==================================================================================
Objective: Dynamic Modeling
When creating state diagrams in UML, you define a number of states that a single class can have. This makes state diagrams useful for showing the lifecycle of a class.

Which of the following best describes the response of an object to an event?

Activities and reactions
Activities and actions
Actions and reactions
Activities, actions, and reactions
Answer Explanation: A state diagram defines the external stimuli of the system, which are the events. These events cause activities and actions to occur. You use activities and actions to describe the response of an object to an event. An activity is associated with a state and is used for control purposes, where an action is associated with an event, but is not relevant for control purposes.

The option “Activities and reactions” is incorrect. Activities and actions are used to describe the response of an object to an event, not activities and reactions. The term ‘reactions’ is not a UML defined keyword.

The option “Actions and reactions” is incorrect. Activities and actions are used to describe the response of an object to an event; reactions is an invalid term.

The option “Activities, actions, and reactions” is incorrect. Only activities and actions are used to describe the response of an object to an event; reactions do not describe the response of the object to the event.

=================================================================================
Objective: Development Process
An interface is a descriptor for external operations of a class. A class may support many interfaces and many classes may implement the same interface.

Which of the following are true statements about interfaces? (Choose all that apply)

An interface contains a collection of operations.
An interface defines a service that a supplier provides.
An implementing class must declare all operations in the interface.
An implementing class can add more operations than the interface provides.
Answer Explanation: An interface specifies a service of a class by a collection of operations it contains. An interface does not offer any definition of its operations. Any class that implements an interface will need to declare all of the operations in the interface and add additional operations as needed.
==================================================================================
You are designing a state diagram for your new stereo system software. You are trying to determine how you can best show a mute button that controls the volume level. You create the state diagram displayed in the exhibit
Which of the following software components could be derived from the state diagram in the exhibit? (Choose all that apply)

A Volume object that has a level integer and an On attribute of type boolean, with methods to increase and decrease the volume level of the stereo
A condition that increases the volume if the On attribute is set to true
A condition that decreases the volume if the On attribute is set to true
All of the options are correct
Answer Explanation: State diagrams show the life-cycle of an object. In a state diagram, guard conditions are shown encompassed in square brackets ([]). In this state diagram, there is a Volume object that has a level attribute of type integer, and an On attribute of type boolean with methods to increase and decrease the volume level of the stereo. The level attribute controls the level of the stereo. The On attribute indicates if the mute button is on or off. The object would need methods to control the level of volume, such as an increaseVolume method and a decreaseVolume method.

The option “A condition that decreases the volume if the On attribute is set to true” is incorrect. With the On attribute set to true, the condition displayed in the exhibit would guard against an increase in volume.

The option “All of the options are correct” is incorrect. Not all of the statements concerning software components that could be derived from the state diagram are true.

=================================================================================
Objective: Static Modeling
Which of the following give indications as to which methods will exist in the system design? (Choose two)

Messages between objects in a collaboration diagram
Nouns in use cases
Verbs in use cases
Messages between nodes in a deployment diagram
Answer Explanation: The messages between objects in collaboration diagrams and sequence diagrams represent the responsibilities of the object receiving the message. These responsibilities translate into methods in the software design.

Verbs in a use case are a good indication of the required operations for the system. They are normally implemented as methods in classes.

The “Nouns in use cases” option is incorrect. Nouns in use cases are representative of potential classes, not methods.

The “Messages between nodes in a deployment diagram” option is incorrect. A deployment diagram shows the distribution of software components in relation to the hardware components of a system. Deployment diagrams would not give any indication of the methods in the system.

==================================================================================
Objective: Development Process
You are redesigning a system that an ex-coworker designed. You determine that there are better ways to achieve a more effective placement of responsibilities. You move several methods from one class to another class.

What OOAD artifacts will need to be updated to reflect the changes that you have made? (Choose two)

Use cases
Class diagrams
State diagrams
Interaction diagrams
Activity diagrams

// <![CDATA[
if(navigator.appName.indexOf("Microsoft") != -1){
if(document.all){ //Not for IE4 or IE5.0
if(navigator.userAgent.indexOf('MSIE 4.') <0 && navigator.userAgent.indexOf('MSIE 5.0')

Answer Explanation: When refactoring public methods from one class to another, the class diagrams and interaction diagrams may need to be updated to reflect these changes. A class diagram is a graphical representation of the model elements, such as classes, types, and their contents and relationships. Changing a method from one class to another might affect the contents of the class diagram. A class diagram contains certain elements whose dynamics are expressed using other diagrams, such as collaboration diagrams. An interaction diagram is a generic term that applies to types of diagrams that emphasize object interactions. These include collaboration and sequence diagrams.

The option “Use cases” is incorrect. Use cases are a representation of the internal structure of the system and will not require updating if the internal components of a class are modified.

The option “State diagrams” is incorrect. State diagrams are used to model complex, dynamic behavior of classes. It shows the life cycle of objects within a class as they are moved between states. State diagrams are not updated if the internal components of a class are modified.

The option “Activity diagrams” is incorrect. An activity diagram is a diagram that shows an activity graph. An activity graph shows a procedure or a workflow. These are special cases of state that are triggered by the completion of activities in the source states. Activity diagrams are not updated if the internal components of a class are modified.

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