Added a sub-package for "creational" in order to organize the code better
This commit is contained in:
parent
b532d70716
commit
ee985d510b
@ -1,4 +1,4 @@
|
|||||||
package src.main.java.com.designpatterns.builderpattern;
|
package src.main.java.com.designpatterns.creational.builder;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The Builder is a design pattern designed to provide a flexible solution to various object creation problems in
|
* The Builder is a design pattern designed to provide a flexible solution to various object creation problems in
|
@ -1,4 +1,4 @@
|
|||||||
package src.main.java.com.designpatterns.factorypattern;
|
package src.main.java.com.designpatterns.creational.factory;
|
||||||
|
|
||||||
public class Pentagon implements Polygon {
|
public class Pentagon implements Polygon {
|
||||||
@Override
|
@Override
|
@ -1,4 +1,4 @@
|
|||||||
package src.main.java.com.designpatterns.factorypattern;
|
package src.main.java.com.designpatterns.creational.factory;
|
||||||
|
|
||||||
public interface Polygon {
|
public interface Polygon {
|
||||||
/**
|
/**
|
@ -1,4 +1,4 @@
|
|||||||
package src.main.java.com.designpatterns.factorypattern;
|
package src.main.java.com.designpatterns.creational.factory;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* In class-based programming, the factory method pattern is a creational pattern that uses factory methods to deal
|
* In class-based programming, the factory method pattern is a creational pattern that uses factory methods to deal
|
@ -1,4 +1,4 @@
|
|||||||
package src.main.java.com.designpatterns.factorypattern;
|
package src.main.java.com.designpatterns.creational.factory;
|
||||||
|
|
||||||
public class Square implements Polygon {
|
public class Square implements Polygon {
|
||||||
|
|
@ -1,4 +1,4 @@
|
|||||||
package src.main.java.com.designpatterns.factorypattern;
|
package src.main.java.com.designpatterns.creational.factory;
|
||||||
|
|
||||||
public class Triangle implements Polygon {
|
public class Triangle implements Polygon {
|
||||||
@Override
|
@Override
|
@ -1,4 +1,4 @@
|
|||||||
package src.main.java.com.designpatterns.singletonpattern;
|
package src.main.java.com.designpatterns.creational.singleton;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The singleton pattern is a design pattern that restricts the instantiation of a class to one "single" instance.
|
* The singleton pattern is a design pattern that restricts the instantiation of a class to one "single" instance.
|
@ -1,8 +1,8 @@
|
|||||||
package src.test.java.com.designpatterns.builderpattern;
|
package src.test.java.com.designpatterns.creational.builder;
|
||||||
|
|
||||||
import org.junit.Assert;
|
import org.junit.Assert;
|
||||||
import org.junit.Test;
|
import org.junit.Test;
|
||||||
import src.main.java.com.designpatterns.builderpattern.Desktop;
|
import src.main.java.com.designpatterns.creational.builder.Desktop;
|
||||||
|
|
||||||
public class DesktopBuilderTest {
|
public class DesktopBuilderTest {
|
||||||
private final String configOne = "Desktop{CPU='Intel i7', RAM='Corsair Vengeance 3000', isGraphicCardEnabled=true" +
|
private final String configOne = "Desktop{CPU='Intel i7', RAM='Corsair Vengeance 3000', isGraphicCardEnabled=true" +
|
@ -1,9 +1,9 @@
|
|||||||
package src.test.java.com.designpatterns.factorypattern;
|
package src.test.java.com.designpatterns.creational.factory;
|
||||||
|
|
||||||
import org.junit.Assert;
|
import org.junit.Assert;
|
||||||
import org.junit.Test;
|
import org.junit.Test;
|
||||||
import src.main.java.com.designpatterns.factorypattern.Polygon;
|
import src.main.java.com.designpatterns.creational.factory.Polygon;
|
||||||
import src.main.java.com.designpatterns.factorypattern.PolygonFactory;
|
import src.main.java.com.designpatterns.creational.factory.PolygonFactory;
|
||||||
|
|
||||||
public class PolygonFactoryTest {
|
public class PolygonFactoryTest {
|
||||||
@Test
|
@Test
|
@ -1,8 +1,8 @@
|
|||||||
package src.test.java.com.designpatterns.singletonpattern;
|
package src.test.java.com.designpatterns.creational.singleton;
|
||||||
|
|
||||||
import org.junit.Assert;
|
import org.junit.Assert;
|
||||||
import org.junit.Test;
|
import org.junit.Test;
|
||||||
import src.main.java.com.designpatterns.singletonpattern.Singleton;
|
import src.main.java.com.designpatterns.creational.singleton.Singleton;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.concurrent.ExecutorService;
|
import java.util.concurrent.ExecutorService;
|
Loading…
Reference in New Issue
Block a user