Timeline for Confused about layered application development
Current License: CC BY-SA 3.0
9 events
| when toggle format | what | by | license | comment | |
|---|---|---|---|---|---|
| May 21, 2014 at 13:10 | comment | added | tgkprog | This is one way of looking at it. If you need say - an abstract layer above (2) can insert a service layer there that talks to the data base layer for you. Why ? can have more than 1 db ... or to do validation checks that dont fit in bussiness layer. also below (1) I would keep a utils that dont use your model but provide generic user capabilities like a special sorting or help read properties or anything else generic like ordent.util.lang, ordent.util.https etc | |
| May 21, 2014 at 11:25 | comment | added | Ortund | So on my DBContext project, I have UserDBContext which contains this -> pastebin.com/cYX5RjZK ... Really I'm just trying to find out if this is an appropriate place for my CRUD functions | |
| May 21, 2014 at 11:15 | comment | added | metacubed | Yes that seems appropriate as a Data Access layer query. | |
| May 21, 2014 at 11:13 | comment | added | Ortund | To give you some idea, GetUsers() would look something like this... public List<User> GetUsers() { return db.Users.Include(r => r.Role).ToList(); } | |
| May 21, 2014 at 10:57 | comment | added | metacubed | Is it a direct database query? Then it probably goes to the Data Access layer which I guess is your DBContext project. And for your second comment, yes that is business logic, which goes into a separate package. Whether it is a whole separate project is up to you :) You can always separate later as long as you make sure that each layer only uses the packages it is supposed to and is cleanly separated out. | |
| May 21, 2014 at 10:50 | comment | added | Ortund | and then business logic (calculating change on purchases and stuff) would go into a separate project? | |
| May 21, 2014 at 10:49 | comment | added | Ortund | So if I understand you, that means my code for login, getting listings (GetUsers(), GetUserById(int UserId), etc) go into what is, at this point, my DBContext project? | |
| May 21, 2014 at 10:39 | history | edited | metacubed | CC BY-SA 3.0 | added 6 characters in body |
| May 21, 2014 at 10:34 | history | answered | metacubed | CC BY-SA 3.0 |