From: Alistair Y. <ali...@sm...> - 2006-03-23 10:16:04
|
> I think it's a bit to soon to add it to 2.8 fair enough, yes. > it would be good if it was available there's the rub - we don't want to have to merge in tons of stuff =20 when it's uhi specific. That's where the plugin idea came from: <plugin ... /> tag in template Plugin interface and implementation Configged at runtime. Can I go back to struts please? I've had enough Facility! Alistair On 23 Mar 2006, at 09:58, Colin Tatham wrote: > Alistair Young wrote: >> either I'm not getting messages again or it's all gone quiet. > ;-) > >> We'd like to put org.bodington.plugin and some interfaces in for =20 >> 2.8 so we can factor out our My Modules but still leave a hook in =20= >> Facility. >> This ok with bod.org? > > I think it's a bit to soon to add it to 2.8. It's a new approach =20 > and I think it would be sensible to give it more time -- once =20 > something's in a release version it's messy to change. I realise =20 > that doesn't help with your problem. I think MyModules could be =20 > useful to other users, so it would be good if it was available... > > > Colin > > >> On 22 Mar 2006, at 14:32, Alistair Young wrote: >>> I'm happy to pursue this Adam, if we can agree on how to =20 >>> implement them >>> for v1. Lots to think about. We have a concrete use case for a =20 >>> plugin >>> though, which means minimal merging of Facility. >>> >>> The real quesion is whether it's good or bad to let templates =20 >>> call any >>> class they want. That would free up plugin developers from using =20= >>> Facility. >>> >>> --=20 >>> Alistair Young >>> Senior Software Engineer >>> UHI@Sabhal M=F2r Ostaig >>> Isle of Skye >>> Scotland >>> >>>> Plugins are something that Boding desparately needs, perhaps we =20= >>>> should >>>> dedicate >>>> some time to work with Al after our new WebLearn release? >>>> >>>> adam >>>> >>>> In message <7A5...@sm...> >>>> bod...@li... writes: >>>> >>>>> damn list - I didn't get the original of this message and it came >>>>> from me! >>>>> >>>>>> Can you create a subclass of Facility? >>>>> >>>>> I think Facility is a lost cause. We'll wait for Tetra! >>>>> >>>>> Thinking about maybe specific plugins - ScreenPlugin - writes to >>>>> screen, DBPlugin - does stuff with the DB. It's just a way to >>>>> refactor code out of Facility into small packages of functionality >>>>> that can better be merged etc. Dare I even say, configured at run >>>>> time too, ala struts/spring (I see cabbages heading my way). >>>>> >>>>> The basic idea is to have, say, a plugins package in bod: >>>>> >>>>> org.bodington.plugin >>>>> >>>>> and have specific interfaces in there: >>>>> >>>>> ScreenPlugin >>>>> DBPlugin >>>>> >>>>> public interface ScreenPlugin { >>>>> public void run(Request req, PrintWriter writer) throws UP; >>>>> } >>>>> >>>>> not saying that's what they should be called, just to illustrate. >>>>> >>>>> Template then calls Facility.writeModuleLinks >>>>> >>>>> Facility.writeModuleLinks (Request req, PrintWriter writer) { >>>>> ScreenPlugin minerva =3D (ScreenPlugin)Class.forName >>>>> ("org.bodington.contrib.Minerva"); >>>>> minerva.run(req, writer): >>>>> } >>>>> >>>>> maybe as you say, use a subclass of Facility as a facade for =20 >>>>> the plugin. >>>>> >>>>> public class MinervaHelper extends Facility { >>>>> writeModuleLinks( ... ) { >>>>> ScreenPlugin ... >>>>> } >>>>> } >>>>> >>>>> so a template calls a plugin's facade - MinervaHelper - class =20 >>>>> instead >>>>> of Facility >>>>> >>>>> Can a template call methods in more than one class though? i.e. it >>>>> might need functionality that's in more than one plugin. >>>>> >>>>> Alistair >>>>> >>>>> >>>>> >>>>> On 22 Mar 2006, at 10:17, Matthew Buckett wrote: >>>>> >>>>>> Alistair Young wrote: >>>>>> >>>>>>> Bodders, I've been delurked, damn, to ask opinions. >>>>>>> >>>>>>> We have a requirement for My Modules, which is specific to us so >>>>>>> we don't >>>>>>> want to pollute Facility. However, a template must call facility >>>>>>> to get it >>>>>>> to write stuff to the screen. >>>>>> >>>>>> >>>>>> Can you create a subclass of Facility? >>>>>> >>>>>>> The writing is delegated to another class which is currently in >>>>>>> org.bodington.contrib on our HEAD but Facility still needs to =20= >>>>>>> know >>>>>>> about >>>>>>> the class to delegate to it - it has to cast to call methods =20 >>>>>>> etc, >>>>>>> so it >>>>>>> has to know about the specific class. >>>>>> >>>>>> >>>>>> At least the delegate methods should be small. This is how I =20 >>>>>> pulled >>>>>> the >>>>>> StyleSheet code out on WebLearn HEAD. There is still the =20 >>>>>> problem that >>>>>> Facility ends up with 100s of method calls. >>>>>> >>>>>>> A better way would be to define, e.g. >>>>>>> >>>>>>> package org.bodington.contrib; >>>>>>> >>>>>>> public interface Plugin { >>>>>>> public void run(Request req, PrintWriter writer) throws >>>>>>> SomeOrribleException; >>>>>>> } >>>>>>> >>>>>>> then our class could implement Plugin and Facility would only =20= >>>>>>> have >>>>>>> to load >>>>>>> it via Class.forName as a Plugin and call it's run method. >>>>>> >>>>>> >>>>>> Can you explain the call graph a little more. >>>>>> >>>>>>> It reduces the code in Facility and brings a sort of IOC/ =20 >>>>>>> dependancy >>>>>>> injection to Facility. >>>>>>> >>>>>>> What would be even better though is allowing templates to call >>>>>>> whatever >>>>>>> class they wanted and not just Facility or a subclass thereof. >>>>>> >>>>>> >>>>>> I added support for making static calls from template but I don't >>>>>> think >>>>>> this is a good move as then it becomes move difficult to =20 >>>>>> refactor code >>>>>> as you can't be sure without recompiling the templates if a =20 >>>>>> method is >>>>>> actually used. At the moment you only have todo this checking =20 >>>>>> when >>>>>> working with public methods in Facility. It also means that the >>>>>> idea of >>>>>> linking a template with a Facility in a configuration file breaks >>>>>> down. >>>>>> >>>>>> >>>>>> --=20 >>>>>> -- Matthew Buckett, VLE Developer >>>>>> -- Learning Technologies Group, Oxford University Computing =20 >>>>>> Services >>>>>> -- Tel: +44 (0)1865 283660 http://www.oucs.ox.ac.uk/ltg/ >>>>>> >>>>>> >>>>>> ------------------------------------------------------- >>>>>> This SF.Net email is sponsored by xPML, a groundbreaking =20 >>>>>> scripting >>>>>> language >>>>>> that extends applications into web and mobile media. Attend the >>>>>> live webcast >>>>>> and join the prime developer group breaking into this new coding >>>>>> territory! >>>>>> http://sel.as-us.falkag.net/sel? >>>>>> cmd=3Dlnk&kid=3D110944&bid=3D241720&dat=3D121642 >>>>>> _______________________________________________ >>>>>> Bodington-developers mailing list >>>>>> Bod...@li... >>>>>> https://lists.sourceforge.net/lists/listinfo/bodington-developers >>>>> >>>>> >>>>> >>>>> >>>>> ------------------------------------------------------- >>>>> This SF.Net email is sponsored by xPML, a groundbreaking scripting >>>>> language >>>>> that extends applications into web and mobile media. Attend the =20= >>>>> live >>>>> webcast >>>>> and join the prime developer group breaking into this new coding >>>>> territory! >>>>> http://sel.as-us.falkag.net/sel? =20 >>>>> cmd=3Dlnk&kid=3D110944&bid=3D241720&dat=3D121642 >>>>> _______________________________________________ >>>>> Bodington-developers mailing list >>>>> Bod...@li... >>>>> https://lists.sourceforge.net/lists/listinfo/bodington-developers >>>>> >>>> >>>> --=20 >>>> --=20 >>>> Dr AC Marshall (Bodington developer) OUCS, 13, Banbury Rd. =20 >>>> Oxford. OX2 6NN >>>> Cheese of the month: Smoked Wensleydale >>>> >>>> >>>> ------------------------------------------------------- >>>> This SF.Net email is sponsored by xPML, a groundbreaking scripting >>>> language >>>> that extends applications into web and mobile media. Attend the =20 >>>> live >>>> webcast >>>> and join the prime developer group breaking into this new coding >>>> territory! >>>> http://sel.as-us.falkag.net/sel?cmd=3Dlnk&kid=110944&bid$1720&dat=121= 642 >>>> _______________________________________________ >>>> Bodington-developers mailing list >>>> Bod...@li... >>>> https://lists.sourceforge.net/lists/listinfo/bodington-developers >>>> >>> >>> >>> >>> ------------------------------------------------------- >>> This SF.Net email is sponsored by xPML, a groundbreaking =20 >>> scripting language >>> that extends applications into web and mobile media. Attend the =20 >>> live webcast >>> and join the prime developer group breaking into this new coding =20= >>> territory! >>> http://sel.as-us.falkag.net/sel?cmd=3Dlnk&kid=110944&bid$1720&dat=1216= 42 >>> _______________________________________________ >>> Bodington-developers mailing list >>> Bod...@li... >>> https://lists.sourceforge.net/lists/listinfo/bodington-developers >> ------------------------------------------------------- >> This SF.Net email is sponsored by xPML, a groundbreaking scripting =20= >> language >> that extends applications into web and mobile media. Attend the =20 >> live webcast >> and join the prime developer group breaking into this new coding =20 >> territory! >> http://sel.as-us.falkag.net/sel?cmd=3Dk&kid=110944&bid$1720&dat=121642 >> _______________________________________________ >> Bodington-developers mailing list >> Bod...@li... >> https://lists.sourceforge.net/lists/listinfo/bodington-developers > > > --=20 > ____________________________________ > Colin Tatham > VLE Team > Oxford University Computing Services > > http://www.oucs.ox.ac.uk/ltg/vle/ > http://bodington.org > > > ------------------------------------------------------- > This SF.Net email is sponsored by xPML, a groundbreaking scripting =20 > language > that extends applications into web and mobile media. Attend the =20 > live webcast > and join the prime developer group breaking into this new coding =20 > territory! > http://sel.as-us.falkag.net/sel?=20 > cmd=3Dlnk&kid=3D110944&bid=3D241720&dat=3D121642 > _______________________________________________ > Bodington-developers mailing list > Bod...@li... > https://lists.sourceforge.net/lists/listinfo/bodington-developers |