a. Factory Method and Abstract Factory Method are both used for the exact same purpose: the need for a creational abstraction that lets someone focus on the interface for a class instead of the actual implementation and thus let subclasses decide exactly what to instantiate. However, the real difference between them is that Factory Method has subclasses call the instance needed directly and in Abstract Factory, an abstract method calls the subclass, which in turn calls the instance needed. Therefore, Abstract Factory has an extra level of abstraction associated with it.
b. Adapter is used when a piece of code already exists and you need to "modify" it to serve your needs by putting a "wrapper" around it to get the data you want to manipulate from it and a Bridge is used when you want to seperate the implementation and the interface to have cohesion in the program between any number of possibilities for different implementations. They are similar since they are both just trying to abstract away the implementation of the code to help make it easier to understand and use.
A) Abstract Factory v. Factory Method
Both are creational patterns so they make a system independent of how its objects are created and use inheritance to vary the class that's instantiated
Abstract Factory and Factory Method are typically complementary as Abstract Factory classes are often implemented with Factory Methods for creation of objects through inheritance.
The Abstract Factory pattern encapsulates how to create families of related objects without instantiating classes directly or even specifying their concrete classes. Thus, the system is configured with one of many families of products. The Abstract Factory declares an interface for creating products. Usually, there is only one instance of a concrete factory class. Thus this factory object has the responsibility to provide the services for the creation of the entire family and creates product objects having a specific implementation, often by defining a factory method. This makes it easy to replace a whole family of objects in a system by instantiating a different concrete instance of the abstract factory interface while enforcing the general characteristics of the families.
Factory Method lets a class defer instantiation to subclasses. It is appropriate when a class can't anticipate the class of objects it must create. Typically, a super class defines the standard and general behavior (of the family) and then delegates the details of creating the objects to subclasses through method overriding.
The focus of the Abstract Factory pattern is provide platform independence for a family of products while enforcing the relationship constraints of the family. The focus of the Factory Method pattern is to provide virtual creation through inheritance and the system should be open for extension by multiple subclasses of the same family.
B) Adapter v. Bridge
Both patterns are structural and thus are concerned with how classes and objects are composed to form larger structures.
Both patterns address compatibility issues in the use of an interface.
Both promote flexibility by providing a level of indirection to another object.
The class form of Adapter makes one interface conform to another by converting the interface of a class into another interface. The pattern is geared towards making unrelated classes work together and is usually applied to systems after they are designed. It is a way of making two independently designed classes work together within an application. The adapter object creates an intermediary abstraction that translates or maps the old component to the new system, either with inheritance or with aggregation.
The Bridge pattern allows the decoupling of an abstraction from its implementation so that the two can vary independently. This is done by maintaining a reference to the implementation within the interface, thus allowing both the abstraction and the implementation to be extensible independently, thus "bridging" the abstration and its implementations. It is designed up-front to deal with compile time binding between the interface and the implementation, resulting from using subclasses of the interface to provide alternate implementations.
The class slides refer to the Bridge pattern as a behavior pattern. I can understand that to some degree due to the reference to the implementation within the abstraction, but in Design Patterns: Elements of Reusable Object-Oriented Software, the Bridge pattern is definitely classified as a structural pattern. A little help here?