AbstractFactory consistency #4364

Merged
merged 10 commits into from Apr 30, 2013

Projects

None yet

3 participants

@weierophinney
Zend Framework member

This PR aims to bring consistency to the various abstract factory implementations that have been created for 2.2.0. In particular:

  • No abstract factory requires a factory-specific service prefix (e.g., Form\\, Logger\\, `SessionContainer\\, etc.). The chances of collision are relatively slim, particularly with strong naming.
  • All abstract factories support extension, typically by allowing overriding a $configKey property or the getConfig() method. This allows re-purposing the factories to use alternate configuration when desired.
  • All abstract factories now have the AbstractServiceFactory suffix. This was already in use for the Di abstract factory, so it made sense to go with established naming.
weierophinney added some commits Apr 30, 2013
@weierophinney weierophinney Removed prefix requirement from session containers
- No longer needs "SessionContainer\\" prefix
3759507
@weierophinney weierophinney Session Container configuration key is configurable
... by extending the abstract factory and overriding the $configKey
property.
5c51516
@weierophinney weierophinney Remove prefix requirement from Logger abstract factory
... same as was done for session containers

- Also caches configuration
- Allows changing the configuration key via extension
8077acc
@weierophinney weierophinney Remove Cache prefix in cache abstract factory
- also made cache configuration key configurable, via extension
b503a74
@weierophinney weierophinney Remove service prefix requirement from form abstract factory 8231aef
@weierophinney weierophinney Make abstract factories consistent
- Consistent getConfig() usage
- Consistent naming
a728a97
@weierophinney weierophinney Rename abstract factories for consistency
- We'd already started using the suffix "AbstractServiceFactory"; made
  this consistent on all new factories.
- Updated the SessionManager configuration to the new names, and added
  Logger and Cache to the configuration.
adae4d7
@weierophinney weierophinney Ensure DB abstract factory is in line with others
- Not quite the same; you need to override getConfig() as it uses a
  subkey, and not a top-level key. Overall, though, much closer in
  design.
dbcd397
@weierophinney weierophinney CS fixes
- trailing whitespace
7285654
@iquabius iquabius commented on the diff Apr 30, 2013
library/Zend/Form/FormAbstractServiceFactory.php
@@ -13,22 +13,22 @@
use Zend\ServiceManager\AbstractFactoryInterface;
use Zend\ServiceManager\ServiceLocatorInterface;
-class FormAbstractFactory implements AbstractFactoryInterface
+class FormAbstractServiceFactory implements AbstractFactoryInterface
@iquabius
iquabius Apr 30, 2013

Wouldn't be better to create a new subnamespace? -> Zend\Form\Service\FormAbstractFactory.

@weierophinney
weierophinney Apr 30, 2013

No. Because the FormElementManager is already in the component root namespace, it makes no sense to create a new subnamespace. If we'd anticipated multiple SM-related factories originally, yes.

@ralphschindler ralphschindler added a commit that referenced this pull request Apr 30, 2013
@ralphschindler ralphschindler PR #4364
Merge branch 'hotfix/abstract-manager-prefix-removal' of git://github.com/weierophinney/zf2 into weierophinney-hotfix/abstract-manager-prefix-removal
f23d3ab
@ralphschindler ralphschindler added a commit that referenced this pull request Apr 30, 2013
@ralphschindler ralphschindler PR #4364
Merge branch 'weierophinney-hotfix/abstract-manager-prefix-removal' into develop
f2b26d9
@ralphschindler ralphschindler merged commit e928062 into zendframework:develop Apr 30, 2013

1 check passed

Details default The Travis build passed
@ghost Unknown pushed a commit that referenced this pull request Jul 14, 2013
@ralphschindler ralphschindler PR #4364
Merge branch 'hotfix/abstract-manager-prefix-removal' of git://github.com/weierophinney/zf2 into weierophinney-hotfix/abstract-manager-prefix-removal
6d3f65a
@ghost Unknown pushed a commit that referenced this pull request Jul 14, 2013
@ralphschindler ralphschindler PR #4364
Merge branch 'weierophinney-hotfix/abstract-manager-prefix-removal' into develop
0166db6
@gianarb gianarb pushed a commit to zendframework/zend-session that referenced this pull request May 15, 2015
@ralphschindler ralphschindler PR zendframework/zendframework#4364
Merge branch 'hotfix/abstract-manager-prefix-removal' of git://github.com/weierophinney/zf2 into weierophinney-hotfix/abstract-manager-prefix-removal
1b2f112
@gianarb gianarb pushed a commit to zendframework/zend-session that referenced this pull request May 15, 2015
@ralphschindler ralphschindler PR zendframework/zendframework#4364
Merge branch 'weierophinney-hotfix/abstract-manager-prefix-removal' into develop
5d1b205
@gianarb gianarb pushed a commit to zendframework/zend-log that referenced this pull request May 15, 2015
@ralphschindler ralphschindler PR zendframework/zendframework#4364
Merge branch 'hotfix/abstract-manager-prefix-removal' of git://github.com/weierophinney/zf2 into weierophinney-hotfix/abstract-manager-prefix-removal
a011068
@gianarb gianarb pushed a commit to zendframework/zend-log that referenced this pull request May 15, 2015
@ralphschindler ralphschindler PR zendframework/zendframework#4364
Merge branch 'weierophinney-hotfix/abstract-manager-prefix-removal' into develop
5619ba3
@gianarb gianarb pushed a commit to zendframework/zend-cache that referenced this pull request May 15, 2015
@ralphschindler ralphschindler PR zendframework/zendframework#4364
Merge branch 'hotfix/abstract-manager-prefix-removal' of git://github.com/weierophinney/zf2 into weierophinney-hotfix/abstract-manager-prefix-removal
8672b50
@gianarb gianarb pushed a commit to zendframework/zend-cache that referenced this pull request May 15, 2015
@ralphschindler ralphschindler PR zendframework/zendframework#4364
Merge branch 'weierophinney-hotfix/abstract-manager-prefix-removal' into develop
736bf24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment