Feature #2110

Add support for custom factories

Added by Robert Lemke over 12 years ago. Updated over 10 years ago.

Status:
Resolved
Priority:
Should have
Assignee:
Category:
Object
Start date:
2008-11-10
Due date:
% Done:

100%

Estimated time:
PHP Version:
Has patch:
Complexity:

Description

The Object Framework should support custom factories which are used whenever a object of a certain type needs to be instantiated.

Such a factory could be defined / configured in the Objects configuration like this:

F3\FLOW3\Cache\CacheInterface
‧‧factoryClassName:‧F3\FLOW3\Cache\Factory

Now whenever a "CacheInterface" object type needs to be intantiated, the Cache Factory's create() method will be called. Of course the arguments for the create() method still have to be defined:

$myCache = $this->objectFactory->create('F3\FLOW3\Cache\CacheInterface', 'cacheId', 'F3\FLOW3\Cache\VariableCache', 'F3\FLOW3\Cache\Backend\File');

Related issues

Related to TYPO3.Flow - Feature #2109: Support constructor / factory arguments in Objects injection configurationResolvedRobert Lemke2008-11-10

Actions
#1

Updated by Robert Lemke over 12 years ago

  • Status changed from Accepted to Resolved
  • % Done changed from 0 to 100

Applied in changeset r1670.

Also available in: Atom PDF