Last post Mar 21, 2017 02:34 AM by Shuklaji123
Mar 19, 2017 05:06 PM|Shuklaji123|LINK
By this question, I want to elaborate that how are classes made in a BO, BAL and DAL layers ? For example, Registration and login should be treated as methods and have to be made in DAL and needs to be called in BAL layer. But how are classes made in BEL,
BAL and DAL layer? Hope you guys, understood my question....Thanks
Mar 19, 2017 09:50 PM|Dmitry Sikorsky|LINK
So, you store objects in the database. They are described by entities. Usually it is just DTO (data transfer object, object that contains fields only, not methods of business logic etc).
I would suggest to use view models to transfer data to the views. It is like DTO too, but it contains the data that a view needs to be displayed. For example, the main page of the shop may contain news, most popular articles, new articles, features categories
etc. So you create view model with this fields.
To initialize view model I would suggest to use view model factories (just another one class that creates the view model of the specific type, goes to the db using the unit of work and repository pattern).
Mar 20, 2017 02:37 AM|Shuklaji123|LINK
Thank you so much, but can u send me sample of the same in core asp.net ....Thanks a lot............
Mar 20, 2017 08:21 AM|Dmitry Sikorsky|LINK
You could take a look at this project: https://github.com/Platformus/Platformus/tree/master/src
Look at some extension, like on the set of projects with name "Platformus.Forms.Xxx".
Each project contains some part you and I have mentioned. For example, "Platformus.Forms.Data.Models" contains entities (DTO). And it really should be renamed to Entities.
Backend contains view models, views, controllers etc. Data.EntitiyFramework.Xxx contains implementations for different storages.
The whole project have the same structure so it is easy to understand it while it is still a bit huge.
Mar 21, 2017 02:34 AM|Shuklaji123|LINK
Thank you soooooooo much, but can you send me any sample of any n-tier architecture of simple asp.net core ? Will be highly oblidged...