46 lines
1.2 KiB
Plaintext
46 lines
1.2 KiB
Plaintext
%% After: Client and Order become plain domain objects (no DbBase inheritance).
|
|
%% Dedicated *Dto classes carry data to/from the WebApp, and a mapper converts
|
|
%% each way, including the relations. EF dependency isolated to persistence layer.
|
|
classDiagram
|
|
class DbContext {
|
|
+SaveChangesAsync()
|
|
}
|
|
class DbBase {
|
|
+Guid id
|
|
}
|
|
class WebApp {
|
|
<<Web App>>
|
|
}
|
|
class Client {
|
|
+Guid id
|
|
+string name
|
|
}
|
|
class Order {
|
|
+Guid id
|
|
}
|
|
class ClientDto {
|
|
+Guid id
|
|
+string name
|
|
}
|
|
class OrderDto {
|
|
+Guid id
|
|
+ClientDto client
|
|
}
|
|
class Mappers {
|
|
+ClientDto ToClientDto(Client c)
|
|
+Client FromClientDto(ClientDto dto)
|
|
+OrderDto ToOrderDto(Order o)
|
|
+Order FromOrderDto(OrderDto dto)
|
|
}
|
|
|
|
DbContext ..> DbBase : still used by persistence layer
|
|
WebApp --> ClientDto
|
|
WebApp --> OrderDto
|
|
WebApp --> Mappers
|
|
Mappers <--> Client : maps each way
|
|
Mappers <--> ClientDto : maps each way
|
|
Mappers <--> Order : maps each way
|
|
Mappers <--> OrderDto : maps each way
|
|
Client "1" --> "*" Order : has many (domain relation)
|
|
ClientDto "1" --> "*" OrderDto : has many (DTO relation)
|