[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[jfw] Re: Service provider names
I think we are wondering about that.
There's no problem when creating provider for a class, as you may locate it later by FQCN, but some objects don't have any (application_root, config)
I see following solutions:
- Use same alias as in the provider's file name, for example ConfigServiceProvider.php will use the alia config, DatabaseServiceProvider.php will use alias database.
- Pass the alias into the providers's constructor: public function __construct($options, $alias) so define it in the parent.
- Create a repository of most common Providers that others can rely on.
However above assumes that each Provider will register just one object.
On Wednesday, April 2, 2014 2:51:55 AM UTC+2, Andrew Eddie wrote:
I'm struggling with how to maintain a logical and intuitive way of
naming service provider aliases. So, for example, if I create a
Database service provider, it might rely on the configuration service
provider called "config". But how do I document that's the case?
It's not so much a problem for small applications, but if I'm building
something big where other developers to adding to the code, has anyone
worked out a way to document what the service providers are called in
a logical and intuitive way? It's not hard to pass the container
around, but how do we document what's in it?
I'm probably not explaining the problem very well.
Framework source code: https://github.com/joomla/joomla-framework
Visit http://developer.joomla.org for more information about developing with Joomla!
You received this message because you are subscribed to the Google Groups "Joomla! Framework Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email to joomla-dev-framework+unsubscribe AT googlegroups.com.
Visit this group at http://groups.google.com/group/joomla-dev-framework.