This week's book giveaway is in the Beginning Java forum.
We're giving away four copies of Learn Java with Math: Using Fun Projects and Games and have Ron Dai on-line!
See this thread for details.
Win a copy of Learn Java with Math: Using Fun Projects and Games this week in the Beginning Java 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
  • 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

Some Terminology

 
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Any one can give the meaning of Following Terminology
1.Factory Methods
2. Light Weight Component
3.Decorator Class
4. Functor
Thanks in advance for any help
------------------
-SaTyA-
 
Trailboss
Posts: 23036
IntelliJ IDE Firefox Browser Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm gonna move this thread to the patterns forum where more people will see it.
 
paul wheaton
Trailboss
Posts: 23036
IntelliJ IDE Firefox Browser Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
These are some BIG questions in a very small package.
A Factory Method is described in the GoF (Gang of Four) book. The method takes some parameters and returns an interface (or abstract class). The idea is that depending on the data that is passed in, objects of different class types are returned, although they must all implement the interface (or inherit the abstract class).
Light Weight Components: AWT is an example of heavy weight components - each AWT component is reliant on the underlying operating system for implementation. Swing is an example of lightweight components - each Swing component is made out of basic paint routines and events within Java and does not depend on the underlying operating system to specifically implement this component.
A Decorator Class (GoF) will provide the same interface as the class that is being decorated, but it will usually add some enhancement. A decorator class usually does not inherit what it decorates, rather, it contains what it decorates.
Functor is new to me, but I found a reference in the GoF book. Something about "objects that are functions". Apparently some guy named "Coplien" thought it up.
 
Ranch Hand
Posts: 44
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have not heard of the use of functors in the Java arena. I had heard of it in the C++ arena, primarily for dispatching a callback to a member function.
Typically, C++ callbacks require a static member function to be used as the static binding mechanism is required. You can of course dispatch a callback to a member function, a non-static member function, but this requires you write some tricky code which is your functor implementation.
I conceptually view a functor as a function pointer that allows the developer the ability to dispatch a callback to a non-static member function. A functor is not a function pointer in reality though.
 
Sheriff
Posts: 6920
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
"Coplien" is Jim Coplien (http://student.vub.ac.be/~jcoplien/)
From Http://www.astray.com/dabot/ (a clever and useful source of info). I asked it "What is a Functor", it replied:
In category theory, a functor F is an operator on types. F
is also considered to be a polymorphic operator on functions
with the type
F : (a -> b) -> (F a -> F b).
Functors are a generalisation of the function "map". The
type operator in this case takes a type T and returns type
"list of T". The map function takes a function and applies it
to each element of a list.
(07 Feb 1995)

Does this help?
 
Uh oh, we're definitely being carded. Here, show him this tiny ad:
Java file APIs (DOC, XLS, PDF, and many more)
https://products.aspose.com/total/java
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!