Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
JavaRanch.com/granny.jsp
  • 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Bear Bibeault
  • Junilu Lacar
  • Martin Vashko
Sheriffs:
  • Jeanne Boyarsky
  • Tim Cooke
  • Knute Snortum
Saloon Keepers:
  • Ron McLeod
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Scott Selikoff
  • salvin francis
  • Piet Souris

scope of objects in a Web application

 
Ranch Hand
Posts: 292
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I need a general understanding about the scope of objects in a Spring based web applications. Suppose i have a a web application with a Rest Webservice. The  web application either fetches the record from database or persist the  data into database. Is Singleton ,Prototype and prototype with ScopedProxyMode.TARGET_CLASS enough. Should i look into Request scope also?

RestController - BeanObj -> ServiceImpl -> DaoImpl->DB

Regards,
Raj
 
Saloon Keeper
Posts: 10857
234
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Enough for what? Different types have different purposes and so different lifetimes. Why are you concerned with whether a handful of scopes is enough? Just use the right one for the right job, no matter if it's Singleton, Prototype, Request or something else still.
 
I have gone to look for myself. If I should return before I get back, keep me here with this tiny ad:
Sauce Labs - World's Largest Continuous Testing Cloud for Websites and Mobile Apps
https://coderanch.com/t/722574/Sauce-Labs-World-Largest-Continuous
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!