Physical Address
304 North Cardinal St.
Dorchester Center, MA 02124
Domain Driven Design is a technique commonly used to build Reactive Systems. This course will introduce the core elements of Domain Driven Design. It will also explain how those elements relate to Reactive Systems.
Domain Driven Design Review
Question: True or False: Many of the guidelines and rules in Domain Driven Design are compatible with those in Reactive Architecture.
Question: What are some key goals of Domain Driven Design?
Question: True or False: Often a single all-inclusive model of a very large domain can contain much, and at times overwhelming, complexity. Breaking those large domains into smaller pieces can result in making the complexity more manageable and understandable.
Question: If we break down a large domain into smaller pieces we need to:
What is a Domain Review
Question: In the world of software architecture and development a domain can be discribed as:
Question: Typical domain experts in an insurance company are:
Note: Make sure you select all of the correct options—there may be more than one!
Question: True or False: A domain model is part of the software application.
Question: True or False: Domain experts should be able to easily understand the domain model.
Question: The name of the form of communication that domain experts and software developers can understand is:
Question: True or False: Domain Experts provide language that is used in the software, and software developers provide language that is used in the domain. Both provide input in equal proportions.
Question: True or False: If developers find a process or abstraction in a domain that doesn’t appear to have a name, the developers should talk to the domain experts about whether it already exists or co-create a new term to discribe it.
Reactive BBQ Domain
Question: Which of the following people represent Domain Experts for the Reactive BBQ?
Note: Make sure you select all of the correct options—there may be more than one!
Question: While building the new system, we need to define a term that indicates when an order has been completed by a server, and is being sent to the kitchen to be cooked. The best people to ask about the right term are:
Question: Which of the following are terms you would find in the Reactive BBQ Ubiquitous Language?
Decomposing the Domain Review
Question: Sub domains are created by:
Question: True or False: It is impossible for a concept (such as Order or Customer) to exist in multiple sub domains.
Question: True or False: If we do find a concept (such as Order or Customer) that appears to exist in multiple subdomains, we are defining the concept at too low a level and thus need to define the concept at a higher level of abstraction.
Question: True or False: Each subdomain has its own ubiqutious language.
Question: True or False: Terms in the ubiquitous language are never shared between subdomains.
Question: The bounded context is:
Question: True or False: When initially defining microservices, it’s often a good idea to start with your bounded contexts: one bounded context = one microservice.
Question: True or False: One bounded context always equals one, and only one, microservice.
Question: True or False: From one bounded context to another the meaning of a word or concept, for example Customer, may dramatically change.
Question: What are some guidelines we can use to determine a bounded context?
Note: Make sure you select all of the correct options—there may be more than one!
Question: Event First Domain Driven Design identifies bounded contexts by looking for activities or events that occur in the domain. What are some examples of activities or events?
Note: Make sure you select all of the correct options—there may be more than one!
Domain Activities
Question: Based on this interview, Which of the following represent activities performed by the Server?
Note: Make sure you select all of the correct options—there may be more than one!
Question: Based on this interview, Which of the following represent activities performed by the Driver?
Note: Make sure you select all of the correct options—there may be more than one!
Maintaining Purity Review
Question: True or False: Concepts in one bounded context should always mean the same thing in another bounded context. Thus, there is no need to translate concepts between bounded contexts.
Question: If we always treated a concept, for example Customer, exactly the same across many different bounded contexts, we may introduce:
Question: We can prevent one bounded context from leaking into another by using a:
Question: Why is it a good idea to use an abstract interface for an Anti-Corruption Layer?
Question: True or False: We avoid using Anti-Corruption Layers when our bounded contexts interact with legacy systems. Our bounded contexts should mirror the legacy system interface.
Question: True or False: Its sometimes neccessary to have Anti-Corruption layers on both sides of the interaction between bounded contexts or a bounded context and legacy system.
Question: True or False: The above is an excellent example of a Context Map.
Bounded Contexts
Question: Which of the following is NOT a candidate for an object in the activities we defined for the host?
Question: Which of the following is NOT a candidate for an object in the activities we defined for the host?
Question: For the following activities, what is a possible object in the sentence:
Online Customer adds Menu items to an Order
Answer: Menu
Online Customer makes Payment for an Order
Answer: Payment
Online Customer Makes Reservation
Answer: Reservation
Question: While it’s not comprehensive, the list of objects in our activities make good candidates for Bounded Contexts.
Based on the objects defined in the activities above, which of the following are possible candidates for Bounded Contexts?
Note: Make sure you select all of the correct options—there may be more than one!
Categorizing Activities
Question: Which Bounded Context do the following Activities belong in?
Host changes time of a reservation.
Customer cancels an order.
Customer views the menu online.
Host changes customer phone number.
Server adds menu item to an order.
Customer makes payment for an order online.
Server adjusts the price on a menu item for a customer order.
Domain Activities Review
Question: The following are types of activities in Domain Driven Design:
Note: Make sure you select all of the correct options—there may be more than one!
Question: Which type of activity is a request to perform an action?
Question: True or False: A command represents an established fact in your system.
Question: True or False: Commands can never be rejected.
Question: If accepted and executed, commands cause:
Question: Which type of activity represents an action that happened in the past?
Question: True or False: An event represents an established fact in your system.
Question: True or False: An event can be rejected or completely wiped from a system.
Question: True or False: An event can be broadcasted to many destinations within a system.
Question: What are some characteristics of events in Domain Driven Design?
Question: What are some examples of events?
Question: Which type of activity represents a request for information about the domain?
Question: True or False: A query can be rejected, returning no response at all.
Question: What are some characteristics of queries in Domain Driven Design?
Question: What are some examples of queries?
Question: Commands, Events and Queries are what in Reactive Systems?
Question: True or False: A bounded context API is comprised of Commands, Events and Queries.
Order Activities
Question: Commands represent a request to change the state of the domain. They can be rejected and are usually phrased as a request.
A best practice is to define Commands that are intent revealing. This means that you can see from looking at the Command exactly what it was trying to do. We should therefore favour Commands that are more specific, rather than more general.
Which of the following would be a better command to set the table number for an order?
Question: Assuming we have defined our Bounded Contexts to include: Orders, Payments, Menu, Customers, Reservations.
Which of the following represent Commands in the Orders Context?
Note: Make sure you select all of the correct options—there may be more than one!
Question: Events are often the result of a Command. Where a Command requests a change to the state of the domain, and Event records that change. They often exist in a 1 to 1 relationship with the Command. Because they record something that happened in the past, they are best written as past tense.
Like Commands, Events are best when they reveal intent.
For the command “Add an Item to an Order(AddItemToOrder)”, which of the following would be an appropriate corresponding Event?
Question: Assuming we have defined our Bounded Contexts to include: Orders, Payments, Menu, Customers, Reservations.
Which of the following represent Events in the Orders context?
Note: Make sure you select all of the correct options—there may be more than one!
Question: Queries can be done to obtain information about the state of the domain. A query is issued in the form of a request for information, but it never changes the state of the domain. If you perform the same query twice, without any other actions, then you should always get the same response.
Which of the following does NOT represent a good query for our Orders Context?
Domain Objects Review
Question: True or False: A Value Object is defined by its attributes and those attributes can be changed.
Question: True or False: Given that ChequeIdentifier has three attributes that make a compound identifier, and has no other mutable or immutable attributes, it is a Value Object.
Question: True or False: The above two Value Objects are considered to be equivalent.
Question: True or False: As a Value Object, we can change the ChequeIdentifier AccountNumber value, maintaining equivalency.
Question: Assuming the above ChequeIdentifier is a Value Object:
True or False: It is permissable to pass ChequeIdentifier as a message between Bounded Context A and Bounded Context B.
Question: True or False: An Entity requires a unique identity (for example, a key or id).
Question: True or False: The above BankAccount is an Entity.
Question: Why is the above BankAccount an Entity rather than a Value Object?
Note: Make sure you select all of the correct options—there may be more than one!
Question: True or False: The above two BankAccounts are the same BankAcount Entity.
Question: True or False: The above three BankAccounts are the same BankAccount Entity.
Question: The above is an Aggregate. What is the root Entity of this Aggregate?
Question: True or False: In the above BankAccount Aggregate it is permissable to directly change the Transaction(s) or AccountType domain objects directly (bypassing the BankAccount).
Question: What is another name for root Entity?
Question: The following questions can help you determine an aggregate root(s) in a bounded context:
Note: Make sure you select all of the correct options—there may be more than one!
Order Domain Objects
Question: To determine the objects in our Orders context, we need to be able to flesh out the details of our Commands, Events, and Queries. Once we have that information available, we can look to those details to find our Value Objects, Entities, and Aggregate Roots.
Which of the following would represent a good definition of the “AddItemToOrder” Command?
Question: Value objects are defined by the fields they contain. They are considered immutable because changing the value of any field results in a different object. They have no unique identity otherwise.
Which of the following represents a Value Object in the Orders context?
Question: Entities are defined by a unique identity (either an Id, or a key). They are represented by their identifier, and a set of mutable fields. You can change the fields freely, without affecting the identity of the object. However, if you change the identifier in any way, then it becomes a different instance. In otherwords, two Entities with the same Id, are the same Entity, regardless of the values of their fields.
Which of the following represents an good Entity in the Orders context?
Question: An Aggregate Root is an Entity in a Bounded Context that aggregates other objects and is not aggregated by anything. I.E. it is at the root of the aggregation tree. Aggregate Roots are always Entities, never Value Objects.
Which of the following would be a candidate Aggregate Root for the Orders context?
Domain Abstractions Review
Question: When business logic doesn’t fit with an existing entity or value object we:
Question: If we need to put state in a Service we should probably:
Question: True or False: A Service should have stateless business processing logic.
Question: True or False: You can’t have too many Services in a Bounded Context. Too few is a sign of weakly defined domain objects.
Question: True or False: A Service is a great place to put the logic of connecting to a database.
Question: We need to create an object that will be stored in a large file in our Bounded Context. We can use a:
Question: True or False: A Factory is often an abstract interface defining the general create method or contract without the details coded. For example, a factory interface may have a createPayment empty method. It is combined with one or more concrete implementations that use the factory interface, each coding the createPayment method to different external systems accepting payments.
Question: If a Factory is a good place to put “create something from external system,” what is a good place to put “update something in external system?”
Question: What are some typical things done in a Repository?
Note: Make sure you select all of the correct options—there may be more than one!
Question: True or False: Because Factories and Repositories are related, they are often combined containing all the create, read, update and delete functionality for a specific object.
Order Abstractions
Question: When a server creates an order in the system, they include some basic information such as the orderId, serverId, and tableNumber. This creates a record in the database for that order.
The database logic can be hidden behind which of the following abstractions?
Question: The server will place an order once they have completed entering it into the system. Placing the order sends it to the kitchen where it will be printed using a ticket printer. The kitchen will remove the ticket and begin preparing the order.
The logic to print the ticket can be hidden behind which of the following domain abstractions?
Question: An existing order has already been created. A few additional people have arrived and it seems that the table originally assigned is no longer big enough. The customers at that table are being moved to a new table.
Moving the customers to a new table will require us to update the order in the database to reflect the change.
The database logic can be hidden behind which of the following domain abstractions?
Hexagonal Architecture Review
Question: Hexagonal Architecture is an alternative to:
Question: N-tiered Architecture is comprised of layers usually laid out linearly: User Interface (View/Controller) -> Domain (Model) -> Database (Persistence). In contrast, Hexagonal Architecture resembles a kind of onion, with a center and subsequent layers wrapping the center. What is the Hexagonal Architecture center?
Question: In Hexagonal Architecture, Ports are:
Question: True or False: Ports are the most important part of an application built using Hexagonal Architiecture, therefore it exists at the center.
Question: In Hexagonal Architecture, the ports layer is called:
Question: In Hexagonal Architecture, the position and role of the Infrastructure layer is to:
Question: True or False: Dependency direction always goes from Domain to API to Infrastructure. In other words, the Domain can have dependencies on (knowledge of) the API but the reverse is incorrect.
Question: The Domain should have knowlege of:
Question: True or False: If the Domain has no knowledge of any other layers in the Hexagonal Architecture, it’s possible for it to be portable.
Reactive BBQ Hexagonal Architecture
Question: For each of the following, indicate whether they belong in the Domain or the Infrastructure of the Orders Context:
Order
OrderDTO (A Data Transfer Object which is serialized into JSON to be exposed by a REST API)
OrderDBO (A Object/Relational Mapping. Maps database tables to classes/fields.)
OrderRepository
CassandraOrderRepository
CustomerReceiptView (Renders the order for printed receipts)
OrderItemFactory
Discount
Final Exam
Question: Available Advertising has built a pipeline to consume data from a variety of advertising networks. This data is then syndicated to a number of destinations through their Syndication Service.
The Syndication Service performs a variety of functions, but all of those functions revolve around a Syndication Destination (a company that has a Syndication Agreement with Available Advertising). When a Syndication Destination terminates it’s agreement, they have to remove all data for that Destination.
In the Syndication Service, a Syndication Destination is known as a/an
Answer:
Question: Consistent Fitness has built a new microservice to process data from their wearable fitness trackers. That microservice needs to communicate with their old legacy system which currently contains all of the fitness data. They are concerned that the mess of the old legacy system might accidentally leak into their pure microservice. They want to make sure they are properly insulated from that mess.
They ensure their new microservice remains pure by using a/an
Answer:
Question: CQRS Auto is a automobile trading company formed in the 1980s by four partners (Christa, Quentin, Rhonda, and Samuel). They have since grown to be one of the largest auto traders in the nation.
Their website allows dealerships, and private users, to add automobiles to the website so they can be advertised and sold. Users can log in to the website to view vehicles available in their region. They can also compare those vehicles, and can even save comparisons to their personal profile to be viewed later.
Requesting a list of cars available in your region could be achieved using which type of Domain Activity?
Answer:
When a user saves a comparison to their personal profile, this fact can be recorded by which type of Domain Activity?
Answer:
Adding an automobile to the site could be acheived using which type of Domain Activity?
Answer:
Question: Saga Electronics is an online retailer focusing on Electronics.
A portion of their system is responsible for notifying customers when their order has been completed. This notification usually takes the form of an email, but sometimes it can happen through a text message or through another mechanism, depending on the users settings.
They want to create an abstraction to hide the details of this functionality. When their system sends a notification, they don’t want it to know what kind of delivery mechanism is being used. So although the sending of the notification is important in the domain, the details of how it gets sent are not.
What type of Domain abstraction would be used here?
Answer:
Question: Two Generals Video, a video streaming company, has been working to break their system into smaller, more manageable chunks. They have separated their large domain into smaller subdomains that have their own model and ubiquitous language.
The combination of the model and ubiquitous language is called a/an
Answer:
Question: Scalable Games, an online gaming company, has built a new game that they hope will support many millions of concurrent users.
In order to decouple themselves from their database choices, they have chosen to build their system using Hexagonal Architecture.
In their Player Service they have implemented a PlayerRepository which helps them retrieve Player objects. They have an implementation of this called the SQLPlayerRepository. They expose these players through the PlayerApi. These players are then rendered in the PlayerView.
Which layer in Hexagonal Architecture would contain the PlayerRepository?
Answer:
Which layer in Hexagonal Architecture would contain the SQLPlayerRepository?
Answer:
Which layer in Hexagonal Arcitecture would contain the PlayerApi?
Answer:
Which layer in Hexagonal Architecture would contain the PlayerView?
Answer:
Question: Spectrum Messages has a mobile application that provides instant messaging and chat features.
Their system sends instant messages between multiple users. Once a message has been sent, it is final. A user can’t go back and edit their message after the fact.
However, a user can manage the messages they have received. Messages are stored in a mailbox. Within that mailbox, a user can move messages around, sort them, categorize them etc. They can also delete the messages. So while the messages themselves can’t be changed, the way they appear in the mailbox can be.
In this system, a message would be what type of Domain Object?
Answer:
In this system, the mailbox would be what type of Domain Object?
Answer:
We hope you know the correct answers to Reactive Architecture: Domain Driven Design. If Queslers helped you to find out the correct answers then make sure to bookmark our site for more Course Quiz Answers.
If the options are not the same then make sure to let us know by leaving it in the comments below.
In our experience, we suggest you enroll in this and gain some new skills from Professionals completely free and we assure you will be worth it.
This course is available on Cognitive Class for free, if you are stuck anywhere between quiz or graded assessment quiz, just visit Queslers to get all Quiz Answers and Coding Solutions.
More Courses Quiz Answers >>
Building Cloud Native and Multicloud Applications Quiz Answers
Accelerating Deep Learning with GPUs Quiz Answers
Blockchain Essentials Cognitive Class Quiz Answers
Deep Learning Fundamentals Cognitive Class Quiz Answers
Hadoop 101 Cognitive Class Answers