Why would you ever want to inject a mock object via the registry?  Mock
objects should be injected by unit test code outside of the registry.  

Now, if you mean you want to inject a "dummy" or "simple" implementation of
a service to be used in a development environment (a mail service that
doesn't really send emails, for example), you could use a symbol as part of
your implementation class name and change it via a properties file in your
development environment.  This is the HiveMind 1.0 way of overriding
services, but it would work for you.  That would be the easiest way to do it
without having to write an entirely new configuration file to override
service implementations as we do in HiveMind 1.1.  Does that make sense?


-----Original Message-----
From: Glen Stampoultzis [mailto:[EMAIL PROTECTED] 
Sent: Monday, June 27, 2005 7:28 PM
To: [email protected]
Subject: Re: Run modes: Dev, Test, Production

On 6/28/05, James Carman <[EMAIL PROTECTED]> wrote:
> Do you mean something like substituting in the database connection
settings
> (url, user, password)?  HiveMind has SymbolSources which can be used for
> this.  You could create a SymbolSource which is based on a property file.
> Then, you just substitute in your property file for your specific
> environment.
> 
> For this, I usually incorporate Velocity into my build system so that I
can
> create a file (or files) that is based upon values from my
build.properties
> file.  That way, any customization goes on in one place, the
> build.properties file.  The problem with this is that you actually have to
> run the build whenever you want to deploy your project to a new
environment
> using a new build.properties file specific to that environment, but in my
> case, that hasn't been much of a burden.  If you want the code for the
> velocity task, let me know.
> 

What about if you want to inject a mock?  Is there a way to do this
without creating an entirely new configuration?

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to