Concepts Flashcards

General concepts shown on part I of the book

1
Q

What are 4 ways of storing session data on the client side?

A
  • encoding data in a URL
  • using cookies
  • serializing data into a hidden HTML field
  • holding data in objects on a rich client
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What are 3 ways of storing session data on the server side?

A
  • as serialized object on the file system
  • as serialized object on a key value database
  • as broken up data into the database
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What are the main problems with storing session data on the client side?

A
  • requires transferring to much data to the server
  • data security
  • data integrity
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

Remote interfaces/objects should have […] grained interfaces, while local interfaces/objects should have […] grained interfaces.

A
  1. Coarse

2. Fine

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

What are the pros and cons of using a Domain Model pattern on the Domain Layer?

A

Pros

  • can be used to model complex domain logic
  • scales from simple logic to complex

Cons

  • hard to to it right
  • impedance mismatch with relational databases
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

What are the the application layer discussed by Fowler?

A
  • presentation
  • domain
  • data source
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

What is the most common way of organizing Transaction Scripts

A

To have several transaction scripts in a single class, where each class defines a subjects area of related scripts.

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

Which GOF pattern can be used to organize transaction scripts?

A

The Command Pattern, where each transaction script is coded in its own class.

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

Why Fowler uses the term Transaction Script?

A

Because MOST of the time you’ll have a transaction script for each DB transaction.

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

What does Fowler consider a Simple Domain Model and a Rich Domain Model?

A

A simple domain model looks very much similar to the database model (one object per DB table).

A rich domain model can be different from the DB model, and uses more OO techniques, and patterns. It is more suited for complex domain logics.

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

For persistence, a simple domain model can use (…), whereas a rich domain model requires a (…)

A

Active Record

Data Mapper

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

Why is it recommended that the Domain Model have a minimum coupling with other layers of the system?

A

Because business logic can change a lot.

So we should try to make it as easy as possible to modify, test and build that layer.

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

Bloated Domain Objects are a concern with domain model. Sometimes to avoid bloating, people tend to create usage-specific class (like a transaction script for a specific use case). What is Fowler advice on that?

A

He says that creating usage specific class can make it harder to see all the logic related to a specific domain object (ex. Order), and because of that duplication of code can occur. Also, bloating happens much less frequently than people usually expect. So it is better to put the logic on the domain object that is seems fit. Bloating will be easy to spot and refactor later.

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

When using Domain Model, what is the recommended pattern for database interaction?

A

Data Mapper

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

What is the main difference between Domain Model and Table Module?

A
Table Module tends to model classes based on the structure of the database. 
Table Module objects does not have the notion of identity. While in Domain Model you have one object per instance of domain concept (ex: a specific Order), in Table Module you have one object or class that handles all instances of a domain concept.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

What is the advantage of the Table Module pattern?

A

Easier integration with the underlying table-oriented data structures. (good when using RecordSet based frameworks like some .NET ones)

17
Q

Fowler divides business logic into two kinds. Which are they?

A

Domain logic: related with the problem domain

Application logic: related to the application responsibilities (notifications, integration etc)

18
Q

What are the two implementation variation of Service Layer?

A

Domain facade

Operation script

19
Q

What is architecture to Fowler?

A

It is a subject term. Basically it is the important decision took about the system.

Things hard to change.

20
Q

What is layering?

A

A common way of breaking apart a complex software system into isolated parts.

Typically one layer only depends on the layer below and provides services for the layer above. This is good because you could change a whole layer without touching the others.

21
Q

What are the 3 most common layers in enterprise software?

A

Presentation

Domain Logic

Data Source

22
Q

What is Hexagonal Architecture?

A

Proposed by Alistair Cockburn, it considers that everything external (db, client) is an outside interface. So it is a symmetrical layering system where the domain logic is in the center.

23
Q

What is offline Concurrency?

A

is a term for concurrency control for data that is manipulated between multiple transactions.

24
Q

What are the two essential problems with Concurrency?

A

Lost updates

Inconsistent reads (you read part of an old information and part of a new information)