Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Business Layer #6

Open
ghost opened this issue May 14, 2014 · 3 comments
Open

Business Layer #6

ghost opened this issue May 14, 2014 · 3 comments
Labels

Comments

@ghost
Copy link

ghost commented May 14, 2014

Creating an Abstraction Layer between Model and Db ? How ? Usefulnesses ?

@ghost ghost added the question label May 14, 2014
@blablanumerodeux
Copy link
Member

Is an API a data access layer ?
Or there is another thing called data access layer ?
Do you mean an ORM like hibernate but for nodejs ?

@ghost
Copy link
Author

ghost commented May 21, 2014

Data Access Layer is an Abstraction Layer :

  • It allows to create business Objects with the same properties that our Model Objects
  • It defines the Business Logic ("la couche métier")
  • It is another layer to check values before DB operations

Until there, you may say "Oh, but it is our Model Layer so what for creating a such layer ?"

In fact, a Data Access Layer is really useful for :

  • Tests : it's a pipe where in input you give parameters, in output you test what it's returned and in the middle (in the pipe), you use the functions of the Business Object
  • It's a real way to separate the model and web layer from the database
  • This layer can be used on every platform : using a web application, a winform or whatever (like an API)

For our project, this DAL is not compulsory but it will help us to test easily our functions to query to the database

@blablanumerodeux
Copy link
Member

Okay, I see, at my work we use DAOs (Data Access Objects) to do exactly what you say, so I presume that all these DAO together are creating a DAL...
So now I really see the point of a DAL.
And we can surely make this.
👍

@ghost ghost changed the title Data Access Layer ? Business Layer Jun 5, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant