Win a copy of Svelte and Sapper in Action this week in the JavaScript 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
  • Ron McLeod
  • Paul Clapham
  • Bear Bibeault
  • Junilu Lacar
Sheriffs:
  • Jeanne Boyarsky
  • Tim Cooke
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • salvin francis
  • Frits Walraven
Bartenders:
  • Scott Selikoff
  • Piet Souris
  • Carey Brown

Newbie to spring

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

I am a newbie to spring framework.just started.
Going through the net i have found this site better to read.

"A primary component of the core container is the BeanFactory, an implementation of the Factory pattern."

After reading this line, i gone through Factory pattern.

In wikipedia, i read about Factory pattern. There i came across this statement.

"Factory pattern is an abstraction of a constructor, and can be used to implement various allocation schemes"

what is meant by abstraction of constructor?
what we should use Factory pattern and what it is meant to spring container?


Thanks,
Vipul Kumar
 
Ranch Hand
Posts: 451
1
IntelliJ IDE Spring Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Well the Factory Pattern is a Creational pattern. According to Wikipwedia -> Creational Pattern

Spring provides a layer of abstraction over creation of objects and decouples Object creation logic from Business logic. In this scenario the Spring Container is responsible for the creation of Object(s).

Cheers,
Raj.
 
vipul John
Ranch Hand
Posts: 252
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Raj,

I gone through creational pattern in wikipedia. i did not understand this statement.

Creational design patterns are further categorized into Object-creational patterns and Class-creational patterns. Where, Object-creational patterns deal with Object creation and Class-creational deal with Class-instantiation.

object creation and class-instantiation both are same. but why did he make the difference.?

Thanks
Vipul.
 
Rajkamal Pillai
Ranch Hand
Posts: 451
1
IntelliJ IDE Spring Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Not sure of why he mentioned those separate.

Could be that he intended -
Object creation: Creation of the Object, allocating of memory for properties etc.
Class instantiation: Initialization of properties (default values or the values set by the DCOnstructor.)

I am not too sure and I just am trying to give a difference between the two.

Cheers,
Raj.
 
Forget this weirdo. You guys wanna see something really neat? I just have to take off my shoe .... (hint: it's a tiny ad)
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
    Bookmark Topic Watch Topic
  • New Topic