Architecting .NET apps Flashcards

1
Q

What is a common problem in technology?

A

Learn something new and try to use it everywhere as at silver bullet.

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

What is an expert as per the bridge saying?

A

Anyone can design a bridge that stands, but it takes an engineer to design a bridge that barely stands. Meaning you need to spend just enough resources to solve the problem.

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

What are the reasons to select an architecture?

A

To: save money, effort and time. Instead of experimenting, challenging or improving the resume.

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

What are the 5 common “thinkings” of the astronaut assessment (head in the cloud)?

A
  • We must use this shining technology for this!
  • Reinvent the wheel.
  • Never ORM.
  • Always code to an interface.
  • Use all the patters from the GoF book.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

When is it allowed to introduce complexity to the application?

A

When it is JUSTIFIED. Ultimately we’re paid for solutions, not code.

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

What is the Parkinson’s Law?

A

Work expands to fill available time.

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

What the Parkinson’s law means in the software development when a developer has tight timeline?

A

He comes with smart and simple solution to meet the deadline. Developers somehow pull it off.

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

How usually developers proves the Parkinson’s law? Do they made things simpler?

A

By leveraging the SIMPLICITY: the art of maximizing the amount of work NOT done.

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

Why agile says about maximizing the work not done? Should we do everything right away?

A

You can wait as long as possible until the work is absolutely necessary (by then you might get more information that will help solving the problem).

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

What are the 6 aspects of the “Do the simplest thing that could possibly work”?
Note: This is listed in the extreme programming wiki.

A

Get done sooner.
Easier to communicate;
Duplication is obvious, so the need for refactoring is clearer;
Tests are easier to write;
Code is easier to performance tune;
You feel less stress, which enhances all of above.

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

What is the 80/20 rule?

A

Get 80% of the benefit by doing 20% of the work.

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

What does the agile manifesto say?

A

Maximize the work not done;

Welcome changing requirements, even late in development.

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

What are the 7 key lean principles?

A
1 - Eliminate waste;
2 - Amplify Learning;
3 - Decide as late as possible;
4 - Deliver as fast as possible;
5 - Empower the team;
6 - Build integrity in;
7 - See the whole.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

What are the specifics of lean principles?

A

1 - Not adding value to the customer is likely waste;
3 - When the choice is unclear, choose the simplest one;
4 - Ideal architecture varies by team;
6 - Automated testing.

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

What is the main outcome of the minimum viable product?

A

The validated learning (user’s feedback). Is about answering questions.

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

What is not part of a minimum viable product?

A

Usually expensive items, such as Scalability, beauty, code cleanliness, performance, security and if it even actually works.

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

What is the project triangle? Which one is usually sacrificed for the sake of others?

A

A triangle containing quality, date and cost… increasing any of the edges, will increase the others. Quality is usually sacrificed in form of technical debits.

18
Q

What is the difference between hard and soft deadlines?

A

Hard: you have to hit the milestone due to, e.g make a published advertising
Soft: someone said so based on guess. The software architect usually explains to the non-tech people what are the implications.

19
Q

What are common layers in software architecture? What are their equivalent terms?

A
  • presentation aka UI;
  • service aka API;
  • Domain aka Business Logic;
  • Persistence aka Data Access (DAL)
20
Q

What is the difference between layer and tier?

A

layer is logical and tier is physical or virtual.

21
Q

What are the pros and cons of tiers?

A
  • Pros: Scalability, Security, Uptime, Reusability.

- Cons: Performance cost and Increased complexity.

22
Q

How the layers are represented in .NET? What are the benefits?

A

Each layer is a csproj… business layer (and business layer.tests), data layer and presentation layer. The benefits are separations of concerns, abstract complexity, support testing via interfaces, minimize dependencies and enable reuse.

23
Q

How does the layers are represented in a very simple app (e.g console app)?

A

Maybe methods are a suffice separation for such application.

24
Q

What is the business logic layer?

A

Manages the behaviors that are triggered by the presentation layer. This layer shields the presentation layer from the persistence logic

