Added a sub-package for "creational" in order to organize the code better

This commit is contained in:
Abhijay Kumar 2019-05-21 11:37:16 +05:30
parent b532d70716
commit ee985d510b
10 changed files with 14 additions and 14 deletions

View File

@ -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

View File

@ -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

View File

@ -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 {
/** /**

View File

@ -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

View File

@ -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 {

View File

@ -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

View File

@ -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.

View File

@ -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" +

View File

@ -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

View File

@ -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;