• 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
  • Liutauras Vilda
  • Paul Clapham
Sheriffs:
  • paul wheaton
  • Tim Cooke
  • Henry Wong
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Piet Souris
Bartenders:
  • Mike London

Is spring bean can be considered as object ?

 
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Is spring bean can be considered as object ? As here all  properties of class is  injected with data.
 
Saloon Keeper
Posts: 14702
331
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Yes, a Spring bean is an object.
 
Marshal
Posts: 8623
623
Mac OS X VI Editor BSD Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

samy mity wrote:Is spring bean can be considered as object ? As here all  properties of class is  injected with data.


While it is technically very true what Stephan said, read some other opinion stated by Uncle Bob in his Clean Code book. Some summary you can find in his blog.

He calls such objects as data structures, as there are in most cases 2 types of methods: getters and setters - these either return or set objects state.
There isn't really a way to hide methods implementation internals in the sense of author's words, as all what those methods do - just return the fields.
From technical perspective these are objects, but from OO perspective, more of a data structure which holds the data and don't do any calculations on it.

I'm sorry if I confused you. That wasn't my intention. Read that blog and if you have a chance the book too, I really liked it, so you could see author's thoughts in the wider context. There are people who agree and who don't
 
Sheriff
Posts: 67695
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I find that very confusing and a level of academic hair-splitting that does not serve anyone, especially newcomers.

Beans are objects. Period. Whether they are used for special purposes or not without using all of the capabilities of objects is irrelevant. You might as well say that servlets aren't objects because they are specialized and don't use all of the capabilities available to objects.
 
reply
    Bookmark Topic Watch Topic
  • New Topic