The visitor pattern can be used on structures of objects which implements a specific interface defining a method called accept. In practice, in many cases, the structures are already created and we have to visit structures of already created objects. Changing hierarchies of classes for adding a new method is not a viable solution.
We need [...]

A marker interface is a design pattern consisting in an interface with no methods declared. All the classes implementing this interface don’t have to implement a method for the interface(since it doesn’t have an interface), but we can say that the classes implementing the interfaces are marked. For example in Java we have the Serializable [...]

What is Factory Pattern?
Factory Pattern is a creational design pattern. It is responsible for creating instances of objects without using directly the object constructor. For this reason Factory Pattern is widely used in frameworks, to encapsulate the logic of creating the objects and to make the framework independent of the objects it needs to work [...]