Web Application Architecture Flashcards

1
Q

What external system do you know?

A

An external system is something that lives outside your application, like a database, some remote web service, the system’s clock, the file system, and so on.

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

What are the differences between infrastructure and core code?

A

Infrastructure code - it’s all external system and low-level system things.

Core code - It’s a domain logic ( just business requirements)

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

How to avoid direct interaction with database?

A

We can create a separated class/method which will encapsulate DB interaction and we can use this method instead (send us dependency). ( Something like Command in our project)

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

What main rules we need to use to build a clean web application?

A

1) Core code doesn’t directly depend on external systems

2) Core code doesn’t need a specific environment to run in ( can be run in console/api/admin)

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

What is Table Data Gateway?

A

Table Data Gateway is a design pattern in which an object acts as a gateway to a database table. It hides the SQL statements and other implementation details behind a single interface per database table. (It’s like class for one table with methods which can wrap your SQL statement get/insert/update)

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

What is Repository?

A

“Object savers” are usually called repositories. Repository is the name of a design pattern which provides a solution to a common problem: the need to save a domain object, and later reconstitute it.

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

What is Data Mapper pattern?

A

DataMapper “moves data between objects and a database while keeping them independent of each other and the mapper itself” ( send params -> save records to DB). DataMappers to serve their main function, mapping domain objects to the database and vice versa.

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

What is service locator pattern?

A

Class which contains all depency that we need to run the service.

class Sample
        Service service = ServiceLocator.getService("ServiceOne");
        service.execute();
    service = ServiceLocator.getService("ServiceTwo");
    service.execute();

    service = ServiceLocator.getService("ServiceOne");
    service.execute();

    service = ServiceLocator.getService("ServiceTwo");
    service.execute(); end
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

What main layers ( folders ) we can use?

A
  • Entity
  • Repository
  • Domain Event
  • Event Subscriber
  • Service
  • Input object (form, parameter object)
How well did you know this?
1
Not at all
2
3
4
5
Perfectly