• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Application logic, where to put it

 
Luca Cordero
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi, I'm trying to create a web app with angularjs and java backend with play framework.

I have a java class Item who I map to the database.

Now I want to match items from an excel table(loaded by user) with items in the database.

how do I have to put application logic for that service? In angularjs controllers or in java backend classes?

Thanks!
 
Dave Tolls
Ranch Hand
Posts: 2112
16
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The documentation for Play! (unless it's changed) pretty much says to stick this stuff in its own service, that the controller calls as a Future.
The idea is that the controller can respond to the request quickly, while the task is executed on another thread.

So your matching code would be a service, which also means it can be tested completely detached from your web application.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic