Which UML class diagram element represents a blueprint for objects, including attributes and methods?
Think about what defines the structure and behavior of objects in UML.
A Class is a blueprint that defines attributes and methods for objects. An Object is an instance of a class. A Package groups classes. An Interface defines a contract without implementation.
In a UML class diagram, which relationship type shows that one class owns or contains another class as a part?
Consider the difference between whole-part relationships and simple links.
Aggregation represents a whole-part relationship where the part can exist independently. Association is a general link. Inheritance shows a parent-child class relationship. Dependency is a weaker usage link.
You are designing a UML class diagram for a library system with books, members, loans, and staff. Which is the most reasonable number of classes to represent these entities and their relationships?
Think about capturing main entities and their interactions without overcomplicating.
Option D balances detail and simplicity by including main entities and related concepts. Option D is too simple, missing key parts. Option D misses important entities. Option D is too complex for a basic UML diagram.
Which UML relationship should you use to show that one class is a specialized version of another, inheriting its attributes and methods?
Think about the 'is-a' relationship in object-oriented design.
Inheritance (Generalization) represents an 'is-a' relationship where a subclass inherits from a superclass. Other relationships do not express this hierarchy.
Given a UML class diagram with classes: UserInterface, AuthController, UserService, and Database, which sequence correctly represents the flow of a login request?
Follow the logical order of method calls from UI to database and back.
The correct flow starts with the UI sending data to the controller, which calls the service, which queries the database, then responses flow back in reverse order.