25
Q

What are the business layer patterns? From less to most complex?

A

Transaction script (procedural), table module, active record (both data driven) and domain model (business driven).

26
Q

How the Transaction Script pattern work? When is it a good? What are the risks?

A

One public function per UI operation. Very simple but kind of procedural.
It is good for tight deadlines.
There is the risk of duplication and difficult to maintain overtime.

27
Q

What is the Table Module pattern? Is it legacy?

A

Classes represent tables (datasets and datatables). Used to be very popular. Yes, it is legacy approach - replaced by entity framework.

28
Q

What is the Active Record pattern? What are the pros and cons?

A

Each class instance represents a row (similar to dataset?). Class knows how to persist itself and contains business logic.

pros: simple, good for simple domain and CRUD applications.
cons: rigid domain (tied to DB), leads to swiss switchblade classes, low cohesion, hard to test and tricky transactions.

29
Q

What is the domain drive design? What are the pros and cons.

A

It is about understanding the business and terms used not bothering with how the persistence layer will look like.
Pros: Manage complexity, leverage design patterns, speak business logic, abstract ugly db schema, compliments large teams and it is reusable.
Con: Learning curve, time-consuming design, long-term commitment (investment upfront), DB mapping overhead.

Note: Suggested book: Eric Evans - Domain Driven Design

30
Q

What is object relational mismatch?

A

It is when you classes do not match the database tables.

31
Q

What are the .NET tooling for each business layer pattern?

A

1 - Transaction script: None;
2 - Table Module: Data tables and datasets;
3 - Active Record:EF / Linq to SQL / Castle Active Record;
4 - Domain Model: None. Note: DB is separate concern;

32
Q

What is the author’s heads-up about Interactions?

A
  • He says that only logically interrelated classes should interact in the business.
  • The Service Layer should handle all other interactions.

Meaning that complex interactions should happen in the service layer.

33
Q

What are the main responsibilities of Service Logic Layer?

A
  • Acts as an intermediary between the presentation layer and the business logic layer.
  • Coordinate the domain, meaning complex interactions will be abstracted.
  • Can be seen as a facade (simplify complex calls and make the classes loosely coupled).
  • Takes requests from one layer and sends to another (taking care of calling order).
  • Can centralize handling cross-cutting concerns such as logging, error-handling and security (authe and autho).
  • Can handle searching, notifications to listeners, bindings and managing transactions (e.g only send the email if all the other business logic succeeds).
34
Q

Why do we say that the service layer should be thin?

A

Because it should only make it easier to the presentation layer to call complex routines in the business and it must delegate most of the work to the business objects. Also data validation.

35
Q

What is a real-world example of service layer when we look to the restaurant?

A

The waitress interfaces (she and the menu are the API) customers orders to the kitchen. So that customers do not know about complexities, they simply get their orders in the end.

36
Q

What is the real-world example of the service layer when we look to a boss?

A

He accomplishes tasks through others.

37
Q

When to use a Service Layer? Does it have to do with reusability and complexity?

A

When you have multiple UIs, so that you can centralize some calls in the Service Layer. Multiple consumers of business logic. And when you have complex interactions among domain objects.

38
Q

What are the pros and cons of deploying the Service Layer as a service or a shared library? Which one is the default?

A

Webservice:
1 - Clients are independent of the service.
2 - Can scale.
3 - Centralized deployment.

Shared libs (Default to this):
1 - Native code in the process.
2 - No serialization overhead.
3 - works offline. always available. no public exploit. Simplest thing that works.

39
Q

What should the service layer return?

A
1 - Data Transfer Objects (DTO - aka class with no methods);
2 - Copy of domain entities without behavior;
3 - Simplest thing is to expose the Domain entity.
40
Q

What is a DTO? When to use it?

A

Object that carries that across an application’s boundaries with primary goal of minimizing round trips. Avoids coupling between UI and domain layers.
To solve circular references. Efficiency by creating DTOs with only the necessary data and easy structure.

Use them where it makes sense. Useful but optional.