Issue 64: default-architecture-rules.xml

2 views
Skip to first unread message

Mike Nereson

unread,
Jun 26, 2009, 11:39:12 AM6/26/09
to architectur...@googlegroups.com
With regard to http://code.google.com/p/architecturerules/issues/detail?id=64

I want to close this issue. I think its done.


So the requirement for this issue it to load up a default-architecture-rules.xml prior to ever loading a user defined xml file, yaml file, programmatic configuration, or any other format that we may support someday.

Here is my question: How do we ensure this file gets loaded every time, and first?

We have  abstract class AbstractConfigurationFactory implements ConfigurationFactory with a private constructor.

    /**
     * Creates new instance and loads default configuration.
     */
    protected AbstractConfigurationFactory() {
       
    }

The comment suggests that it loads the default configuration, but there is no code in the method body. So I added

    /**
     * Creates new instance and loads default configuration.
     */
    protected AbstractConfigurationFactory() {

        loadConfiguration(ConfigurationFactory.DEFAULT_CONFIGURATION_CONFIGURATION_FILE_NAME);
    }

Does this look right? My kola, you have recently authored much of the ConfigurationFactory code to include the new subclasses. Does this seem like the appropriate addition to get this default configuration file loaded every time including for programmatic configuration?

I have commited this as r700.

Thanks for looking at this.





~ Mike Nereson

Mykola Nikishov

unread,
Jun 26, 2009, 3:46:07 PM6/26/09
to architectur...@googlegroups.com
Mike Nereson <miken...@gmail.com> writes:

> With regard to http://code.google.com/p/architecturerules/issues/detail?id=64
>
> I want to close this issue. I think its done.
>
> So the requirement for this issue it to load up a
> default-architecture-rules.xml prior to ever loading a user defined
> xml file, yaml file, programmatic configuration, or any other format
> that we may support someday.

Let me reword this requirement slightly:

So the requirement for this issue it to load up a default

configuration prior to ever loading a user defined xml file, yaml


file, programmatic configuration, or any other format that we may
support someday.

Is it ok if we'll not say "default configuration _file_" here but just
"default configuration"?

> Here is my question: How do we ensure this file gets loaded every
> time, and first?
>

> Does this look right? Mykola, you have recently authored much of the


> ConfigurationFactory code to include the new subclasses. Does this
> seem like the appropriate addition to get this default configuration
> file loaded every time including for programmatic configuration?
>
> I have commited this as r700.

I'd like to get rid of default-architecture-rules.xml file and move our
defaults to org.architecturerules.configuration.Configuration. What do
you think? I've attached a patch to issue 64 for reference.

BTW, r700 breaks two tests:
- testListeners_undefined(org.architecturerules.configuration.xml.DigesterConfigurationFactoryTest)
- testProperties_nonePresent(org.architecturerules.configuration.xml.DigesterConfigurationFactoryTest)

--
MAN-UANIC

Mike Nereson

unread,
Jun 26, 2009, 3:51:29 PM6/26/09
to architectur...@googlegroups.com
> So the requirement for this issue it to load up a
> default-architecture-rules.xml prior to ever loading a user defined
> xml file, yaml file, programmatic configuration, or any other format
> that we may support someday.

Let me reword this requirement slightly:

 So the requirement for this issue it to load up a default
 configuration prior to ever loading a user defined xml file, yaml
 file, programmatic configuration, or any other format that we may
 support someday.

Is it ok if we'll not say "default configuration _file_" here but just
"default configuration"?

Yes. That is more specific in what we want.



> Here is my question: How do we ensure this file gets loaded every
> time, and first?
>
> Does this look right? Mykola, you have recently authored much of the
> ConfigurationFactory code to include the new subclasses. Does this
> seem like the appropriate addition to get this default configuration
> file loaded every time including for programmatic configuration?
>
> I have commited this as r700.

I'd like to get rid of default-architecture-rules.xml file and move our
defaults to org.architecturerules.configuration.Configuration. What do
you think? I've attached a patch to issue 64 for reference.

That is sort of what I am trying to avoid. Originally the default configuration was hard to find. It was declared programmatically and scattered which sort of made it hard to track down what the default value was. Also, when it came time to add new features and set the new default values, it was not as easy as it should be. Finally, when I wanted to simply see what the default settings where,  I couldn't.

This is why I wanted to move it into a plain text, easy to read, easy to find configuration. Hence default-architecture-rules.xml. I wanted to be able to just direct users to that file to see what their configurations were to start.

What do you think? Is there a compromise here that we can find?
 

BTW, r700 breaks two tests:
- testListeners_undefined(org.architecturerules.configuration.xml.DigesterConfigurationFactoryTest)
- testProperties_nonePresent(org.architecturerules.configuration.xml.DigesterConfigurationFactoryTest)

I'll take a look.
Reply all
Reply to author
Forward
0 new messages