DO - Domain Object type to be produced.public abstract class BaseFactory<DO extends DomainObject & Producible> extends Object implements GenericFactory<DO>
FluentAssembler
To be a valid Domain Factory implementation, the implementation must respects the followings:
BaseFactory.
public class ProductFactoryBase extends BaseFactory<Product> implements ProductFactory {
public Product createProduct(String productId, EAN13 ean13) {
Product product = new Product()
product.setEntityId(productId);
...
product.setEAN13 (ean31)
...
return product;
}
}
And it is sufficient enough for the Domain Factory implementation will be available via its interface, the one
that extending GenericFactory.
In the GenericFactory javadoc example, productFactory base will be available like this:
// productFactory will contain an instance of ProductFactoryBase. @Inject ProductFactory productFactory;
| Modifier and Type | Field and Description |
|---|---|
protected Class<DO> |
producedClass |
| Modifier | Constructor and Description |
|---|---|
protected |
BaseFactory() |
protected final Class<DO extends DomainObject & Producible> producedClass
public Class<DO> getProducedClass()
getProducedClass in interface GenericFactory<DO extends DomainObject & Producible>Copyright © 2013-2016–2016 SeedStack. All rights reserved.