Chapter 5. A Model Expressed In Software Flashcards
An association in the model means there is what in the software?
A mechanism with the same properties.
DDD, p. 82
Three ways to make associations more tractable are:
Impose a ________ direction
Add a _________ (effectively reducing multiplicity)
Eliminate _________ associations
- traversal direction. (e.g a country has a president)
- Add a qualifier, (e.g,, a country has only one president during a particular period)
- nonessential associations
DDD, p. 83
An object defined primarily by its identity is called an __________.
Entity
DDD, p. 91
For an entity, an identifying attribute must be guaranteed to be _______ within the system.
Unique
DDD, p. 92
For an entity, an identifying attribute must be guaranteed to be _______ within the system.
Unique
DDD, p. 92
Value objects are instantiated to represent elements that we care about only for ________ they are, not _________ or _______ they are.
What
Not who or which
DDD, p. 98
When creating property for value object in Obj-C , the defaulting qualifier is which: atomic or nonatomic?
Nonatomic
ObjC.io issue on Foundation, Value Objects
By default properties are Strong or Copy?
Strong
ObjC.io issue on Foundation, Value Objects
Where else could the ‘copy’ qualifier be assigned?
in the implementation.
_name = [ name copy ];
ObjC.io issue on Foundation, Value Objects
For an immutable object, when do you want to assign Copy to a property?
When there is a mutable counterpart to the type. E.g. string
@property (nonatomic,copy) NSString* name;
ObjC.io issue on Foundation, Value Objects
How can you compare to value objects?
implement the isEqual method using all properties and implement a hash function
ObjC.io issue on Foundation, Value Objects
What is a hash?
a pseudorandom number generated from the object’s properties.
ObjC.io issue on Foundation, Value Objects
What are two good qualities of a hash?
deterministic and uniform
ObjC.io issue on Foundation, Value Objects
If the properties that go into a hash value change, what else changes?
the hash value… bad… make sure things are immutable
From objc article on value objects
The code should contain an _________ that is guaranteed to produce a ________ result for each entity object.
operation
unique
DDD, p.92
How are properties a convenience for objective-c programmers?
when synthesizes, properties give you automatic getters and setters.
inferred from iOS programming (Big Nerd), p. 72
How many property attributes are there?
Three
iOS programming (Big Nerd), p. 72
Most objective-c programmers use which of these: atomic or nonatomic?
Nonatomic
iOS programming (Big Nerd), p. 73
When would you use atomic as a property value?
for multi-threaded applications.
iOS programming (Big Nerd), p. 73
Which is the default property? Atomic or nonatomic.
Atomic. Will always need to explicitly declare nonatomic.
iOS programming (Big Nerd), p. 73
Multi-threaded or concurrent programming allows you to take advantage of multiple _______.
CPUs
ObjC.io issue on Concurrent Programming, Editorial