C
- the generic type@FunctionalInterface public interface CollectionFactory<C extends Collection<?>>
CollectionFactory
defines the functionality which must be
provided in order to represent a factory for object creation of *ALL* objects
being of a requested type (in contrast to the TypeFactory
and the
LookupFactory
which create instances of a predefined type specified
with a generic argument). Many alternative implementations of a
CollectionFactory
may may exist which construct the instances their
way.
Having factories that generic as we define it here, we are able to decouple
our business logic from any specific framework: Your business logic must not
know anything about how the instances are generated. It mainly just needs to
know how to use the CollectionFactory
. It is up to the application
"end point", i.e. a command line tool with a main-method or a web-application
to finally decide which factory to use.
Depending on the implementation used or configuration provided, the
CollectionFactory
may return singletons or dedicated separate
instances when queried for instances.
Modifier and Type | Method and Description |
---|---|
C |
createInstances()
This method creates / retrieves all instances of the given type.
|
default C |
createInstances(Map<String,String> aProperties)
This method creates / retrieves all instances of the given type.
|
C createInstances()
default C createInstances(Map<String,String> aProperties)
aProperties
- The dynamic properties which are used to configure the
desired bean.Copyright © 2018. All rights reserved.