Well, not all plugins read xml files so it would be inappropriate to supply it as a base implementation. However, it may be useful to distribute it as an optional plugin that an app can use. Post an enhancement request with your code for people to review.

David



From: Joe Germuska <[EMAIL PROTECTED]>
Reply-To: "Struts Developers List" <[EMAIL PROTECTED]>
To: Struts Developers List <[EMAIL PROTECTED]>
Subject: Base PlugIn implementation?
Date: Tue, 18 Mar 2003 10:35:16 -0600

I find myself using PlugIns all over the place, and I was wondering if there'd be any interest in adding a base implementation to the Struts distribution.

I have an abstract class I extend which works on the assumption that you want to digest an XML config file from some resource and put it into the application context. The base class has three properties:

"key" (arbitrary string)
"configSource" (one of "classpath," "file," or "servlet")
"configPath" (arbitrary string which resolves to a resource using "configSource")


The abstract class just provides support methods to open an InputStream using configPath and configSource. I've been extending the base class and initializing a Digester using those support methods and then placing the result of the Digester parse into Application scope under "key." However, it would be trivial to add properties for configuring the Digester from XML or from RuleSet class implementations and roll all of that into the base's init method. At that point it wouldn't even need to be an abstract class anymore.

Would this be something people would find useful enough that I should share it? Or has everyone who uses PlugIns already done something like it?

Joe

--
--
Joe Germuska
[EMAIL PROTECTED]
http://blog.germuska.com
"If nature worked that way, the universe would crash all the time."
        --Jaron Lanier

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


_________________________________________________________________
Add photos to your e-mail with MSN 8. Get 2 months FREE*. http://join.msn.com/?page=features/featuredemail



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



Reply via email to