I've actually had to implement this type of feature in multiple
enterprise applications. However, I would say that it's not knowing the
environment, but being able to change configuration elements per
environment that is important (for what I did, and in rails I think this
is the most important elements). i.e. change the SMTP, temp file dir,
admin user email address, etc. depending on whether you are testing
locally vs. production.
If developers are using spring, there is a way to load property files
with a hostname extension (which is one solution) - but should we always
expect users to be using Spring? The other question is being able to
modify struts.property properties depending on env (i.e. devMode=true in
development and never in production).
/Ian
Antonio Petrelli wrote:
2008/6/27 James Holmes <[EMAIL PROTECTED]>:
http://blogs.sun.com/rlubke/entry/jsf_2_0_new_feature2
I like it. This is one of the features of RoR that I really found useful.
Anyone else had thoughts of doing something like this for Struts 2?
I hope that my answer is not a flamebait, but I think that this
feature is pretty lame.
I think that it can be easily implemented, for example with JNDI (like
they did), or with a context param in web.xml, or whatever. Do we
really need it?
Moreover, I think that modifying behaviour of an application depending
on where it is deployed is a bad idea. Sometimes it is difficult to
figure out why bugs happen in production and not in our local
environment. If we have different behaviour, debugging becomes a
nightmare.
About the example in the blog:
<snip>
Here is where ProjectStage comes in: If the current stage is Development and
no h:messages is present in the view, we'll add one automatically for
the user.
If the stage is Production we'd take no action (assuming the user would have
this all corrected - no need to try to modify the tree).
</snip>
Does it mean that, once in production, no message will appear? It's
fantastic, I see a message in development and I forget to hard code
it, because the framework puts one for me, and in production it does
not appear, so the user will be clueless on what's happening.
Just my 2 eurocents rant :-D
Antonio
---------------------------------------------------------------------
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]