[RESOLVED]Where to store Data Transfer Objects in a MVC Application

I usually work with NTier setup for my web applications.  I always have a DTO layer (Data Transfer Object).  If I wanted to use DTOs in a MVC application, where would I store them and what is the proper way to name them?  This is probably opinionated, but
what is the norm? 

MVC is simply the presentation layer, put your DTOs where you would normally put them and call them what you would normally call them.

AidyF

MVC is simply the presentation layer, put your DTOs where you would normally put them and call them what you would normally call them.

Thanks for the reply.  Yea, I was just curious since they are like a Model for MVC – if they would go in the Model folder in the presentation layer.

Thanks again.

DTOs aren’t models, models represent your domain and are passed to views to display domain info, and form data is passed to models by the controller for the changes to be persisted.  Your DTO is just a bridge between (probably) your data source and your
models.

AidyF

DTOs aren’t models, models represent your domain and are passed to views to display domain info, and form data is passed to models by the controller for the changes to be persisted.  Your DTO is just a bridge between (probably) your data source and your
models.

Good information, AidyF. Thanks again.

Leave a Reply