HI ya Piotr,
I think this an easy one personally.
The Abstract Factory according to the GOF book, is used to
Provide an interface for creating FAMILIES of related or dependent objects without specifying their concrete classes.
Where as the Factory Method
Define an interface for creating AN object, but let subclasses decide which class to instantiate. Factory Method lets a class defer instantiation to subclasses.
So the question I ask you is this - when you call create on a home inteface are you creating a family of related objects or are you creating one object??
Think about it this way, are you creating a concrete implementation of an interface and then to get a concrete object that does something specific do you need to call createConcreteObject which is responsible for creating a concrete object that matches to the environment you are running on?? The GOF book UML diagram shows the interface which has the CreateScrollBar and CreateWindow methods - these methods create the ScrollBar and Window that is appropriate for the environment. To me this does not match what is happening at all.
What happens is that you call create on the Home Interface and that creates ONE concrete implementation (EJBObject) regardless of what platform or server or whatever, you will not get one object created if you are running on windows and a different one if you are running on Solaris.
The Factory Method creates ONE concrete subclass, it does not provide a concrete subclass that just offers a way to create the family of objects appropriate for the platform, by forcing the developer to call createObjectX and createObjectY.
So for my money the pattern is quite obviously the Factory Method.