0

In my MVVM project there are model classes that are persisted to the database, such as Customer, Product and Invoice. I've put these in a namespace called [Company].[Technology].Model as per the namespace naming Convention.

I also have some model classes that never get persisted but are created and disposed during runtime. Such as the Session or SearchHit. These models are also presented through ViewModels and so on, but I would like to separate them out from the persisted models.

So what would a good namespace name be for these models?

Guge
  • 4,569
  • 4
  • 35
  • 47
  • This is really an opinion question. – DavidG May 07 '16 at 23:41
  • The term "model" does not imply persistence. In the interest of organization, you may want to group them as persistent and non-persistent models. – glenebob May 07 '16 at 23:45
  • In my Application the term model is means the domain model. I'm looking for a term for runtime situational data outside of the domain model. – Guge May 08 '16 at 00:24

1 Answers1

1

I would go with this:

  • [Company].[Technology].Models for non-persistent MVVM models
  • [Company].[Technology].ViewModels for non-persistent MVVM viewmodels
  • [Company].[Technology].Data.Models for persistent models

You may use [Company].[Technology].Data namespace to contain all classes related to persistent data, e.g. your derived DbContext class, etc.

But this is really an opinion question. You can use any namespace you want just be consistent.

Gabor
  • 3,021
  • 1
  • 11
  • 20