Chapter 5. A Model Expressed In Software Flashcards

1
Q

An association in the model means there is what in the software?

A

A mechanism with the same properties.

DDD, p. 82

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Three ways to make associations more tractable are:
Impose a ________ direction
Add a _________ (effectively reducing multiplicity)
Eliminate _________ associations

A
  1. traversal direction. (e.g a country has a president)
  2. Add a qualifier, (e.g,, a country has only one president during a particular period)
  3. nonessential associations

DDD, p. 83

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

An object defined primarily by its identity is called an __________.

A

Entity

DDD, p. 91

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

For an entity, an identifying attribute must be guaranteed to be _______ within the system.

A

Unique

DDD, p. 92

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

For an entity, an identifying attribute must be guaranteed to be _______ within the system.

A

Unique

DDD, p. 92

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

Value objects are instantiated to represent elements that we care about only for ________ they are, not _________ or _______ they are.

A

What
Not who or which

DDD, p. 98

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

When creating property for value object in Obj-C , the defaulting qualifier is which: atomic or nonatomic?

A

Nonatomic

ObjC.io issue on Foundation, Value Objects

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

By default properties are Strong or Copy?

A

Strong

ObjC.io issue on Foundation, Value Objects

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

Where else could the ‘copy’ qualifier be assigned?

A

in the implementation.
_name = [ name copy ];

ObjC.io issue on Foundation, Value Objects

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

For an immutable object, when do you want to assign Copy to a property?

A

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 well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

How can you compare to value objects?

A

implement the isEqual method using all properties and implement a hash function

ObjC.io issue on Foundation, Value Objects

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

What is a hash?

A

a pseudorandom number generated from the object’s properties.

ObjC.io issue on Foundation, Value Objects

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

What are two good qualities of a hash?

A

deterministic and uniform

ObjC.io issue on Foundation, Value Objects

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

If the properties that go into a hash value change, what else changes?

A

the hash value… bad… make sure things are immutable

From objc article on value objects

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

The code should contain an _________ that is guaranteed to produce a ________ result for each entity object.

A

operation
unique

DDD, p.92

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

How are properties a convenience for objective-c programmers?

A

when synthesizes, properties give you automatic getters and setters.

inferred from iOS programming (Big Nerd), p. 72

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
17
Q

How many property attributes are there?

A

Three

iOS programming (Big Nerd), p. 72

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
18
Q

Most objective-c programmers use which of these: atomic or nonatomic?

A

Nonatomic

iOS programming (Big Nerd), p. 73

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
19
Q

When would you use atomic as a property value?

A

for multi-threaded applications.

iOS programming (Big Nerd), p. 73

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
20
Q

Which is the default property? Atomic or nonatomic.

A

Atomic. Will always need to explicitly declare nonatomic.

iOS programming (Big Nerd), p. 73

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
21
Q

Multi-threaded or concurrent programming allows you to take advantage of multiple _______.

A

CPUs

ObjC.io issue on Concurrent Programming, Editorial

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
22
Q

Which is the default property qualifier: readwrite or readonly?

A

readwrite

iOS programming (Big Nerd), p. 73

23
Q

Which property qualifier would you want to use for a value object? : readwrite or readonly

A

Readonly. This makes them immutable which is a required characteristic of value objects.

ObjC.io issue on Foundation, Value Objects

24
Q

Which of these property qualifiers is default: strong or assign?

A

It depends on the type of property!

iOS programming (Big Nerd), p. 73

25
Q

A property whose type is not a pointer to an object (scalar property), like -int-, does not need memory management and thus defaults to which one: strong or assign?

A

assign

iOS programming (Big Nerd), p. 73

26
Q

For pointers to objects which is the default: strong or assign?

A

strong

iOS programming (Big Nerd), p. 73

27
Q

When you have a property that points to an instance of a class that has a mutable subclass (like NSString or NSArray) which should be the qualifier: strong or copy?

A

Copy

iOS programming (Big Nerd), p. 76

28
Q

When pointing at a mutable subclass and not using copy, the item can be ________ without knowledge of the object that also points to it.

A

changed.

iOS programming (Big Nerd), p. 77

29
Q

Bidirectional associations do or do not make sense between value objects?

A

do not make sense because you could not say that one value objects points directly to the one pointing to it - no identity.

DDD, p. 102

