Modeling the different perspectives of a population in a domain-driven project

When using a domain-driven project, I often run into a problem related to various aspects of a domain object, especially when using NHibernate. Prospects are essentially ways to view a domain object. For example, a simplified model:

class Transaction
{
  string Id { get; set; }
  string CustomerName { get; set; }
  DateTime Date { get; set; }
  decimal Amount { get; set; }
  decimal Tax { get; set; }
}

class Batch
{
    string Account { get; set; }
    string Number { get; set; }
    DateTime? ClearDate { get; set; }
    IList<Transaction> Transactions { get; }
    decimal Total { get; }
}

- . . , . - , . . , Total , - , :

class BatchOverview
{
    string Number { get; set; }
    decimal Total { get; set; }
}

NHibernate .

  • /GUI?
  • ?
  • ?
  • - ?

DDD , . Batch, BatchOverview "" - .

+3
1

- , . , ( -).

, nHibernate. nHibernate . ( access = "field" ).

EDIT: PresentationModel ViewModel .

, , , Id.

+3

Source: https://habr.com/ru/post/1756608/


All Articles