Working with data bases
-
Hello, I have a begginers design issue. I'm building an layered application(Presentation layer, Business logic layer and Data base layer). I have three entities in my application:customer,staff member and vendor that all of them deriving from person. The user can add new customer,staff member or vendor to the data base(using UI). My question is which layer is responsible for the next tasks: 1.Validating user data 2.Saving customer,staff member,vendor in to the DB. 3.Retrieving customer,staff member,vendor from the DB. 4.Perform other DB related manipulation with customer,staff member,vendor. 5.Which classes i need to define to perform the above tasks. I'm new in to object oriented programming so thru the current question i am trying to understand the concept. Thanks
-
Hello, I have a begginers design issue. I'm building an layered application(Presentation layer, Business logic layer and Data base layer). I have three entities in my application:customer,staff member and vendor that all of them deriving from person. The user can add new customer,staff member or vendor to the data base(using UI). My question is which layer is responsible for the next tasks: 1.Validating user data 2.Saving customer,staff member,vendor in to the DB. 3.Retrieving customer,staff member,vendor from the DB. 4.Perform other DB related manipulation with customer,staff member,vendor. 5.Which classes i need to define to perform the above tasks. I'm new in to object oriented programming so thru the current question i am trying to understand the concept. Thanks
columbos14927 wrote:
I have three entities in my application:customer,staff member and vendor that all of them deriving from person.
Vendors are almost never "people". They might have sales people representing them but those can change. Also customers can be companies and thus not "people" either.
columbos14927 wrote:
My question is which layer is responsible for the next tasks:
Business layer.
-
Hello, I have a begginers design issue. I'm building an layered application(Presentation layer, Business logic layer and Data base layer). I have three entities in my application:customer,staff member and vendor that all of them deriving from person. The user can add new customer,staff member or vendor to the data base(using UI). My question is which layer is responsible for the next tasks: 1.Validating user data 2.Saving customer,staff member,vendor in to the DB. 3.Retrieving customer,staff member,vendor from the DB. 4.Perform other DB related manipulation with customer,staff member,vendor. 5.Which classes i need to define to perform the above tasks. I'm new in to object oriented programming so thru the current question i am trying to understand the concept. Thanks
columbos14927 wrote:
1.Validating user data
a) client side input validation should be in presentation layer. b) Server side input validation should also be in presentation layer. c) Business rule validations should be in business logic layer.
columbos14927 wrote:
2.Saving customer,staff member,vendor in to the DB.
Actual data base CRUD operations will be in Data access layer but on successful validation the operation should be done in Business logic layer.
columbos14927 wrote:
3.Retrieving customer,staff member,vendor from the DB. 4.Perform other DB related manipulation with customer,staff member,vendor.
Again, the db layer should contain the data access logic and db entities. The actions should be triggered from business logic layer. Perhaps these article could be a little useful for you: Creating ASP.NET Applications with N-Tier Architecture[^] YaBlogEngine - A Tiny Blog Engine written in ASP.NET/C#[^]
Twenty years from now you will be more disappointed by the things that you didn't do than by the ones you did do. So throw off the bowlines. Sail away from the safe harbor. Catch the trade winds in your sails. Explore, Dream. Discover.