Win a copy of 97 Things Every Java Programmer Should Know this week in the Java in General forum!
  • 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
  • Paul Clapham
  • Jeanne Boyarsky
  • Junilu Lacar
  • Henry Wong
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Tim Cooke
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Frits Walraven
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Piet Souris
  • salvin francis
  • fred rosenberger

scope of objects in a Web application

 
Ranch Hand
Posts: 293
  • 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: 12013
257
  • 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.
 
Watchya got in that poodle gun? Anything for me? Or this tiny ad?
Devious Experiments for a Truly Passive Greenhouse!
https://www.kickstarter.com/projects/paulwheaton/greenhouse-1
    Bookmark Topic Watch Topic
  • New Topic