Commons Logging is a great example of the problems these small
third-party dependencies cause host applications :)

In this case, yes, we need to log, however, as a library, the only
messages the user will care about are those that are from the library
as a whole.  If the user needs to filter at a package level a
library's log messages, that library has problems :)

Therefore, all a library needs is a Log interface, a simple default
implementation, and a factory to provide that implementation.  The
library, if it really wants, can provide a commons-logging, jdk
logging, and/or log4j implementation, but I think that's really
optional.  The point is these classes should be in the libraries
package system so that they don't conflict with any other application
or application server dependencies.

At some point, I plan to replace commons-logging in Struts 2 with a
simple log framework.  I can backport to Struts 1 if desired.

Don

On 8/21/06, Martin Cooper <[EMAIL PROTECTED]> wrote:
On 8/21/06, Don Brown <[EMAIL PROTECTED]> wrote:
>
> I think we should keep s2's dependencies down to an absolute minimum.
> If you are writing an application, the more you reuse third-party
> libraries the better, however, if you are writing a framework and/or
> library, ideally, you should have none.
>
> The main reason libraries should have as few deps as possible is it
> imposes undue restrictions on the application using the library.  For
> example, say Struts 2 started using commons-lang 2.1, but the
> application wanted to move to 3.0.  They'd have to wait until Struts 2
> moved to 3.0, but then all the apps using 2.1 would be forced to upgrade.
>
> IMO, the ideal library has no dependencies, and I include
> commons-logging in the forbidden list.


Any library of any consequence needs to log errors and exceptions. We can't
dictate to our users which logging package they use, and we need to provide
for unified logging throughout an application. Given those constraints, how
do you propose that we handle logging if we don't depend on something like
Commons Logging?

--
Martin Cooper


Don
>
> Paul Benedict wrote:
> > Because Struts does alot of Spring manipulation on URIs, would it make
> sense to add Commons Lang as a dependency? This way we don't have homegrown
> string parsing done everytime. Thoughts for s2 too?
> >
> >
> > ---------------------------------
> > Do you Yahoo!?
> >  Next-gen email? Have it all with the  all-new Yahoo! Mail Beta.
> >
>
>
> ---------------------------------------------------------------------
> 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