• 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
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Some Terminology

 
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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: 23773
IntelliJ IDE Firefox Browser Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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: 23773
IntelliJ IDE Firefox Browser Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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: 7001
6
Eclipse IDE Python C++ Debian Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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?
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic