Reputation: 12695
I'm wondering about one thing - is it better to place all business objects and adapters in the Model folder or create 3 layers (BLL/DAL/BO) instead of the Model folder ?
Upvotes: 3
Views: 1207
Reputation: 6009
I'm not sure why, but I really hate the naming of "BLL/DAL/BO". I'm sure there's some "microsoft best practice whitepaper" or something somewhere that says that's a good idea, and that's probably the problem. People see that and think if they name things like that then they must be doing it "right".
Follow the SOLID Principles along with Domain Driven Design.
How you divide up the classes, whether it be by folder, namespace, assembly etc is really a matter of personal preference. I personally like to break things up into assemblies a lot because it makes it easier for me to stay honest and prevent circular dependencies and having things coupled to things they shouldn't be coupled to. There are definitely downfalls of having too many assemblies though, so you have to manage that too.
Upvotes: 0
Reputation: 499002
If you follow the single responsibility principle, which states that a class should only change for one reason, the answer would be clear:
create 3 layers (BLL/DAL/BO)
As for where to place them - for organizational reasons, I would create a different folder for each layer.
Upvotes: 2
Reputation: 24754
The physical location of files is up to you.
Physical location doesn't make code worse or better.
Upvotes: 0
Reputation: 1896
I prefer to create a class library with all my data access code and then reference it in the MVC application, or by using dependency injection.
You could use the model's folder for site specific view models for pages.
Upvotes: 0