30
Q

When we force an operation into an object that doesn’t fit the objects’s definition, the object loses its ___________ and becomes hard to understand or ___________.

A

conceptual clarity
refactor

DDD, p. 104

31
Q

One should use a service when _________ is actually an important domain concept.

A

an operation

DDD, p. 105.

32
Q

In object oriented programming, an interface generally defines the set of ________ that an instance of a class that has that_______ could _______ to.

A

the set of methods (or messages)
interface
respond.

http://stackoverflow.com/questions/2866987/what-is-the-definition-of-interface-in-object-oriented-programming

33
Q

When you write an interface, you’re basically saying:

A

“I need something that…”

http://stackoverflow.com/questions/2866987/what-is-the-definition-of-interface-in-object-oriented-programming

34
Q

A good service relates to a __________ that is not a natural part of an _______ or _________.

A

domain concept
entity
value object

DDD, p. 105

35
Q

A good service is an _________ that is defined in terms of the __________ in the domain model.

A

interface
other elements

DDD, p, 105

36
Q

T/F A good service is stateless.

A

True

DDD, p, 105

37
Q

For a service, statelessness means that any ________ can use any instance of a particular service without regard to the instance’s ______________.

A

client
individual history

(If a class Cheetos Bag implements the Chip Bag interface, you should expect a Cheetos Bag to behave exactly like any other Chip Bag. (That is, expose the .attemptToOpenWithoutSpillingEverywhere() method, etc.)

DDD, p. 105

38
Q

An interface indicates ________ of the object that implements the interface.

A

capability

(Walkable might be a good interface to have if your system has many things that can walk.)

http://stackoverflow.com/questions/444245/how-will-i-know-when-to-create-an-interface

39
Q

T/F A service should be implemented as a phony object.

A

False, this would be misleading.

DDD, p. 105

40
Q

Services can appear in which layers?

A

Application, domain, or infrastructure

DDD, p. 106

41
Q

If the operation for a service has any meaning in the domain then it should be in the ______.

A

Domain model

DDD, p.106

42
Q

What is meant by “clients” in the OOP world?

A

In the gof book, the client is the code or class that is using the classes in the pattern.

http://stackoverflow.com/questions/15847806/client-concept-in-oop-design-patterns

43
Q

A distributed system is a ________ of independent computers that appears to its users as a _________ system (Tanenbaum, van Steen)

A

collection
single, coherent

http://www.win.tue.nl/~johanl/educ/2II45/ADS.02.Distributed.pdf

44
Q

The primary motivation for using modules is ___________.

A

cognitive overload

DDD, p.109

45
Q

There should be _______ cohesion between modules and _____ cohesion within them.

A

low
high

DDD, p,109

46
Q

True / False: Modules (packages) can be implemented in Objective-C.

A

False.

http://stackoverflow.com/questions/1000707/objective-c-equivalent-of-java-packages

47
Q

Refactoring modules are more or less work than refactoring classes?

A

More

DDD, p.110

48
Q

If your model is telling a story, the modules are _______.

A

chapters

DDD, p.110

49
Q

With packages, Java can have two _______ with the same name “connection”

A

Classes

e. g.,
com. cod3r.app.network.Connection and com.cod3r.app.database.Connection

50
Q

In Java, the_____ name gets longer where as in Objective-C the ______ name gets longer.

A

package
class

http://www.cod3r.com/2011/01/what-objective-c-can-learn-from-java-part-4-namespace/

for a helpful overview of packages in Java see:
http://docs.oracle.com/javase/tutorial/java/package/index.html

51
Q

The difference is [in Java] the fully qualified ________ would only be used in the _____ statement, and the short _______ would be used in the code, instead of the _______ used in every location as seen in Objective-C.

A
class name  
short class name 
really long classname  

http://www.cod3r.com/2011/01/what-objective-c-can-learn-from-java-part-4-namespace/

52
Q

Most systems must use some non object technical infrastructure, most commonly ___________.

A

relational databases

DDD, p. 120

53
Q

The most effective tool for holding the parts [from mixed paradigms] together is a robust _________ that underlies the whole heterogeneous model.

A

ubiquitous language

DDD, p. 121

54
Q

Before taking on the burden of mixed paradigms, the options within the _________ should be exhausted.

A

dominant paradigm

DDD, p. 122