What is a domain class?

Asked

Viewed 2,693 times

7

What is a domain class? Why "domain"? Are there methods that it should not have (which is not its function to have determined type of method)? It admits what kind of methods?

  • Have any answers solved what was in doubt? Do you need something else to be improved? Do you think it is possible to accept it now?

2 answers

5

There are controversies.

It is generally accepted that it is a class representing business entities. It is common that they are classes that serve as aggregates of other classes that are also domains or mechanisms (for example what makes the data persistence).

Some say it must be an anemic class, that is, it has no methods, or has only those connected with the fields. Others admit that they may have other types of methods linked to the domain, that is, to the business rule. There are no methods linked to the software itself.

Some say it is any class. Even the mechanisms have their own domain.

Some say that the term is not even correct and there is only the domain model and not class, even because the domain is composed of several classes.

Anyway, it’s a conceptual thing in a negative sense. It’s a term that doesn’t match what people actually use, it’s confusing, it doesn’t help to give better understanding and I prefer to ignore it in the way it’s usually presented. If you create better things defined for the same idea maybe it becomes interesting.

Of course, who learns in a way and likes will say that it is right and that is great. Good for this person. See if it is good for you. For me it is not.

  • What is dominion?

  • I am reading an EF book and there he speaks "Omain class" and in the example he is giving are two classes (Destination and Hosting) created in the Model project.

  • 1

    https://en.wikipedia.org/wiki/Domain_(software_engineering). So each source deals with one way.

  • 1

    @Marconi think related, same thing I think not.

0

Domain classes are used to create the various elements in the domain and domain relationships are the links between the elements. They are the representation of design time, the elements and links that will be instantiated by the users of the specific design language when creating their templates.

Their properties are:

Access modifier: The access level of the domain class (public or international).

Custom attributes: Used to add attributes to the source code class that is generated from that domain class.

Generates two derivatives If True, a base class and a partial class (to support customization through replacements) will be generated. For more information, see replacing and extending the Classes generated by.

Has a custom constructor: If True, a custom constructor will be provided in the source code. For more information, see replacing and extending the Classes generated by.

Inheritance Modifier: Describes the type of inheritance of the source code class that is generated from the domain class (None, Abstract or Sealed). None Base class If this domain class is derived, the name of the base class.

Name: The name of this domain class.

namespace: The namespace of this domain class. Current namespace Notes Informal notes associated with this domain class. <>>> Description The description is used to document the generated designer’s user interface.

Display Name:.

Help Keyword: The optional keyword that is used to index the F1 Help to that domain class.

SOURCE: https://msdn.microsoft.com/pt-BR/library/bb126503.aspx https://docs.microsoft.com/pt-br/visualstudio/modeling/understanding-models-classes-and-relationships

Browser other questions tagged

You are not signed in. Login or sign up in order to post.