Factory Pattern — PizzaFactory

SCENE 1:

Today, we're gonna build a pizza factory to offering 
all kinds of pizzas. There are two style pizza stores:
NewYork style and Chicago style. They have same bake,
cut and box process, but not the same prepare process.
Besides, both pizza stores should offering several 
kinds of pizzas.

 

Factory Method:

use factory method to decouple your client code from the concrete

classes you need to instantiate, or if you don’t know ahead of time

all the concrete classes you are going to need. To use this, just

subclass it and implement my factory method!

Abstract Factory:

use abstract factory whenever you have families of products you

need to create and you want to make sure your clients create

products that belong together.

 

Often a Factory Method lurking inside the Abstract Factory:

The job of an Abstract Factory is to define an interface for creating a set

of products. Each method in that interface is responsible for creating a

concrete product, and we implement a subclass of the Abstract Factory

to supply those implementations. So, factory methods are a natural way

to implement your product methods in your abstract factories.

Usage of Canopy Clustering(Apache Mahout) —In Java

Maven Dependency:

<!-- https://mvnrepository.com/artifact/org.apache.mahout/mahout-mr -->
<dependency>
    <groupId>org.apache.mahout</groupId>
    <artifactId>mahout-mr</artifactId>
    <version>0.13.0</version>
</dependency>

<dependency>
    <groupId>org.apache.mahout</groupId>
    <artifactId>mahout-examples</artifactId>
    <version>0.13.0</version>
</dependency>

Continue reading “Usage of Canopy Clustering(Apache Mahout) —In Java”