mdialogo
mdialogo

Reputation: 473

Different types of models in MVP

I'm still learning MVP with winforms and I noticed there seems to be different types of models that could be used in MVP. For example, there are Domain model, logical data model, and data models. I found an answer here but it seems not sufficient for my situation. I am building an application wherein the user can create items called audit jobs and in those jobs he can add sub items (called mdb batches). Additionally, each batches should be able to store audit details or rows (e.g. recordID, column_name, error, operator, etc.).

My question is how should I know which model to use or apply for this particular problem? Any help would be very much appreciated. Thank you,

Upvotes: 0

Views: 172

Answers (1)

toadflakz
toadflakz

Reputation: 7934

Typically, you will end up using a number of models within your application. Domain models are generally the model that your business logic will work with and the logical data model maps the domain model objects within a repository.

Using a "service layer with repository" architecture, your services would "speak" domain model objects to the repository, but the repository is likely to either derive its own versions of those objects or translate them into more storage friendly (logical data) objects for its own logical purposes.

On the presentation side, you may work with presentation model objects to, for example, encapsulate Enum values in a UI-friendly manner (the Enum members may be decorated with DescriptionAttribute and you want to expose that user-friendly value to the user in the UI).

Upvotes: 1

Related Questions