Please explain concept of factory to me

factory class and how to use it?

Page 1 of 1

8 Replies - 1679 Views - Last Post: 18 August 2009 - 05:47 AM Rate Topic: -----

#1 Sadaiy  Icon User is offline

  • D.I.C Head

Reputation: 3
  • View blog
  • Posts: 107
  • Joined: 03-October 08

Please explain concept of factory to me

Posted 17 August 2009 - 03:27 PM

Hi, please explain concept of factory to me and how to use the factory implementation, factory class, and how to use the code in the main() and what the purpose is.
Is This A Good Question/Topic? 0
  • +

Replies To: Please explain concept of factory to me

#2 computerfox  Icon User is offline

  • straight vegetarian kid

Reputation: 50
  • View blog
  • Posts: 3,772
  • Joined: 29-January 09

Re: Please explain concept of factory to me

Posted 17 August 2009 - 03:35 PM

this might shed some light
Was This Post Helpful? 0
  • +
  • -

#3 Sadaiy  Icon User is offline

  • D.I.C Head

Reputation: 3
  • View blog
  • Posts: 107
  • Joined: 03-October 08

Re: Please explain concept of factory to me

Posted 17 August 2009 - 03:45 PM

That link didn't help much. But the link does link to a wikpedia article which is a little more helpfull. I wish there was a tutorial on factories here but there isn't one, i checked. If i ever figure this out I will write a tutorial for you guys.
Was This Post Helpful? 0
  • +
  • -

#4 pbl  Icon User is offline

  • There is nothing you can't do with a JTable
  • member icon

Reputation: 8328
  • View blog
  • Posts: 31,857
  • Joined: 06-March 08

Re: Please explain concept of factory to me

Posted 17 August 2009 - 04:06 PM

View PostSadaiy, on 17 Aug, 2009 - 02:45 PM, said:

That link didn't help much. But the link does link to a wikpedia article which is a little more helpfull. I wish there was a tutorial on factories here but there isn't one, i checked. If i ever figure this out I will write a tutorial for you guys.

Not easy to write a tutorial about factory.

There are many ways to implement them an it all depends of the context.
On some GUI elements a factory cannot be implemented... a Factory for JLabel will not work because a JLabel cannot be in 2 different containers at the same time
A Border can use a Factory because the Border is drawn after the Component it is bordering is drawn and the Border is redraw every time it is not a GUI element by itself.

JOptionPane are kind of a factory because the Pane is displayed and delete right after. There is no neeed to keep it has instance variable of an instance of JOptionPane.

Whenever you will need a Factory, I think you will have already solved your problem and just realized that what you wrote is actually a Factory.
Was This Post Helpful? 0
  • +
  • -

#5 computerfox  Icon User is offline

  • straight vegetarian kid

Reputation: 50
  • View blog
  • Posts: 3,772
  • Joined: 29-January 09

Re: Please explain concept of factory to me

Posted 17 August 2009 - 05:49 PM

you can research if there are any version of it, but there's a great reason why PBL said there aren't many, but you can always search.
Was This Post Helpful? 0
  • +
  • -

#6 skaoth  Icon User is offline

  • D.I.C Addict
  • member icon

Reputation: 91
  • View blog
  • Posts: 601
  • Joined: 07-November 07

Re: Please explain concept of factory to me

Posted 17 August 2009 - 07:06 PM

Give this a read.

http://books.google....i...ory&f=false

This post has been edited by skaoth: 17 August 2009 - 07:06 PM

Was This Post Helpful? 0
  • +
  • -

#7 NeoTifa  Icon User is offline

  • Whorediot
  • member icon





Reputation: 2651
  • View blog
  • Posts: 15,673
  • Joined: 24-September 08

Re: Please explain concept of factory to me

Posted 17 August 2009 - 08:29 PM

Quote

That link didn't help much.


Epic quote is epic. Q.E.D.


That's almost like trying to get someone to write a tutorial on brain surgery.
Was This Post Helpful? 0
  • +
  • -

#8 pbl  Icon User is offline

  • There is nothing you can't do with a JTable
  • member icon

Reputation: 8328
  • View blog
  • Posts: 31,857
  • Joined: 06-March 08

Re: Please explain concept of factory to me

Posted 17 August 2009 - 09:47 PM

View PostNeoTifa, on 17 Aug, 2009 - 07:29 PM, said:

Quote

That link didn't help much.


Epic quote is epic. Q.E.D.


That's almost like trying to get someone to write a tutorial on brain surgery.

Another analogy from Neo Tifa that I will remember :^:
Was This Post Helpful? 0
  • +
  • -

#9 NeoTifa  Icon User is offline

  • Whorediot
  • member icon





Reputation: 2651
  • View blog
  • Posts: 15,673
  • Joined: 24-September 08

Re: Please explain concept of factory to me

Posted 18 August 2009 - 05:47 AM

There seem to be a lot of those. I just have a gift for expression methinks. :D I am pretty good at writing poetry, expecially haikus :D
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1