Which feature of a UML model element could NOT be adapted by a Stereotype?
- A . Notation could be changed.
- B . Constraints could be added
- C . Constraints can be removed.
- D . Attributes and Operations could be added.
C
Explanation:
A stereotype in UML is a powerful extension mechanism that allows developers to tailor UML models for particular domains or platforms. Stereotypes can adapt UML model elements by adding constraints, changing notation, and adding attributes and operations. However, they cannot remove existing constraints from a model element12.
Notation Change (A): Stereotypes can indeed change the notation of a model element to make it more expressive or domain-specific. For example, a stereotype could be used to visually distinguish between different kinds of classes in a class diagram1.
Adding Constraints (B): Stereotypes can add new constraints to a model element to specify additional rules or requirements that are not defined by the standard UML1.
Removing Constraints ©: This is not a capability of stereotypes. Constraints define rules that must be followed, and once they are part of a model element, they cannot be removed by a stereotype. Instead, they are an intrinsic part of the model’s definition1.
Adding Attributes and Operations (D): Stereotypes can be used to add attributes and operations to a model element, which allows for the specification of additional properties or behaviors that are not part of the standard UML metamodel1.
In summary, while stereotypes are versatile and can extend the capabilities of UML model elements in various ways, they do not have the ability to remove constraints that are already applied to those elements. This is because constraints are considered fundamental rules that govern the integrity of the model, and removing them would potentially violate the model’s correctness or completeness1.
A framework developer has been given a requirement to create an extensible utility for solution developers to use to create collections.
The framework developer has submitted the following diagram fragment for review:
Which review comment is valid and applicable?
- A . The upper limit of 10 for the Size of PhontyQueue is too small and should be increased to at least 20 to accommodate special cases.
- B . The «bind» relationship between the concrete class Vector and the abstract class AbstractList is incorrect. It should be a Generalization relationship.
- C . The Generalization relationship between the concrete class PriorityOueue and the abstract class AbstractQueue is incorrect. It should be a «bmd» relationship.
- D . The template parameter Size cannot be added to a specialized class. It needs to be moved to the top of the hierarchy and added to AbstractCollection and AbstractQueue.
B
Explanation:
In UML, the «bind» relationship is used to specify that a class is a template instantiation of a template class, where actual parameters are bound to the formal parameters of the template class1. However, in the case of the relationship between a concrete class like Vector and an abstract class like AbstractList, the correct relationship should be Generalization, not «bind».
Generalization is a taxonomic relationship between a more general classifier and a more specific classifier. Each instance of the specific classifier is also an instance of the general classifier1.
Thus, Vector being a concrete implementation of AbstractList, should inherit from AbstractList, which
is correctly represented by a Generalization relationship in UML.
The other options can be evaluated as follows:
Option A: The upper limit for the size of PhontyQueue is a design decision that should be based on the requirements and use cases of the application. It is not inherently incorrect in UML to have a specific upper limit.
Option C: The Generalization relationship is correctly used
between PriorityQueue and AbstractQueue as it represents inheritance in UML.
Option D: While it is true that template parameters are typically defined at the top of the hierarchy, the statement is too absolute. In UML, template parameters can be added to specialized classes, but it depends on the specific design and requirements. Therefore, without additional context, this statement cannot be deemed universally valid.
In conclusion, the most applicable and valid review comment is option B, which correctly identifies the misuse of the «bind» relationship in the context of the class diagram provided.
Which statement should be taken into consideration when extending a UML metaclass with a stereotype?
- A . UML recommends to start extending the metaclass "Class" and then other metaclasses depending on the expected qualities of the profile.
- B . The choice of the extended metaclass is not that important since tools can always apply a profile’s filtering rules to hide unneeded metaclasses.
- C . The metaclass and the stereotype that extends it should be semantically related to each other to avoid having to constrain the metamodel excessively.
- D . UML specifies rules on how the mapping between stereotypes and UML metaclasses should be done; these rules must be followed to identify the best metaclasses.
C
Explanation:
When extending a UML metaclass with a stereotype, it is critical to ensure that the metaclass and the stereotype are semantically related. This is because a stereotype is a way to extend the UML metamodel to create new kinds of model elements that can include additional semantics and constraints, but still adhere to the base behavior defined by the metaclass. The stereotype should be a meaningful specialization of the metaclass and not contradict its fundamental semantics. By keeping them semantically related, there is less need for additional constraints on the metamodel, and the resulting profile is more intuitive for users. This is consistent with the principles described in the UML 2 Specification, particularly in the sections on profiles and stereotypes.
An organization has determined that they want to add the capability to create and add requirement elements to their UML models. They also want to create a unique relationship for tracing requirements to other model elements.
What is the appropriate approach to do this?
- A . Use the requirement element and relationship defined in the UML specification.
- B . Create a profile that stereotypes Class as requirement and Dependency as the relationship.
- C . Create a new MOF metamodel that includes UML and adds the desired requirement element and relationship.
- D . Assign tag values that ascribe the desired requirement type to a UML Requirement and Dependency relationship.
B
Explanation:
UML allows the introduction of new concepts that are not part of the standard UML metamodel by creating a profile. To add capabilities for modeling requirements and tracing relationships in UML, a profile can be created where a Class is stereotyped to represent a requirement, and a Dependency is stereotyped to represent the trace relationship. This approach is both practical and conforms to the UML standard’s mechanisms for extending the language. It is a common practice to create such profiles for requirements engineering within the UML framework. This conforms to the UML 2 Superstructure Specification, which provides guidelines on creating and applying profiles and stereotypes.
Where does UML explicitly intend String Expression elements to be used?
- A . as (he ValueSpecifications for the nameExpressions of ParameterableElements within Template specifications
- B . as the model the author chooses for the specification of custom dynamically-generated names for any NamedElement
- C . whenever an OpaqueExpression form of a ValueSpecification needs to specify an expression that operates on String instances
- D . The specification has no metaclass StnngExpression and so no use of StringExpression is explicitly intended.
D
Explanation:
In UML, ValueSpecifications are used to specify the value of an element. The UML 2 Specification does not define a metaclass named StringExpression. Instead, it provides a metaclass named OpaqueExpression, which can be used when an expression is written in a language that is not directly interpretable by the model. Since there is no metaclass called StringExpression in the UML 2 Specification, there is no explicitly intended use for it within the UML metamodel. The absence of this metaclass suggests that any use of a concept called "StringExpression" would not conform to standard UML 2 practices and would likely be part of an extension or profile, not the core UML metamodel.
What does the UML specification say about choosing between a MOF-based metamodel and a UML profile?
- A . It is not always clear when to use one approach over the other; this decision must be domain-specific
- B . It is always good to opt for metamodeling when the metamodel is large and the domain is inherently complex such as the database domain.
- C . Since UML extends MOF. it is always preferable to start by extending MOF and. if this turns out to be complex, then shift to extending UML.
- D . Extending UML should be favored because of the fact that there are several tools that support UML profiling, which is not the case for MOF.
A
Explanation:
The UML (Unified Modeling Language) specification, which is a part of the MOF (Meta-Object Facility) framework, suggests that the choice between creating a MOF-based metamodel and a UML profile depends on the specific needs of the domain being modeled. A MOF-based metamodel might be more appropriate for domains that require defining a completely new set of modeling concepts, whereas a UML profile is suitable for domains where the extension of existing UML concepts is sufficient. Since the specification recognizes the variability in modeling requirements across different domains, it emphasizes the importance of understanding the domain to make an informed decision on the modeling approach. The UML specification, therefore, does not prescribe a one-size-fits-all solution but rather leaves the decision to the modeler, based on the domain-specific requirements.
Consider the following diagram fragment:
What is the signature of the class template List?
- A . List
- B . T[0..n]
- C . The ordered set {T. n: Integer}
- D . <T -> Customer, n -> 2000> or <T -> Order, n – >10000>
C
Explanation:
The class template List shown in the diagram fragment is a parametrized class with two template parameters: T and n. The signature of the class template includes both of these parameters. The template parameter T represents a type that can be bound to a specific class when the template is instantiated, while n represents an integer value that specifies the multiplicity of elements that can be contained in the list. Therefore, the signature of the class template List is the ordered set {T, n: Integer}, which includes both the type parameter T and the integer parameter n indicating the maximum number of elements the list can hold.
Consider the following profile:
Which statement is true?
- A . Each instance of Class must be linked to exactly one instance of DisplayArea, Frame, or Form.
- B . Each instance of Class must be linked to at most one instance of DisplayArea. Frame, or Form.
- C . Each instance of Class must be linked to exactly one instance of DisplayArea. Frame, and Form.
- D . Instances of Class or its subclasses do not have to be linked to instances of DisplayArea. Frame, or Form.
- E . The diagram is incorrect because a required extension cannot be applied to a stereotype inheritance hierarchy.
D
Explanation:
The UML diagram fragment provided shows a UML profile with a required extension from the metaclass Class to the stereotype DisplayArea, which in turn has two subclasses Frame and Form. The use of {required} indicates that whenever an instance of Class is extended by the DisplayArea stereotype, it becomes mandatory to do so. However, this does not enforce that every instance of Class must be linked to DisplayArea or its subclasses (Frame or Form). It only means that if the DisplayArea stereotype is applied, it is required. Therefore, there is no obligation for every instance of Class or its subclasses to be stereotyped as DisplayArea, Frame, or Form. It’s also worth noting that the last option (E) could be considered true in some interpretations of UML, but given the options provided and common UML practices, option D is more accurate.
Which statement is correct about working with multiple profiles?
- A . The only way to integrate profiles is to merge them into one big profile
- B . Only profiles that represent the same domain can be integrated together.
- C . A profile can reuse all or parts of another profile, and extend other profiles.
- D . A profile can reuse all or parts of another profile, but cannot extend other profiles.
C
Explanation:
In UML, profiles are mechanisms to extend the UML for a specific domain or purpose. The UML specification allows for one profile to reuse or import elements from another profile. This enables modularity and encourages reusability of profile elements across different domains. Additionally, one profile may extend the stereotypes or metaclasses defined in another profile, which allows for the creation of layered profiles where each layer adds its own specificities. This is a common practice in software and systems modeling to cater to different aspects of a system within separate profiles, which are then integrated to form a comprehensive model. The capability to reuse and extend profiles is defined in the UML 2.x Superstructure Specification, which gives guidelines on how to define and use profiles within UML.
Which interpretation is valid when NamedElement A is the Supplier in a specialized Dependency having NamedElement B as the Client, and a Comment indicates that A and B participate in a transformation?
- A . B is the transformation Realization of A.
- B . A is the transformation Realization of B.
- C . A depends on B.
- D . A and B are part of an economic system where A consumes what B transforms.
C
Explanation:
In UML, a Dependency is a relationship that signifies that one NamedElement, the client, depends on another NamedElement, the supplier, meaning that a change in the supplier could affect the client. If NamedElement A is the supplier and NamedElement B is the client in a Dependency relationship, and there is a Comment indicating that both participate in a transformation, the interpretation is that B (the client) depends on A (the supplier) for that transformation. The comment does not necessarily change the nature of the Dependency relationship; it simply adds additional information about the nature of their interaction. A transformation could mean that B transforms A’s supplied element in some way, but in terms of UML Dependency relationships, it would still be interpreted as "A depends on B" or "B requires A for its transformation". This interpretation aligns with the UML 2.x Infrastructure and Superstructure specifications, which explain Dependencies and their meanings within the UML metamodel.
Given the following fragment from a profile definition:
Which statement is correct regarding the application of the profile?
- A . A class stereotyped as an «architecture decision» must contain attributes named Complexity. Risk, and Status with the designated Enumeration types
- B . A class stereotyped as an «architecture decisions will have Stereotype Properties named Complexity. Risk, and Status with the Enumeration types designated in the profile.
- C . A class stereotyped as an «architecture decision» must contain attributes named Complexity. Risk, and Status and they may be any user-defined type.
- D . A class stereotyped as an «architecture decisions must contain exactly three attributes with user-defined names, two of which are of type Rank, and one of type Status.
B
Explanation:
In UML, a stereotype is a mechanism that extends the vocabulary of the UML in order to create new model elements. The given profile fragment defines a stereotype «architecture decision» that extends the metaclass Class. This stereotype includes three properties: Complexity, Risk, and Status, each typed by specific enumerations: Rank and Status. When a stereotype is applied to a UML element, it does not create physical attributes on the element; instead, it enables the element to carry additional information as specified by the stereotype ― in this case, as Stereotype Properties. These properties are effectively tagged values that are associated with the stereotyped element. Hence, when a class is stereotyped as an «architecture decision», it will have the ability to hold values for Complexity, Risk, and Status according to the types defined by the enumerations in the profile. This is consistent with the rules defined in the UML 2.x Superstructure Specification for profiles and stereotypes.
Which capability Is provided by the Profile mechanism?
- A . storing user-specific configurations of model settings
- B . creating new metamodel elements for specific purposes
- C . adapting existing metamodel elements for specific purposes
- D . configuring model libraries and a set of keywords to be used for a model
C
Explanation:
The Profile mechanism in UML provides the capability to adapt existing metamodel elements for specific purposes. Profiles allow modelers to extend the standard UML metamodel with additional semantics by defining stereotypes, tagged values, and constraints that are specific to a particular domain, platform, or methodology. This means that profiles tailor the existing UML metamodel elements to create domain-specific models without changing the underlying metamodel itself. This adaptation mechanism is described in the UML 2.x Superstructure and Infrastructure Specifications, which detail how profiles can be used to customize the UML for particular domains or purposes.
Let E be a UML 2.5 NamedElement with a name property of ‘_name" and with a name Expression property of "_expresslon".
Which one presentation or set of presentations of the name of E in a tool conforms to the OMG specification?
- A . _name
- B . _expression
- C . S_expression$ OR _name
- D . S_expression$
_expression
OR
_name:_expressk>n - E . UML 2.5 no longer includes a nameExpression properly within NamedElements.
C
Explanation:
In UML 2.5, a NamedElement can have a name attribute, which is a string representing the element’s name, and a nameExpression attribute, which is a ValueSpecification used to specify the element’s
name in a more dynamic way. The presentation of the name of a NamedElement in a tool that conforms to the OMG specification could either be the literal name (as specified in the name attribute) or the evaluated expression from the nameExpression property. Therefore, a tool may choose to present either the simple name or the evaluated expression or allow toggling between the two. The specification does not mandate a single fixed presentation, allowing for flexibility in how tools display the name. This conforms to the OMG’s UML 2.5 specification, which describes the properties of NamedElement and their presentations within tools.
In a model of a commercial transaction, actors might exchange euros, pesos, and dollars.
Which figure illustrates compliant use of UML information items for these currency exchanges?
- A . Figure 1
- B . Figure 2
- C . Figure 3
- D . Figure 4
B
Explanation:
In UML, an InformationItem represents an abstraction of all those elements in a UML model that have an information-bearing feature. It is depicted as a classifier with the keyword «informationItem». An InformationItem does not have direct instances and serves as a mechanism to handle unspecified, untyped information in a model. In the context of a commercial transaction model, currencies such as euros, pesos, and dollars can be abstractly represented as InformationItems to signify that they are used as a form of data exchange but without specifying the concrete structure or data type. Figure 2 correctly uses InformationItem notation, with the «informationItem» keyword and the directed association pointing from the Currency InformationItem to the Euro, Peso, and Dollar, which are likely representations or manifestations of the Currency. This complies with the UML specification for representing abstract entities in models that are involved in the exchange or flow of information.
Consider the following diagram fragment:
Which statement is correct about the diagram fragment?
- A . The diagram fragment is a valid UML diagram.
- B . To use the template List. Company must be a bound element to List.
- C . List cannot be used by Company unless Company is also a template.
- D . List cannot be used as a data type, only a bound element to List can.
D
Explanation:
The provided diagram fragment seems to indicate a situation involving a template. In UML, a template is a parameterizable element, and a bound element is a specific manifestation of that template wherein the parameters have been replaced with actual values or types. If ‘List’ is a template class, it cannot be directly used as a type. Instead, one must use a bound element of the List, meaning the template parameters of List must be bound to actual types before it can be used. For instance, if List is a template expecting a type T, then a concrete class might be List<Customer> or List<Order>, where Customer or Order are actual types replacing the template parameter T. This use of templates and bound elements is according to the UML specification, which details how templates are defined and instantiated within UML models.
Consider the following diagram fragment:
Which statement is correct about the diagram fragment?
- A . The diagram fragment is a valid UML diagram.
- B . To use the template List. Company must be a bound element to List.
- C . List cannot be used by Company unless Company is also a template.
- D . List cannot be used as a data type, only a bound element to List can.
D
Explanation:
The provided diagram fragment seems to indicate a situation involving a template. In UML, a template is a parameterizable element, and a bound element is a specific manifestation of that template wherein the parameters have been replaced with actual values or types. If ‘List’ is a template class, it cannot be directly used as a type. Instead, one must use a bound element of the List, meaning the template parameters of List must be bound to actual types before it can be used. For instance, if List is a template expecting a type T, then a concrete class might be List<Customer> or List<Order>, where Customer or Order are actual types replacing the template parameter T. This use of templates and bound elements is according to the UML specification, which details how templates are defined and instantiated within UML models.
Consider the following diagram fragment:
Which statement is correct about the diagram fragment?
- A . The diagram fragment is a valid UML diagram.
- B . To use the template List. Company must be a bound element to List.
- C . List cannot be used by Company unless Company is also a template.
- D . List cannot be used as a data type, only a bound element to List can.
D
Explanation:
The provided diagram fragment seems to indicate a situation involving a template. In UML, a template is a parameterizable element, and a bound element is a specific manifestation of that template wherein the parameters have been replaced with actual values or types. If ‘List’ is a template class, it cannot be directly used as a type. Instead, one must use a bound element of the List, meaning the template parameters of List must be bound to actual types before it can be used. For instance, if List is a template expecting a type T, then a concrete class might be List<Customer> or List<Order>, where Customer or Order are actual types replacing the template parameter T. This use of templates and bound elements is according to the UML specification, which details how templates are defined and instantiated within UML models.
Consider the following diagram fragment:
Which statement is correct about the diagram fragment?
- A . The diagram fragment is a valid UML diagram.
- B . To use the template List. Company must be a bound element to List.
- C . List cannot be used by Company unless Company is also a template.
- D . List cannot be used as a data type, only a bound element to List can.
D
Explanation:
The provided diagram fragment seems to indicate a situation involving a template. In UML, a template is a parameterizable element, and a bound element is a specific manifestation of that template wherein the parameters have been replaced with actual values or types. If ‘List’ is a template class, it cannot be directly used as a type. Instead, one must use a bound element of the List, meaning the template parameters of List must be bound to actual types before it can be used. For instance, if List is a template expecting a type T, then a concrete class might be List<Customer> or List<Order>, where Customer or Order are actual types replacing the template parameter T. This use of templates and bound elements is according to the UML specification, which details how templates are defined and instantiated within UML models.
The implementation of the collection functions cannot be overridden.
Which UML concept should these designers use?
- A . Classes
- B . Interfaces
- C . Power Types
- D . Class Templates
D
Explanation:
In UML, class templates are the concept used to create classes that can be parameterized with different data types. This feature satisfies the first condition, allowing collections to support any data type. Class templates can be specialized, fulfilling the second condition, where some collections can inherit from others, thus enabling the reuse of functionality. Additionally, UML allows for operations to be defined in such a way that they cannot be overridden, by specifying them as non-virtual or final, which meets the third condition. Therefore, the use of class templates would be the most suitable approach for the design criteria specified by the programming language designers. This approach is consistent with the capabilities of class templates as described in the UML 2.x Superstructure Specification.
A project’s requirements call for flexibility in the collection class design. Most of the collections will be a fixed length of 25 elements. However, allowance must be made in the design for collections that are a fixed length longer than 25.
Which model fragment supports the project’s requirements?
A)
B)
C)
D)
- A . Option A
- B . Option B
- C . Option C
- D . Option D
C
Explanation:
The UML model fragment that best supports the project’s requirements for collection class design is one that allows the fixed length of the collections to be specified but also permits flexibility for collections longer than 25 elements. In Option C, the ClarusCollection class is shown as a template class with a template parameter Size set to a default of 25. However, the dashed lines and the separate box for Type and Size indicate that while there is a default value, it can be overridden. This means that the Size can be parameterized, thus allowing the creation of ClarusCollection instances with different fixed lengths, not just 25. This design will enable most collections to be created with the default size of 25, but also allows for creating collections with sizes greater than 25, providing the flexibility required by the project’s requirements. This adheres to the UML 2.x specification on templates and parameterization.
Consider the following modeling scenario:
Which statement is correct about the modeling scenario?
- A . The Profile "Versioning" can not be applied to two Packages in a model at the same time
- B . The Profiles must be applied to the Model "My Application" instead of the Packages.
- C . Two Profiles are correctly applied to two Packages.
- D . The Profiles must be members of the namespace of the Model "My Application".
C
Explanation:
In UML, profiles are applied to specific model elements to adapt the UML metamodel to different domains or platforms. The provided diagram shows a UML package diagram within which the «Versioning» profile is applied to the "Business Logic" package, and the «DBProfile» is applied to the "Data" package. This is a correct use of profiles in UML as they allow the customization of parts of a model by applying additional constraints and stereotypes to specific packages or classes. There is no restriction in UML that a profile cannot be applied to multiple packages in the model simultaneously, and profiles do not necessarily need to be members of the namespace of the model they are applied to; they can be defined externally. Therefore, the scenario presented is a correct application of two different profiles to two distinct packages within the same model, conforming to the UML 2.x Superstructure Specification.
In addition to stereotypes, which UML elements can a profile define?
- A . all of the UML elements
- B . all of the UML Structured Classifiers
- C . Class. DataType. Enumeration
- D . Class. DataType. Enumeration. Object. Component
C
Explanation:
A UML profile can define several different elements to extend the UML for a specific domain, platform, or purpose. Besides stereotypes, a profile can define DataTypes and Enumerations, which can be used within Stereotypes to type the tagged values. A profile can also define Classes, which can be used as base classes for stereotypes. However, a profile does not typically define instances of elements, such as Objects, nor does it define composite structures, such as Components. The intent of a profile is to adapt existing metamodel elements through the use of stereotypes, tag definitions, and constraints rather than to create instances or define system architectures. This definition and use of a profile are aligned with the guidelines in the UML 2.x Superstructure Specification, which outlines what elements a profile can define within the UML framework.
Consider the following diagram:
What does the string {guarded} mean?
- A . The execution of op1 is guarded by one or more exceptions which it will handle if they arise.
- B . Multiple invocations of op1 that overlap in time may occur to one instance, but only the first one will get handled.
- C . Multiple invocations of op1 that overlap in time may occur to one instance, but only one is allowed to commence.
- D . The execution of op1 Is guarded by one or more exceptions. Behaviors invoking it are required to handle these exceptions
C
Explanation:
In UML, when an operation is marked with the term {guarded}, it means that the operation is subject to a concurrency constraint. It specifies that the operation cannot have overlapping executions; in other words, if the operation is already in execution, a new attempt to start it will have to wait until the current one completes. This prevents race conditions and ensures thread safety for that operation when dealing with concurrent accesses in multi-threaded environments. This interpretation is based on the UML 2.x Superstructure Specification, which describes how operations can be marked with constraints to define their behavioral features in terms of concurrency.
You are asked to provide UML model content such that other modelers may use the Classes of your model as modular, partial specifications to be more fully specified by their models. You decide to provide a Vehicle Class that represents a partial specification of automobiles and allows tailoring of this class through the other modelers’ choices of kinds of propulsion such as a gasoline motor, an electric engine, or a manual cycle system. You want to limit which Class kinds the other modelers can choose as their propulsion system.
Which tactic appropriately exploits UML’s syntax and semantics for modular reification?
- A . Model GasolineMotorVehicle. ElectricEngineVehicle. and ManualCyclingVehicle as specialized versions of your Abstract Class Automobile.
- B . Model Vehicle as a Template Classifier with a Class Parameter named Thrustor that is constrained to be a derivative of an Abstract Class PropulsionSystem
- C . Model Vehicle as a Class with a Property named thrustor of Type Enumeration Class Thrustor that has Enumeration Literals GasolmeMotor. ElectncEngme. and ManualCycler.
- D . Model three separate Packages named GasolineMotor Vehicles. ElectricEngme Vehicles, and ManualCyclmg Vehicles and Package Import into each of these the Package with your Vehicle Class.
B
Explanation:
The approach described in option B aligns with the concept of template classifiers in UML, which allows for the creation of parameterized elements that can be instantiated with different arguments. By modeling Vehicle as a template classifier with a parameter named Thrustor, other modelers can instantiate this template with their chosen propulsion system, as long as it is a type that specializes the PropulsionSystem abstract class. This method provides the flexibility needed for modelers to tailor the Vehicle class to different propulsion systems while enforcing that only derivatives of PropulsionSystem can be used as the actual parameter for Thrustor. This tactic of using template classifiers and class parameters is an application of UML’s syntax and semantics for creating modular and customizable models. This practice is detailed in the UML 2.x Superstructure Specification, particularly in the sections describing template classifiers and their parameters.
Which subclasses of Classifiers can be parameterized and used as Template Parameters?
- A . Class. Component. Interface, but not Signal
- B . Signal. Use Case, Component, but not Datatype
- C . Activity. Interaction, State Machine, but not Collaboration
- D . all subclasses of Classifier e.g. Class. Component. Datatype. Interface. Signal
D
Explanation:
In UML, a template is a parameterizable element, and the parameters for a template are typically classes or other classifiers. According to the UML 2.x Superstructure Specification, all subclasses of Classifier can potentially be used as template parameters. This includes classes, components, datatypes, interfaces, signals, and more. The specification provides the flexibility to define template parameters that are specialized types, allowing for powerful and reusable designs. The ability to parameterize these elements is foundational to creating generic and reusable model elements, which is a core capability of the UML’s templating mechanism.
A developer wants to make sure that each specialization of Class Bicycle has its own unique set of values for the suitable road surface and average speed.
Which diagram imposes these requirements?
A)
B)
C)
D)
- A . Option A
- B . Option B
- C . Option C
- D . Option D
C
Explanation:
In Option C, the properties suitable road surface and average speed have been redefined in the subclasses Recumbent Bike and Racing Bike. The use of the {redefines} keyword in UML signifies that the subclass will provide its own specific values for these properties, overriding the general ones provided by the superclass Bicycle. This is the correct way to enforce that each specialization of Bicycle has a unique set of values for these attributes, as redefinition allows for the customization of inherited properties on a per-subclass basis. The use of {redefines} is specified in the UML 2.x Superstructure Specification, which describes how properties inherited from a superclass can be customized by subclasses.
Consider the following diagram:
Which statement is correct about the diagram?
- A . Each subclass of Electronic Device Kind must have a set of required Certifications defined.
- B . Each subclass of Electronic Device in the shown Generalization Set must have a set of required Certifications defined.
- C . The "Electronic Device Kind" Class and the "Electronic Device Kind" Generalization Set have the same name, but no semantic connection is implied by this.
- D . These are two alternative but incompatible ways to specify Electronic Device Kinds, either as Class "Electronic Device Kind" or as Specialization of "Electronic Device".
A
Explanation:
The diagram depicts Electronic Device Kind as a class that requires a set of Certifications (required: Certification[1..*]). This implies that any subclass of Electronic Device Kind must provide a set of required Certifications because the multiplicity [1..*] indicates that at least one Certification is mandatory for each instance of Electronic Device Kind or its subclasses. Therefore, when a subclass is created, it inherits the requirement to specify what Certifications are needed. This is a standard UML generalization, where the subclass inherits the attributes and constraints of its superclass. This interpretation is consistent with the rules defined in the UML 2.x Superstructure Specification, which includes the semantics of class generalization and attribute inheritance.
Which can be added to a redefined operation?
- A . scope
- B . templates
- C . parameters
- D . preconditions
D
Explanation:
In UML, operations can have preconditions defined, which are constraints that must be true before the operation is invoked. When an operation is redefined in a subclass, it is possible to add new preconditions or alter existing ones. Redefining an operation does not typically allow for changes to its scope or the addition of templates, but the preconditions may be expanded to reflect the semantics of the subclass. This is in line with the behavioral specification of operations in UML, where preconditions are part of the behavioral contract of an operation, as described in the UML 2.x Superstructure Specification.
Which UML element specifies a set of formal parameters that will be substituted by actual parameters?
- A . template parameter
- B . template signature
- C . templateable element
- D . template parameter substitution
B
Explanation:
A template signature in UML specifies a set of formal parameters that can be substituted by actual parameters when a template is instantiated. This template signature is part of a template able element, which is the element that can be parameterized using the template mechanism in UML. The template signature defines the formal template parameters that will be replaced by actual values or types when a bound element is created from the template. This concept is detailed in the UML 2.x Superstructure Specification, particularly in the sections describing templates and how they are used to create reusable and customizable model elements.
Which keyword indicates that instances of one Classifier may be used instead of Instances of another Classifier?
- A . « substitute»
- B . «replacement»
- C . «isReplaceable»
- D . «isSubstitutable»
D
Explanation:
In UML, the keyword «isSubstitutable» is used to indicate that instances of one classifier may be used in place of instances of another classifier. This concept is commonly applied in the context of generalization, where a subclass can be substituted for its superclass. The substitutability is a fundamental principle of object-oriented design, particularly in the Liskov Substitution Principle, which states that objects of a superclass should be replaceable with objects of a subclass without affecting the correctness of the program. This principle is reflected in UML’s support for polymorphism, which is implicit in the generalization relationships between classifiers.
What is true about the use of a Template Classifier to specify the Type of a Typed Element?
- A . The Template Classifier needs to be modeled
- B . The Template Classifier must have defaults for all of its Template Parameters
- C . The Type Property of the Typed Element must directly name the Template Classifier.
- D . Template Classifiers cannot be used in the specification of Types for Typed Elements.
- E . A set of bound elements provides values for the Template Parameters of the Template Classifier.
E
Explanation:
When a template classifier is used to specify the type of a typed element, the actual parameters for the template classifier’s formal parameters must be provided by a set of bound elements. This means that for a template classifier to be used as a type, there must be a corresponding binding that specifies what elements are used as arguments for its template parameters. This allows the typed element to have a concrete type that is a specific instantiation of the template classifier with particular values for its template parameters. This use of template classifiers is described in the UML 2.x Superstructure Specification, which details how template binding works to create specific instances of template classifiers.
Consider the following template Operation:
addElement <E> (e : E)
Which Operation represents a binding of that template Operation?
- A . addElement (e : Card)
- B . addElement <e : Card>
- C . addElement« E -> Card » (e : Card)
- D . addElement «bind» E -> Card (e)
A
Explanation:
The correct representation of a binding of the template operation addElement<E> with E being bound to the type Card is addElement (e : Card). This notation means that the template parameter E is being replaced by the concrete type Card, thus instantiating the template operation with that specific type. In UML, this instantiation does not require the «bind» keyword or the template brackets <> around the type in the operation signature itself; it is simply represented by using the concrete type as the type of the parameter in the operation. This usage is consistent with the UML 2.x Superstructure Specification, which explains how operations of a template classifier are instantiated when template parameters are bound to actual types.
Consider the following diagram:
What could be substituted for myTypel?
- A . Number
- B . Short or Long
- C . any subtype of Number
- D . any Type, there is no restriction
C
Explanation:
In the given diagram, myType1 is shown redefining prop1, which was originally of type Integer. Given that Integer is a subtype of Number, and myType1 is used in a redefinition context, it implies that myType1 must also be a subtype of Number. In UML, when a property is redefined, the redefining property must be type compatible with the property it redefines. Therefore, myType1 could be substituted by any subtype of Number, which includes Integer, Real, and all their subtypes (Short, Long, Float, Double, etc.). This is based on the UML principle of type conformance in property redefinition, as specified in the UML 2.x Superstructure Specification.
What characterizes the generalization relationship between two Classifiers where the child can NOT be substituted for the parent?
- A . It has the stereotype "nonSubstitutable".
- B . It has the property "Substitute" set to false
- C . It has the property ‘’isSubstitutable" set to false.
- D . It has the property "substitutingClassifier" set to false.
C
Explanation:
In UML, the isSubstitutable property of a generalization relationship indicates whether instances of the child classifier can be used wherever instances of the parent classifier are expected, that is, whether the subclass is substitutable for the superclass. When this property is set to false, it means that the child classifier cannot be substituted for the parent classifier. This property is part of the UML metamodel for generalization and affects how inheritance is interpreted in terms of
substitutability, as described in the UML 2.x Superstructure Specification.
Consider the following diagram fragment:
Which statement is correct?
- A . The set named "b" is contained in a set named "part".
- B . The set named "b" has one subset, that contains the parts of B.
- C . The property "subsets part" specifies that b only partially defines A
- D . The constraint limits the elements of b to be from a predefined set of parts
A
Explanation:
In UML, the {subsets} keyword is used to indicate that one property is a subset of another property. In the provided diagram fragment, the association end -b {subsets part} indicates that the property b on class A is a subset of the property part on class B. This means that the elements associated with A through b are contained within the larger set associated with B through part. This kind of relationship is typically used in more complex class models where a part-whole hierarchy is represented, and it allows the model to show that certain associations are more specific subsets of a more general association. This usage is explained in the UML 2.x Superstructure Specification, where the semantics of association subsets are defined.
What does a lower multiplicity of one for an end of an n-ary Association imply?
- A . Links combining the values of the other ends may exist or may not exist
- B . Exactly one link exists combining the values of the other ends.
- C . A link for every possible combination of values for the other ends must exist.
- D . Links combining the values of one or many other ends may exist.
A
Explanation:
In UML, the multiplicity of an association end specifies how many instances of the class at that end can participate in a single association. A lower multiplicity of one (1) at one end of an n-ary (where n > 2) association implies that there must be at least one link that combines the values of the other ends, but it doesn’t require that a link exists for every possible combination. Therefore, it’s possible for some combinations to exist as links, while others do not, which is indicated by the option that links combining the values of the other ends may exist or may not exist. This interpretation is consistent with the definition of multiplicity in associations as outlined in the UML 2.x Superstructure Specification.
A modeler wants to develop a customization for a standard UML tool that provides the ability to specify CORBA physical Components.
Which approach should the modeler use?
- A . Create a profile for the CORBA component technologies and apply it to the model.
- B . Create a MOF metamodel for the CORBA component technology and add It to the UML metamodel.
- C . Create CORBA component instances that can be used as Parts in a composite structure compartment.
- D . Create a set of execution semantic definitions for the CORBA component assembly Connectors and apply them to the model.
A
Explanation:
To provide the ability to specify CORBA physical components within a UML tool, the most appropriate approach is to create a UML profile that includes stereotypes, tagged values, and constraints that reflect the characteristics and requirements of CORBA components. Applying this profile to a UML model would extend the semantics of UML to support CORBA-specific concepts without modifying the UML metamodel itself. This approach allows the modeler to leverage the existing UML tooling while incorporating the additional semantics required for CORBA components. This practice is supported by the extensibility mechanisms provided by UML, as described in the UML 2.x Superstructure Specification, which outlines how to create and apply profiles.
What should a modeler do lo represent specific hardware environments In a deployment model?
- A . Create a profile with the applicable details
- B . Create an instance of a deployment manifest with the applicable details
- C . Create an instance of a deployment specification with the applicable details.
- D . Create a mapping between the logical hardware description and the physical hardware description with the applicable details.
A
Explanation:
To represent specific hardware environments in a deployment model, a modeler should create a UML profile that includes the necessary hardware stereotypes with applicable details. A profile allows the modeler to extend the standard UML metamodel to include domain-specific elements that can be applied to deployment models. These stereotypes can represent different types of hardware components and their attributes, which can then be used to model the physical aspects of the deployment environment. The creation and application of profiles are supported by the UML 2.x Superstructure Specification, which details how to tailor UML to particular domains or platforms using profiles.