You are viewing a plain text version of this content. The canonical link for it is here.
Posted to zeta-dev@incubator.apache.org by Jerome Renard <je...@gmail.com> on 2010/08/12 12:19:58 UTC
[zeta-dev] Configuration component override mechanism : requirement doc
Hi there,
I took a few minutes to write down a draft of a requirement document
for the configuration override mechanism.
James : I integrated your part of the configuration group merge in the
doc, tell me if that's ok for you.
Here is the draft (attached as well):
Zeta Components : configuration override system, spec
=====================================================
:Author: Jérôme Renard, James Pic
:Revision: $Revision$
:Date: $Date$
Introduction
============
Description
-----------
The configuration package provides the tools to store configuration settings
for your application. Configuration options are stored on disk using INI
files or other configuration formats. The configuration package comes with
support for manipulation and storage of INI files and caching.
Current implementation
----------------------
The configuration package does not provide any mechanism to get a final setting
value from several configuration directories.
Requirements
============
The configuration override mechanism should be able to analyse a set of files
and apply the correct override mechanism to generate the resulting
configuration.
Context aware configuration files
---------------------------------
Creating a website requires to go through 3 different execution contexts:
1. dev
2. staging
3. production
Each context has its own specificities. For example the database used for each
of these 3 contexts is different. So this must be defined for each context and
used according to the one the web application is actually running in.
Those 3 contexts should be handled by the Configuration component, during the
configuration directive merge process.
Directory structure
-------------------
In order to provide a clean directory structure the Configuration component
should be able to read and understand a directory structure compared to this
one: ::
/[..]/conf/
|-- common
| |-- dev
| |-- prod
| `-- staging
`-- apps
|-- app1
| |-- dev
| |-- prod
| `-- staging
`-- app2
|-- dev
|-- prod
`-- staging
Storing common configuration
----------------------------
All web applications have common configuration directives. So all common
configuration files and directives should be stored in the `common/<context>/`
directory. For example if all applications have to use the same database, it
could be easy to create a `common/<context>/database.ini` file containing
informations to connect to this database. Since each file is context specific
it will be required to copy a file in all context directories. For example if
you want to store database connection values for all project, you can create a
file in `conf/<context>/database.ini` with the following contents: ::
[DatabaseSettings]
Host=localhost
Password=1234
Port=1234
And this configuration will be available for all projects that use the
`database.ini` file.
Storing application specific configuration
------------------------------------------
Providing different applications with the same code base but configured
differently is actually quite common as well. If for example you have a first
application called projectA and another one called projectB it should be
possible to have projectB inherit from projectA's configuration, as well as
overriding some of projectA's configuration.
As an example, if we have projectA with the following configuration, in
`conf/apps/projectA/<context>/routes.ini` : ::
[myapp.register]
controller=AAAAAAAA
railsRoute=register
action=register
template=register.ezt
And for projectB you want to inherit from these values and override only a few
ones, in `conf/apps/projectB/<context>/routes.ini`: ::
[app.register]
controller=BBBBBBBB
After applying the configuration overrdie system, you should get at runtime
for projectB: ::
[myapp.register]
controller=BBBBBBBB
railsRoute=register
action=register
template=register.ezt
Performance considerations
--------------------------
Hitting the filesystem and appying the override mechanism requires a lot of
ressources and will possibly be a memory hog. In order to avoid that a
compilation system should be provided. The system would work as follows:
1. define any configuration file/group/directive you want
2. run the compiler
3. use the compiled version with merged configuration directive for subsequent
requests.
Caching
-------
If the directive configuration are compiled, it should be possible to control
where the compiled version should be stored, for example in APC, or memcached
so you can share these configuration directive across multiple servers. That
would required a TieIn between the Configuration and the Cache component.
Reading a configuration directive
---------------------------------
This require a modification of the actual API to handle the execution context.
Writing a configuration directive
---------------------------------
This require a modification of the actual API to handle the execution context.
FAQ
---
Why do not you provide context override as well ?
+++++++++++++++++++++++++++++++++++++++++++++++++
The override system already provide an horizontal override system, i.e each file
override another if it is in the same context. Providing a context override mean
that it will require a vertical override system as well and is extremley complex
to implement. Even though it is an interesting idea, it is safer to keep it for
future versions of the Configuration component.
Any comment welcome :)
--
Jérôme Renard
http://39web.fr | http://jrenard.info
Re: [zeta-dev] Configuration component override mechanism :
requirement doc
Posted by Jerome Renard <je...@gmail.com>.
James,
On Thu, Aug 12, 2010 at 2:55 PM, James Pic <ja...@gmail.com> wrote:
> On Thu, Aug 12, 2010 at 2:19 PM, Jerome Renard <je...@gmail.com> wrote:
>> Hi there,
>>
>> I took a few minutes to write down a draft of a requirement document
>> for the configuration override mechanism.
>>
>> James : I integrated your part of the configuration group merge in the
>> doc, tell me if that's ok for you.
>
> It is indeed ;)
>
>> Here is the draft (attached as well):
>>
>> Zeta Components : configuration override system, spec
>> =====================================================
>> :Author: Jérôme Renard, James Pic
>> :Revision: $Revision$
>> :Date: $Date$
>>
>> Introduction
>> ============
>>
>> Description
>> -----------
>>
>> The configuration package provides the tools to store configuration settings
>> for your application. Configuration options are stored on disk using INI
>> files or other configuration formats. The configuration package comes with
>> support for manipulation and storage of INI files and caching.
>>
>> Current implementation
>> ----------------------
>>
>> The configuration package does not provide any mechanism to get a final setting
>> value from several configuration directories.
>>
>> Requirements
>> ============
>>
>> The configuration override mechanism should be able to analyse a set of files
>> and apply the correct override mechanism to generate the resulting
>> configuration.
>>
>> Context aware configuration files
>> ---------------------------------
>>
>> Creating a website requires to go through 3 different execution contexts:
>>
>> 1. dev
>> 2. staging
>> 3. production
>>
>> Each context has its own specificities. For example the database used for each
>> of these 3 contexts is different. So this must be defined for each context and
>> used according to the one the web application is actually running in.
>>
>> Those 3 contexts should be handled by the Configuration component, during the
>> configuration directive merge process.
>>
>> Directory structure
>> -------------------
>>
>> In order to provide a clean directory structure the Configuration component
>> should be able to read and understand a directory structure compared to this
>> one: ::
>>
>> /[..]/conf/
>> |-- common
>> | |-- dev
>> | |-- prod
>> | `-- staging
>> `-- apps
>> |-- app1
>> | |-- dev
>> | |-- prod
>> | `-- staging
>> `-- app2
>> |-- dev
>> |-- prod
>> `-- staging
>
> Shouldn't that forced structure be optionnal and/or eventually part of
> the future Framework component?
I do not know, I know nothing about the Framework component.
>
>> Storing common configuration
>> ----------------------------
>>
>> All web applications have common configuration directives. So all common
>> configuration files and directives should be stored in the `common/<context>/`
>> directory. For example if all applications have to use the same database, it
>> could be easy to create a `common/<context>/database.ini` file containing
>> informations to connect to this database. Since each file is context specific
>> it will be required to copy a file in all context directories. For example if
>> you want to store database connection values for all project, you can create a
>> file in `conf/<context>/database.ini` with the following contents: ::
>>f
>> [DatabaseSettings]
>> Host=localhost
>> Password=1234
>> Port=1234
>>
>> And this configuration will be available for all projects that use the
>> `database.ini` file.
>>
>> Storing application specific configuration
>> ------------------------------------------
>>
>> Providing different applications with the same code base but configured
>> differently is actually quite common as well. If for example you have a first
>> application called projectA and another one called projectB it should be
>> possible to have projectB inherit from projectA's configuration, as well as
>> overriding some of projectA's configuration.
>>
>> As an example, if we have projectA with the following configuration, in
>> `conf/apps/projectA/<context>/routes.ini` : ::
>>
>> [myapp.register]
>> controller=AAAAAAAA
>> railsRoute=register
>> action=register
>> template=register.ezt
>>
>> And for projectB you want to inherit from these values and override only a few
>> ones, in `conf/apps/projectB/<context>/routes.ini`: ::
>>
>> [app.register]
>> controller=BBBBBBBB
>>
>> After applying the configuration overrdie system, you should get at runtime
>> for projectB: ::
>>
>> [myapp.register]
>> controller=BBBBBBBB
>> railsRoute=register
>> action=register
>> template=register.ezt
>>
>> Performance considerations
>> --------------------------
>>
>> Hitting the filesystem and appying the override mechanism requires a lot of
>> ressources and will possibly be a memory hog. In order to avoid that a
>> compilation system should be provided. The system would work as follows:
>> 1. define any configuration file/group/directive you want
>> 2. run the compiler
>> 3. use the compiled version with merged configuration directive for subsequent
>> requests.
>
> Isn't that a generic operation?
>
> Why should Configuration take care of that?
Actually the more I read this doc, the more I think this component should be
a tiein between Configuration and Cache instead of be an addition to the already
existing Configuration component. What do you think ?
>
>> Caching
>> -------
>>
>> If the directive configuration are compiled, it should be possible to control
>> where the compiled version should be stored, for example in APC, or memcached
>> so you can share these configuration directive across multiple servers. That
>> would required a TieIn between the Configuration and the Cache component.
>
> Isn't that already possible with the current Configuration implementation?
I do not think so, or it is not documented. I found nothing here :
- http://incubator.apache.org/zetacomponents/documentation/trunk/Configuration/tutorial.html
>
>> Reading a configuration directive
>> ---------------------------------
>>
>> This require a modification of the actual API to handle the execution context.
>>
>> Writing a configuration directive
>> ---------------------------------
>>
>> This require a modification of the actual API to handle the execution context.
>>
>> FAQ
>> ---
>>
>> Why do not you provide context override as well ?
>> +++++++++++++++++++++++++++++++++++++++++++++++++
>>
>> The override system already provide an horizontal override system, i.e each file
>> override another if it is in the same context. Providing a context override mean
>> that it will require a vertical override system as well and is extremley complex
>> to implement. Even though it is an interesting idea, it is safer to keep it for
>> future versions of the Configuration component.
>>
>
> Aren't "contexts" to "application specific" anyway?
What do you mean ?
--
Jérôme Renard
http://39web.fr | http://jrenard.info
Re: [zeta-dev] Configuration component override mechanism :
requirement doc
Posted by James Pic <ja...@gmail.com>.
On Thu, Aug 12, 2010 at 2:19 PM, Jerome Renard <je...@gmail.com> wrote:
> Hi there,
>
> I took a few minutes to write down a draft of a requirement document
> for the configuration override mechanism.
>
> James : I integrated your part of the configuration group merge in the
> doc, tell me if that's ok for you.
It is indeed ;)
> Here is the draft (attached as well):
>
> Zeta Components : configuration override system, spec
> =====================================================
> :Author: Jérôme Renard, James Pic
> :Revision: $Revision$
> :Date: $Date$
>
> Introduction
> ============
>
> Description
> -----------
>
> The configuration package provides the tools to store configuration settings
> for your application. Configuration options are stored on disk using INI
> files or other configuration formats. The configuration package comes with
> support for manipulation and storage of INI files and caching.
>
> Current implementation
> ----------------------
>
> The configuration package does not provide any mechanism to get a final setting
> value from several configuration directories.
>
> Requirements
> ============
>
> The configuration override mechanism should be able to analyse a set of files
> and apply the correct override mechanism to generate the resulting
> configuration.
>
> Context aware configuration files
> ---------------------------------
>
> Creating a website requires to go through 3 different execution contexts:
>
> 1. dev
> 2. staging
> 3. production
>
> Each context has its own specificities. For example the database used for each
> of these 3 contexts is different. So this must be defined for each context and
> used according to the one the web application is actually running in.
>
> Those 3 contexts should be handled by the Configuration component, during the
> configuration directive merge process.
>
> Directory structure
> -------------------
>
> In order to provide a clean directory structure the Configuration component
> should be able to read and understand a directory structure compared to this
> one: ::
>
> /[..]/conf/
> |-- common
> | |-- dev
> | |-- prod
> | `-- staging
> `-- apps
> |-- app1
> | |-- dev
> | |-- prod
> | `-- staging
> `-- app2
> |-- dev
> |-- prod
> `-- staging
Shouldn't that forced structure be optionnal and/or eventually part of
the future Framework component?
> Storing common configuration
> ----------------------------
>
> All web applications have common configuration directives. So all common
> configuration files and directives should be stored in the `common/<context>/`
> directory. For example if all applications have to use the same database, it
> could be easy to create a `common/<context>/database.ini` file containing
> informations to connect to this database. Since each file is context specific
> it will be required to copy a file in all context directories. For example if
> you want to store database connection values for all project, you can create a
> file in `conf/<context>/database.ini` with the following contents: ::
>f
> [DatabaseSettings]
> Host=localhost
> Password=1234
> Port=1234
>
> And this configuration will be available for all projects that use the
> `database.ini` file.
>
> Storing application specific configuration
> ------------------------------------------
>
> Providing different applications with the same code base but configured
> differently is actually quite common as well. If for example you have a first
> application called projectA and another one called projectB it should be
> possible to have projectB inherit from projectA's configuration, as well as
> overriding some of projectA's configuration.
>
> As an example, if we have projectA with the following configuration, in
> `conf/apps/projectA/<context>/routes.ini` : ::
>
> [myapp.register]
> controller=AAAAAAAA
> railsRoute=register
> action=register
> template=register.ezt
>
> And for projectB you want to inherit from these values and override only a few
> ones, in `conf/apps/projectB/<context>/routes.ini`: ::
>
> [app.register]
> controller=BBBBBBBB
>
> After applying the configuration overrdie system, you should get at runtime
> for projectB: ::
>
> [myapp.register]
> controller=BBBBBBBB
> railsRoute=register
> action=register
> template=register.ezt
>
> Performance considerations
> --------------------------
>
> Hitting the filesystem and appying the override mechanism requires a lot of
> ressources and will possibly be a memory hog. In order to avoid that a
> compilation system should be provided. The system would work as follows:
> 1. define any configuration file/group/directive you want
> 2. run the compiler
> 3. use the compiled version with merged configuration directive for subsequent
> requests.
Isn't that a generic operation?
Why should Configuration take care of that?
> Caching
> -------
>
> If the directive configuration are compiled, it should be possible to control
> where the compiled version should be stored, for example in APC, or memcached
> so you can share these configuration directive across multiple servers. That
> would required a TieIn between the Configuration and the Cache component.
Isn't that already possible with the current Configuration implementation?
> Reading a configuration directive
> ---------------------------------
>
> This require a modification of the actual API to handle the execution context.
>
> Writing a configuration directive
> ---------------------------------
>
> This require a modification of the actual API to handle the execution context.
>
> FAQ
> ---
>
> Why do not you provide context override as well ?
> +++++++++++++++++++++++++++++++++++++++++++++++++
>
> The override system already provide an horizontal override system, i.e each file
> override another if it is in the same context. Providing a context override mean
> that it will require a vertical override system as well and is extremley complex
> to implement. Even though it is an interesting idea, it is safer to keep it for
> future versions of the Configuration component.
>
Aren't "contexts" to "application specific" anyway?
Regards
--
http://jamespic.com/contact
Customer is king - Le client est roi - El cliente es rey.
Re: [zeta-dev] Configuration component override mechanism :
requirement doc
Posted by Jerome Renard <je...@gmail.com>.
Hi James,
On Wed, Aug 18, 2010 at 12:17 PM, James Pic <ja...@gmail.com> wrote:
[...]
>
>
> Looks good to me, want to take the first shot at the design document? :D
>
I will be busy as hell the next few days, at least until the end of next week.
Feel free to start writing the design doc if you feel like it.
Maybe you can use the new Wiki for that ? :)
--
Jérôme Renard
http://39web.fr | http://jrenard.info | http://twitter.com/jeromerenard
Re: [zeta-dev] Configuration component override mechanism :
requirement doc
Posted by Jerome Renard <je...@gmail.com>.
James,
On Mon, Aug 16, 2010 at 8:29 PM, James Pic <ja...@gmail.com> wrote:
> On Mon, Aug 16, 2010 at 6:19 PM, Jerome Renard <je...@gmail.com> wrote:
>> James,
>>
>> On Mon, Aug 16, 2010 at 5:52 PM, James Pic <ja...@gmail.com> wrote:
>>> On Mon, Aug 16, 2010 at 3:47 PM, Jerome Renard <je...@gmail.com> wrote:
>>>> Jame,s
>>>>
>>>> On Mon, Aug 16, 2010 at 3:27 PM, James Pic <ja...@gmail.com> wrote:
>>>>> Hello Jerome,
>>>>>
>>>>> ie.
>>>>>
>>>>> $final = ezcConfigurationMerger::merge(array(
>>>>> $parent,
>>>>> // [...]
>>>>> $child,
>>>>> ));
>>>>>
>>>>
>>>> I would not use an array here, but only 2 arguments, like $parent and $child.
>>>>
>>>
>>> I though you wanted to have configuration in multiple directories? ie.
>>>
>>> array( // in order of importance
>>> '/path/to/project/etc/dev',
>>> '/path/to/app1/etc/dev',
>>> '/path/to/app1/etc/default',
>>> '/path/to/app2/etc/dev',
>>> '/path/to/app2/etc/default',
>>> )
>>>
>>> Didn't what you want look like something like that?
>>
>> Ideally yes, but if we split features in two different components,
>> then we can keep
>> the merge feature only in Configuration and all the rest in the other component.
>> As long as Configuration provide a merge mechanism between multilple
>> configuration groups, then
>> you can use this feature for entire files, no matter their location.
>> This gives us an interesting flexibility :)
>
> Do you mean that you recommand such a usage:
>
> foreach( $myConfigs as $config ) {
> if ( isset( $previousConfig ) ) {
> $final = mergeFunc( $previousConfig, $config );
> }
> $previousConfig = $config;
> }
>
More or less but encapsulated of course.
> Instead of:
>
> $final = mergeFunc( $myConfigs );
>
> What flexibility does it brings?
If you can do an operation on a small set (a configuration group in that case)
you can do exactly the same for larger chunks of data with a simple
loop. As long
as everything is encapsulated it is OK.
>
> Doesn't the first use case look like boilerplate code?
>
What do you mean ?
:)
--
Jérôme Renard
http://39web.fr | http://jrenard.info
Re: [zeta-dev] Configuration component override mechanism :
requirement doc
Posted by James Pic <ja...@gmail.com>.
On Mon, Aug 16, 2010 at 6:19 PM, Jerome Renard <je...@gmail.com> wrote:
> James,
>
> On Mon, Aug 16, 2010 at 5:52 PM, James Pic <ja...@gmail.com> wrote:
>> On Mon, Aug 16, 2010 at 3:47 PM, Jerome Renard <je...@gmail.com> wrote:
>>> Jame,s
>>>
>>> On Mon, Aug 16, 2010 at 3:27 PM, James Pic <ja...@gmail.com> wrote:
>>>> Hello Jerome,
>>>>
>>>> ie.
>>>>
>>>> $final = ezcConfigurationMerger::merge(array(
>>>> $parent,
>>>> // [...]
>>>> $child,
>>>> ));
>>>>
>>>
>>> I would not use an array here, but only 2 arguments, like $parent and $child.
>>>
>>
>> I though you wanted to have configuration in multiple directories? ie.
>>
>> array( // in order of importance
>> '/path/to/project/etc/dev',
>> '/path/to/app1/etc/dev',
>> '/path/to/app1/etc/default',
>> '/path/to/app2/etc/dev',
>> '/path/to/app2/etc/default',
>> )
>>
>> Didn't what you want look like something like that?
>
> Ideally yes, but if we split features in two different components,
> then we can keep
> the merge feature only in Configuration and all the rest in the other component.
> As long as Configuration provide a merge mechanism between multilple
> configuration groups, then
> you can use this feature for entire files, no matter their location.
> This gives us an interesting flexibility :)
Do you mean that you recommand such a usage:
foreach( $myConfigs as $config ) {
if ( isset( $previousConfig ) ) {
$final = mergeFunc( $previousConfig, $config );
}
$previousConfig = $config;
}
Instead of:
$final = mergeFunc( $myConfigs );
What flexibility does it brings?
Doesn't the first use case look like boilerplate code?
Regards
James
--
http://jamespic.com/contact
Customer is king - Le client est roi - El cliente es rey.
Re: [zeta-dev] Configuration component override mechanism :
requirement doc
Posted by Jerome Renard <je...@gmail.com>.
James,
On Mon, Aug 16, 2010 at 5:52 PM, James Pic <ja...@gmail.com> wrote:
> On Mon, Aug 16, 2010 at 3:47 PM, Jerome Renard <je...@gmail.com> wrote:
>> Jame,s
>>
>> On Mon, Aug 16, 2010 at 3:27 PM, James Pic <ja...@gmail.com> wrote:
>>> Hello Jerome,
>>>
>>> ie.
>>>
>>> $final = ezcConfigurationMerger::merge(array(
>>> $parent,
>>> // [...]
>>> $child,
>>> ));
>>>
>>
>> I would not use an array here, but only 2 arguments, like $parent and $child.
>>
>
> I though you wanted to have configuration in multiple directories? ie.
>
> array( // in order of importance
> '/path/to/project/etc/dev',
> '/path/to/app1/etc/dev',
> '/path/to/app1/etc/default',
> '/path/to/app2/etc/dev',
> '/path/to/app2/etc/default',
> )
>
> Didn't what you want look like something like that?
Ideally yes, but if we split features in two different components,
then we can keep
the merge feature only in Configuration and all the rest in the other component.
As long as Configuration provide a merge mechanism between multilple
configuration groups, then
you can use this feature for entire files, no matter their location.
This gives us an interesting flexibility :)
--
Jérôme Renard
http://39web.fr | http://jrenard.info
Re: [zeta-dev] Configuration component override mechanism :
requirement doc
Posted by James Pic <ja...@gmail.com>.
On Mon, Aug 16, 2010 at 3:47 PM, Jerome Renard <je...@gmail.com> wrote:
> Jame,s
>
> On Mon, Aug 16, 2010 at 3:27 PM, James Pic <ja...@gmail.com> wrote:
>> Hello Jerome,
>>
>> ie.
>>
>> $final = ezcConfigurationMerger::merge(array(
>> $parent,
>> // [...]
>> $child,
>> ));
>>
>
> I would not use an array here, but only 2 arguments, like $parent and $child.
>
I though you wanted to have configuration in multiple directories? ie.
array( // in order of importance
'/path/to/project/etc/dev',
'/path/to/app1/etc/dev',
'/path/to/app1/etc/default',
'/path/to/app2/etc/dev',
'/path/to/app2/etc/default',
)
Didn't what you want look like something like that?
--
http://jamespic.com/contact
Customer is king - Le client est roi - El cliente es rey.
Re: [zeta-dev] Configuration component override mechanism :
requirement doc
Posted by Jerome Renard <je...@gmail.com>.
Jame,s
On Mon, Aug 16, 2010 at 3:27 PM, James Pic <ja...@gmail.com> wrote:
> Hello Jerome,
>
> On Mon, Aug 16, 2010 at 3:11 PM, Jerome Renard <je...@gmail.com> wrote:
>> Hi James,
>>
>> I think the merge mechanism on Configuration should work like this :
>>
>> $parent = new ezcConfigurationIniReader() // init validate and load etc ...
>> $child = new ezcConfigurationIniReader() // init, validae and load etc ...
>>
>
> Why not use simple ezcConfiguration objects? those can be generated
> from different backends ie. php, ini ....
>
Sure, but the ezcConfiguration is just a higher view of what's going
under the hood with the
Ini or the array reader. So "designing" for the ini ready (for
example) make it obviously available
for the higher level ezConfiguration object :) Sorry for the
too-short-shortcut ;)
>> // and then we have a few options
>> // option 1:
>> $mergedGroup = new ezcConfigurationIniMergedGroup($parent, $child,
>> 'ConfigGroupName');
>> [...]
>>
>> // option2:
>> $mergedGroup = $parent->mergeWith($child, 'ConfigGroupName');
>> // and then $mergedGroup is an ezcConfigurationIniMergedGroup
>> [...]
>>
>
> Again, why not just generate a fresh ezcConfiguration object?
See above.
>
> ie.
>
> $final = ezcConfigurationMerger::merge(array(
> $parent,
> // [...]
> $child,
> ));
>
I would not use an array here, but only 2 arguments, like $parent and $child.
>> What I am wondering is if ezcConfigurationIniMergedGroup should be an
>> ezcBaseStruct
>> or something else. That would make sense to me to get it as an
>> ezcBaseStruct but maybe
>> I overlook something here.
>>
>> Merging by group gives a more granular control on what you want, and
>> by simply looping over
>> each group in a file, that would make it possible to merge a complete file.
>>
>> I used the INI reader as an example, that should work the same way
>> with the Array reader.
>>
>> What do you think ?
>
> I think we could just make a simple merge function that generates a
> final ezcConfiguration object from a set of ezcConfiguration objects,
> and make some trivial & sexy shortcut functions ie:
>
> $cfg = ezcConfigurationMerger::refresh(
> $writer, // ie. new ezcConfigurationArrayWriter()
> $pathToFinalConfiguration,
> array(
> $pathToDefaultConfiguration, // parent
> // [...]
> $pathToOverrideConfiguration, // child
> ),
> )
>
The line below are dedicated to the configuration write I believe.
If yes I agree with the function prototype, if no then I do not agree :p
> What do you think? Did i convince you or do we plainly disagree? hahaha
We are making progress on that topic ;)
--
Jérôme Renard
http://39web.fr | http://jrenard.info
Re: [zeta-dev] Configuration component override mechanism :
requirement doc
Posted by Jerome Renard <je...@gmail.com>.
Hi James,
On Sat, Aug 14, 2010 at 3:36 AM, James Pic <ja...@gmail.com> wrote:
> On Fri, Aug 13, 2010 at 7:04 PM, Jerome Renard <je...@gmail.com> wrote:
>> James,
>>
>> Hopefully my brain works better than earlier today.
>>
>> The more I think about the override thingy the more I tend to think
>> the following :
>> - The merge/inheritance (pick the word you like :D) could easily be
>> integrated in the native Configuration component.
>> I also already have the algorithm for that as well as tests, so I
>> believe that could be quite fast to integrate
>> this feature in Configuration.
>>
>> - The system around such as the directory structure, compilation and
>> caching stuff could be integrated into a
>> dedicated component that could be a tiein between Configuration and Cache.
>>
>> That way, everything is clean and separate, if you want to use only
>> the merge algorithm for a few configuration
>> files, then fair enough just use Configuration only. If you want more
>> than that, then use the tiein.
>>
>> What do you think ?
>
> Sounds excellent! That way people who like systems can use it, and
> people who don't like systems can still benefit from the upgrade...
Yep.
>
> ... Anyway, that sounds more like design document discussions than
> "requirement" document issues ;)
nia nia nia :-þ
--
Jérôme Renard
http://39web.fr | http://jrenard.info
Re: [zeta-dev] Configuration component override mechanism :
requirement doc
Posted by James Pic <ja...@gmail.com>.
On Fri, Aug 13, 2010 at 7:04 PM, Jerome Renard <je...@gmail.com> wrote:
> James,
>
> Hopefully my brain works better than earlier today.
>
> The more I think about the override thingy the more I tend to think
> the following :
> - The merge/inheritance (pick the word you like :D) could easily be
> integrated in the native Configuration component.
> I also already have the algorithm for that as well as tests, so I
> believe that could be quite fast to integrate
> this feature in Configuration.
>
> - The system around such as the directory structure, compilation and
> caching stuff could be integrated into a
> dedicated component that could be a tiein between Configuration and Cache.
>
> That way, everything is clean and separate, if you want to use only
> the merge algorithm for a few configuration
> files, then fair enough just use Configuration only. If you want more
> than that, then use the tiein.
>
> What do you think ?
Sounds excellent! That way people who like systems can use it, and
people who don't like systems can still benefit from the upgrade...
... Anyway, that sounds more like design document discussions than
"requirement" document issues ;)
Cheers
James
--
http://jamespic.com/contact
Customer is king - Le client est roi - El cliente es rey.
Re: [zeta-dev] Configuration component override mechanism :
requirement doc
Posted by Jerome Renard <je...@gmail.com>.
James,
Hopefully my brain works better than earlier today.
The more I think about the override thingy the more I tend to think
the following :
- The merge/inheritance (pick the word you like :D) could easily be
integrated in the native Configuration component.
I also already have the algorithm for that as well as tests, so I
believe that could be quite fast to integrate
this feature in Configuration.
- The system around such as the directory structure, compilation and
caching stuff could be integrated into a
dedicated component that could be a tiein between Configuration and Cache.
That way, everything is clean and separate, if you want to use only
the merge algorithm for a few configuration
files, then fair enough just use Configuration only. If you want more
than that, then use the tiein.
What do you think ?
:)
--
Jérôme Renard
http://39web.fr | http://jrenard.info
Re: [zeta-dev] Configuration component override mechanism :
requirement doc
Posted by Jerome Renard <je...@gmail.com>.
Hi James,
On Fri, Aug 13, 2010 at 1:31 PM, James Pic <ja...@gmail.com> wrote:
> On Thu, Aug 12, 2010 at 8:51 PM, Jerome Renard <je...@gmail.com> wrote:
>> James,
>>
>> On Thu, Aug 12, 2010 at 3:15 PM, James Pic <ja...@gmail.com> wrote:
>>> On Thu, Aug 12, 2010 at 2:19 PM, Jerome Renard <je...@gmail.com> wrote:
>>>>
>>>> Context aware configuration files
>>>> ---------------------------------
>>>>
>>>> Creating a website requires to go through 3 different execution contexts:
>>>>
>>>> 1. dev
>>>> 2. staging
>>>> 3. production
>>>>
>>>> Each context has its own specificities. For example the database used for each
>>>> of these 3 contexts is different. So this must be defined for each context and
>>>> used according to the one the web application is actually running in.
>>>>
>>>> Those 3 contexts should be handled by the Configuration component, during the
>>>> configuration directive merge process.
>>>>
>>>> Directory structure
>>>> -------------------
>>>>
>>>> In order to provide a clean directory structure the Configuration component
>>>> should be able to read and understand a directory structure compared to this
>>>> one: ::
>>>>
>>>> /[..]/conf/
>>>> |-- common
>>>> | |-- dev
>>>> | |-- prod
>>>> | `-- staging
>>>> `-- apps
>>>> |-- app1
>>>> | |-- dev
>>>> | |-- prod
>>>> | `-- staging
>>>> `-- app2
>>>> |-- dev
>>>> |-- prod
>>>> `-- staging
>>>>
>>>
>>> What if that's *not* what the user wants? Will he still be able to use
>>> the merger with simple ezcConfiguration objects? In that case i see no
>>> objections ;)
>>
>> Hmm I did not thought about that problematic, but I think that if we do our job
>> correctly we should be able to use the merge mechanism on two files. What do
>> you think ?
>>
>
> I though maybe we could just allow the user to merge configuration
> objects into another configuration object, which can then be used by
> your special manager, or normal managers, or normal writers and/or
> readers.
>
> Would that be simple and efficient enought?
I think so, it should no be possible to merge more than two
configuration objects.
You will get an octopuss otherwise. So merging two configuration objects into a
new one sound acceptable to me, and give enough flexibility to do more
work after
the merge process.
--
Jérôme Renard
http://39web.fr | http://jrenard.info
Re: [zeta-dev] Configuration component override mechanism :
requirement doc
Posted by James Pic <ja...@gmail.com>.
On Thu, Aug 12, 2010 at 8:51 PM, Jerome Renard <je...@gmail.com> wrote:
> James,
>
> On Thu, Aug 12, 2010 at 3:15 PM, James Pic <ja...@gmail.com> wrote:
>> On Thu, Aug 12, 2010 at 2:19 PM, Jerome Renard <je...@gmail.com> wrote:
>>>
>>> Context aware configuration files
>>> ---------------------------------
>>>
>>> Creating a website requires to go through 3 different execution contexts:
>>>
>>> 1. dev
>>> 2. staging
>>> 3. production
>>>
>>> Each context has its own specificities. For example the database used for each
>>> of these 3 contexts is different. So this must be defined for each context and
>>> used according to the one the web application is actually running in.
>>>
>>> Those 3 contexts should be handled by the Configuration component, during the
>>> configuration directive merge process.
>>>
>>> Directory structure
>>> -------------------
>>>
>>> In order to provide a clean directory structure the Configuration component
>>> should be able to read and understand a directory structure compared to this
>>> one: ::
>>>
>>> /[..]/conf/
>>> |-- common
>>> | |-- dev
>>> | |-- prod
>>> | `-- staging
>>> `-- apps
>>> |-- app1
>>> | |-- dev
>>> | |-- prod
>>> | `-- staging
>>> `-- app2
>>> |-- dev
>>> |-- prod
>>> `-- staging
>>>
>>
>> What if that's *not* what the user wants? Will he still be able to use
>> the merger with simple ezcConfiguration objects? In that case i see no
>> objections ;)
>
> Hmm I did not thought about that problematic, but I think that if we do our job
> correctly we should be able to use the merge mechanism on two files. What do
> you think ?
>
I though maybe we could just allow the user to merge configuration
objects into another configuration object, which can then be used by
your special manager, or normal managers, or normal writers and/or
readers.
Would that be simple and efficient enought?
--
http://jamespic.com/contact
Customer is king - Le client est roi - El cliente es rey.
Re: [zeta-dev] Configuration component override mechanism :
requirement doc
Posted by Jerome Renard <je...@gmail.com>.
James,
On Thu, Aug 12, 2010 at 3:15 PM, James Pic <ja...@gmail.com> wrote:
> On Thu, Aug 12, 2010 at 2:19 PM, Jerome Renard <je...@gmail.com> wrote:
>>
>> Context aware configuration files
>> ---------------------------------
>>
>> Creating a website requires to go through 3 different execution contexts:
>>
>> 1. dev
>> 2. staging
>> 3. production
>>
>> Each context has its own specificities. For example the database used for each
>> of these 3 contexts is different. So this must be defined for each context and
>> used according to the one the web application is actually running in.
>>
>> Those 3 contexts should be handled by the Configuration component, during the
>> configuration directive merge process.
>>
>> Directory structure
>> -------------------
>>
>> In order to provide a clean directory structure the Configuration component
>> should be able to read and understand a directory structure compared to this
>> one: ::
>>
>> /[..]/conf/
>> |-- common
>> | |-- dev
>> | |-- prod
>> | `-- staging
>> `-- apps
>> |-- app1
>> | |-- dev
>> | |-- prod
>> | `-- staging
>> `-- app2
>> |-- dev
>> |-- prod
>> `-- staging
>>
>
> What if that's *not* what the user wants? Will he still be able to use
> the merger with simple ezcConfiguration objects? In that case i see no
> objections ;)
Hmm I did not thought about that problematic, but I think that if we do our job
correctly we should be able to use the merge mechanism on two files. What do
you think ?
--
Jérôme Renard
http://39web.fr | http://jrenard.info
Re: [zeta-dev] Configuration component override mechanism :
requirement doc
Posted by James Pic <ja...@gmail.com>.
On Thu, Aug 12, 2010 at 2:19 PM, Jerome Renard <je...@gmail.com> wrote:
>
> Context aware configuration files
> ---------------------------------
>
> Creating a website requires to go through 3 different execution contexts:
>
> 1. dev
> 2. staging
> 3. production
>
> Each context has its own specificities. For example the database used for each
> of these 3 contexts is different. So this must be defined for each context and
> used according to the one the web application is actually running in.
>
> Those 3 contexts should be handled by the Configuration component, during the
> configuration directive merge process.
>
> Directory structure
> -------------------
>
> In order to provide a clean directory structure the Configuration component
> should be able to read and understand a directory structure compared to this
> one: ::
>
> /[..]/conf/
> |-- common
> | |-- dev
> | |-- prod
> | `-- staging
> `-- apps
> |-- app1
> | |-- dev
> | |-- prod
> | `-- staging
> `-- app2
> |-- dev
> |-- prod
> `-- staging
>
What if that's *not* what the user wants? Will he still be able to use
the merger with simple ezcConfiguration objects? In that case i see no
objections ;)
--
http://jamespic.com/contact
Customer is king - Le client est roi - El cliente es rey.