OO and Configuration files

From: linusj (linusjoseph_at_gmail.com)
Date: 10/29/04


Date: 29 Oct 2004 13:47:10 -0700

Configuration files are sometimes (mis?)used to drive application
logic. I am trying to understand if this is a good practice. Let me
explain with an example.
Let us say I have used the Factory pattern. So I have, say, a
PaymentProcessorFactory that would create a CreditCardProcessor or
CheckProcessor. Is it a good design to keep the class names in config
file and use reflection to load the Objects? (ie. CreditCardProcessor
or CheckProcessor). I have seen a similar pratice in some
implementations to load Mapper classes based on which Domain object is
requesting load or save Data Mapper Pattern.
                          Taking this issue further, are there any
caveats in using configuration files to support good OO practices?.
Doesnt excess use of config files move application logic out of
classes into the config file, thus violating encapsulation??

Thanks a lot
Linus



Relevant Pages

  • Re: OO and Configuration files
    ... I am trying to understand if this is a good practice. ... using a factory pattern is good design; ... > caveats in using configuration files to support good OO practices?. ... Say you use a configuration file to decide how much memory to allocate ...
    (comp.object)
  • Re: OO and Configuration files
    ... I am trying to understand if this is a good practice. ... use configuration files for object instantiation. ... > caveats in using configuration files to support good OO practices?. ... knowledge responsibilities when an object is created. ...
    (comp.object)
  • Re: OO and Configuration files
    ... I am trying to understand if this is a good practice. ... > implementations to load Mapper classes based on which Domain object is ... > caveats in using configuration files to support good OO practices?. ... When I'd use a config file in this case I'd simply record the factory class ...
    (comp.object)
  • Re: OO and Configuration files
    ... I am trying to understand if this is a good practice. ... Am I trying to a create template mechanism? ... > caveats in using configuration files to support good OO practices?. ... partially in Java and partially lost in space ... ...
    (comp.object)
  • Re: New FreeBSD 5.3 e-mail server extremely slow...
    ... > and yavr (yet another virus recipe) off. ... Load ... Same configuration files? ...
    (freebsd-questions)