File tree Expand file tree Collapse file tree 3 files changed +17
-0
lines changed
prototype/src/main/java/com/iluwatar Expand file tree Collapse file tree 3 files changed +17
-0
lines changed Original file line number Diff line number Diff line change 11package com .iluwatar ;
22
3+ /**
4+ *
5+ * In Prototype we have a factory class (HeroFactoryImpl) producing
6+ * objects by cloning existing ones. In this example the factory's
7+ * prototype objects are given as constructor parameters.
8+ *
9+ */
310public class App
411{
512 public static void main ( String [] args )
Original file line number Diff line number Diff line change 11package com .iluwatar ;
22
3+ /**
4+ *
5+ * Interface for the factory class.
6+ *
7+ */
38public interface HeroFactory {
49
510 Mage createMage ();
Original file line number Diff line number Diff line change 11package com .iluwatar ;
22
3+ /**
4+ *
5+ * Concrete factory class.
6+ *
7+ */
38public class HeroFactoryImpl implements HeroFactory {
49
510 private Mage mage ;
You can’t perform that action at this time.
0 commit comments