• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

What is service layer and what could be the business logic in the this application code?

 
Ranch Hand
Posts: 240
2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
This is a simple Spring DAO module application that uses JdbcTemplate. I want to know
1. which of the below files come under service/business layer? and
2. which is under DAO layer?
3. And if there is only DAO layer then what would be a service layer code for this application?
4. I want to know what exactly a service layer contains and what is business logic.

your help will be greatly appreciated, thanks.

Employee.java


EmployeeDao.java


applicationContext.xml


Test.java



Source: https://www.javatpoint.com/spring-JdbcTemplate-tutorial
 
Ranch Hand
Posts: 30
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
1. In your code there is no Business service layer.
2. which is under DAO layer? ==> EmployeeDAO
3. If you want to have business layer then create it like:


4. Service layer is the business service

P/s: you should google to better understanding for 3 layer architecture, example: https://www.google.com.vn/search?q=3+layer+architecture&source=lnms&tbm=isch&sa=X&ved=0ahUKEwjw7Irf1evTAhVBE7wKHfkMCe8Q_AUICigB&biw=1366&bih=638#imgrc=Fsld7vDOJBqe8M:
 
Arun Singh Raaj
Ranch Hand
Posts: 240
2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Nguyen Tuyen wrote:
3. If you want to have business layer then create it like:



Thank you for the help sir.
Could you please provide a sample code or example of business logic here?
 
reply
    Bookmark Topic Watch Topic
  • New Topic