joomla-framework / application

Joomla Framework Application Package
GNU General Public License v2.0
22 stars 30 forks source link

Introduce interfaces for the application class chain #83

Closed mbabker closed 6 years ago

mbabker commented 6 years ago

When implementing the joomla/console package, there are two pain points in the package's design:

This PR addresses one of those pain points, being impossible to subclass the Symfony application class. To do that, we need an interface for our own application and what capabilities need to be provided. So, 2 interfaces are introduced: one for the main application's basic capability (execute it) and one for an application which is aware of your local configuration (if one even exists, assuming you can build a config-less system). The AbstractApplication implements the new ConfigurationAwareApplicationInterface which satisfies all requirements, and lays the groundwork for being able to define root application capabilities (this is the closest thing we have a kernel in relation to other frameworks anyway) without requiring everything to extend a base class.

mbabker commented 6 years ago

@wilsonge We need to find a way to do this. It needs to be possible to somehow use/inherit from Symfony\Component\Console\Application for our root console application class, and interfaces to "bridge" things is the only practical way to do it. In effect this should help us to directly use/extend Symfony\Component\Console\Command\Command for our command classes instead of requiring our own root class/interface as well.

wilsonge commented 6 years ago

LGTM. We should make the CMSApplicationInterface extend out of this when we merge into j4