Presentation Level and Domain Class Naming Conventions

What are the naming conventions that you use for application domain model classes and presentation level classes? Postfixes / Prefixes to distinguish the purpose of a class at a glance:

For example, information about a person who returns from the DAL may be

public class PersonEntity 
{
  public Guid Id { get; set; }
  public SexType Sex { get; set; }
  public Date Birthdate { get; set; }
  public string Name { get; set; }
  public string Family { get; set; }
  public string Patronymic { get; set; }
  ...
}

or do you prefer PersonDataor PersonInfoor something more suitable?

Than I use data binding to create an appropriate presentation. For example, you SexTypeshould convert to a localized string (Male, Mann, Homme, Hombre, ...) Birthdatein the appropriate date format (YYYY.MM.DD, DD.MM.YYYY, ...) and the full name to → Family NP

Therefore, I use a different class of classes to represent the data. Sort of

public class PersonDecorator
{
  public string Sex { get; set; }
  public string Date { get; set; }
  public string FullName { get; set; }
}

PersonPresenter, PersonView, - ?

!

+3
1

EntityPurpose , (, ..) (, , ..).

PersonPresentation.

+1

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


All Articles