You can subscribe to this list here.
2002 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(4) |
Nov
(28) |
Dec
(47) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2003 |
Jan
(103) |
Feb
(44) |
Mar
(65) |
Apr
(140) |
May
(72) |
Jun
(233) |
Jul
(466) |
Aug
(51) |
Sep
(2) |
Oct
(17) |
Nov
(1) |
Dec
(7) |
2004 |
Jan
(8) |
Feb
(5) |
Mar
(28) |
Apr
(9) |
May
(7) |
Jun
|
Jul
(7) |
Aug
|
Sep
|
Oct
(1) |
Nov
|
Dec
|
2005 |
Jan
(1) |
Feb
|
Mar
|
Apr
(3) |
May
(24) |
Jun
(7) |
Jul
(2) |
Aug
|
Sep
|
Oct
(4) |
Nov
(3) |
Dec
(12) |
2006 |
Jan
|
Feb
(3) |
Mar
(8) |
Apr
(59) |
May
|
Jun
|
Jul
|
Aug
(24) |
Sep
|
Oct
|
Nov
|
Dec
(3) |
2007 |
Jan
|
Feb
|
Mar
|
Apr
(8) |
May
|
Jun
|
Jul
(1) |
Aug
|
Sep
|
Oct
|
Nov
(7) |
Dec
(3) |
2008 |
Jan
|
Feb
(1) |
Mar
(16) |
Apr
(2) |
May
(2) |
Jun
|
Jul
(11) |
Aug
(3) |
Sep
(9) |
Oct
(9) |
Nov
(44) |
Dec
(34) |
2009 |
Jan
(12) |
Feb
(14) |
Mar
(11) |
Apr
(16) |
May
(41) |
Jun
(19) |
Jul
(33) |
Aug
(8) |
Sep
(3) |
Oct
|
Nov
|
Dec
(7) |
2010 |
Jan
(8) |
Feb
(50) |
Mar
(3) |
Apr
(2) |
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2011 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
(16) |
Dec
|
2012 |
Jan
|
Feb
|
Mar
|
Apr
(3) |
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: <kea...@na...> - 2003-03-28 15:39:30
|
I stand corrected. EBR, you da man! Keats > -----Original Message----- > > I guess I was just lazy.=A0 There aren't any existing tests for the = =20 > > MathTool AFAICT.=A0 > > > > I don't know exactly how to do a test case for random() --=20 > since we =20 > > obviously don't know what the expected result is.=A0 I=20 > suppose I could =20 > > loop a bunch of times and make sure that all values=20 > returned are in =20 > > range and that all values in the range get returned, or I=20 > could just =20 > > compute the min/max/mean and check them.=A0 But this seems=20 > like overkill =20 > > for such a simple (one-line) method.=A0 >=20 > http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/webmacro/webmac > ro/test/=20 > = unit/org/webmacro/util/TestMathTool.java?rev=3D1.2&content-type=3Dtext/ = > vnd.viewcvs-markup >=20 > it's been there since Nov. 2002 and does basically what you describe = > above. >=20 > eric >=20 |
From: Eric B. R. <eb...@tc...> - 2003-03-28 15:33:38
|
On Friday, March 28, 2003, at 10:28 AM, kea...@na... =20= wrote: > I guess I was just lazy.=A0 There aren't any existing tests for the =20= > MathTool AFAICT.=A0 > > I don't know exactly how to do a test case for random() -- since we =20= > obviously don't know what the expected result is.=A0 I suppose I could = =20 > loop a bunch of times and make sure that all values returned are in =20= > range and that all values in the range get returned, or I could just =20= > compute the min/max/mean and check them.=A0 But this seems like = overkill =20 > for such a simple (one-line) method.=A0 http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/webmacro/webmacro/test/=20= unit/org/webmacro/util/TestMathTool.java?rev=3D1.2&content-type=3Dtext/=20= vnd.viewcvs-markup it's been there since Nov. 2002 and does basically what you describe =20 above. eric > > The main method I added allows you to do a quick visual check that the = =20 > thing is working.=A0 This is better than what we had before. > > Keats > > > -----Original Message----- > > From: Lane Sharman [mailto:la...@op...] > > Sent: Friday, March 28, 2003 10:22 AM > > To: Keats Kirsch > > Cc: web...@li...; jim...@ag...; > > EricB. Ridge > > Subject: Re: [Webmacro-devel] MathTool.random broken? > > > > > > Why did you not add a test case? > > > > -Lane > > > > Keats Kirsch wrote: > > > > > I've committed this change along with a little test in main(). > > > > > > Keats > > > > > > Eric B. Ridge wrote: > > > > > >> On Thursday, March 27, 2003, at 11:29=A0 AM, > > kea...@na... > > >> wrote: > > >> > > >> > > I may fail to understand the code, but it seems wrong to me > > >> > > so I changed it to > > >> > > > > >> > > public static final int random(int start, int end) { > > >> > >=A0=A0=A0=A0=A0=A0 int iRet =3D start + (int) ((end - start + > > >> > > 1)*java.lang.Math.random()); > > >> > >=A0=A0=A0=A0=A0=A0 return iRet > end ? end : iRet; > > >> > > } > > >> > > > >> > Your code looks right to me, but the final test is > > unnecessary, since > > >> > Math.random() is always less than 1.0. > > >> > > > >> > Eric, I think this was your thing.=A0 Do you want to do the = fix, =20 > or > > >> > shall I? > > >> > > >> If you're in the mood, go ahead.=A0 :)=A0 I'm snowed under here = at the > > >> office. > > >> > > >> eric > > >> > > > > > > > > > > > > > > > > > > ------------------------------------------------------- > > > This SF.net email is sponsored by: > > > The Definitive IT and Networking Event. Be There! > > > NetWorld+Interop Las Vegas 2003 -- Register today! > > > http://ads.sourceforge.net/cgi-bin/redirect.pl?keyn0001en > > > _______________________________________________ > > > Webmacro-devel mailing list > > > Web...@li... > > > https://lists.sourceforge.net/lists/listinfo/webmacro-devel > > > > > > > -- > > Lane Sharman > > Learn About Conga, All Java GUI Builder: http://opendoors.com/conga > > Java Software Portal: http://opendoors.com > > > > > > > > > |
From: <kea...@na...> - 2003-03-28 15:28:56
|
I guess I was just lazy. There aren't any existing tests for the MathTool AFAICT. I don't know exactly how to do a test case for random() -- since we obviously don't know what the expected result is. I suppose I could loop a bunch of times and make sure that all values returned are in range and that all values in the range get returned, or I could just compute the min/max/mean and check them. But this seems like overkill for such a simple (one-line) method. The main method I added allows you to do a quick visual check that the thing is working. This is better than what we had before. Keats > -----Original Message----- > From: Lane Sharman [mailto:la...@op...] > Sent: Friday, March 28, 2003 10:22 AM > To: Keats Kirsch > Cc: web...@li...; jim...@ag...; > EricB. Ridge > Subject: Re: [Webmacro-devel] MathTool.random broken? > > > Why did you not add a test case? > > -Lane > > Keats Kirsch wrote: > > > I've committed this change along with a little test in main(). > > > > Keats > > > > Eric B. Ridge wrote: > > > >> On Thursday, March 27, 2003, at 11:29 AM, > kea...@na... > >> wrote: > >> > >> > > I may fail to understand the code, but it seems wrong to me > >> > > so I changed it to > >> > > > >> > > public static final int random(int start, int end) { > >> > > int iRet = start + (int) ((end - start + > >> > > 1)*java.lang.Math.random()); > >> > > return iRet > end ? end : iRet; > >> > > } > >> > > >> > Your code looks right to me, but the final test is > unnecessary, since > >> > Math.random() is always less than 1.0. > >> > > >> > Eric, I think this was your thing. Do you want to do the fix, or > >> > shall I? > >> > >> If you're in the mood, go ahead. :) I'm snowed under here at the > >> office. > >> > >> eric > >> > > > > > > > > > > > > ------------------------------------------------------- > > This SF.net email is sponsored by: > > The Definitive IT and Networking Event. Be There! > > NetWorld+Interop Las Vegas 2003 -- Register today! > > http://ads.sourceforge.net/cgi-bin/redirect.pl?keyn0001en > > _______________________________________________ > > Webmacro-devel mailing list > > Web...@li... > > https://lists.sourceforge.net/lists/listinfo/webmacro-devel > > > > -- > Lane Sharman > Learn About Conga, All Java GUI Builder: http://opendoors.com/conga > Java Software Portal: http://opendoors.com > > > > |
From: Lane S. <la...@op...> - 2003-03-28 15:09:16
|
Why did you not add a test case? -Lane Keats Kirsch wrote: > I've committed this change along with a little test in main(). > > Keats > > Eric B. Ridge wrote: > >> On Thursday, March 27, 2003, at 11:29 AM, kea...@na... >> wrote: >> >> > > I may fail to understand the code, but it seems wrong to me >> > > so I changed it to >> > > >> > > public static final int random(int start, int end) { >> > > int iRet = start + (int) ((end - start + >> > > 1)*java.lang.Math.random()); >> > > return iRet > end ? end : iRet; >> > > } >> > >> > Your code looks right to me, but the final test is unnecessary, since >> > Math.random() is always less than 1.0. >> > >> > Eric, I think this was your thing. Do you want to do the fix, or >> > shall I? >> >> If you're in the mood, go ahead. :) I'm snowed under here at the >> office. >> >> eric >> > > > > > > ------------------------------------------------------- > This SF.net email is sponsored by: > The Definitive IT and Networking Event. Be There! > NetWorld+Interop Las Vegas 2003 -- Register today! > http://ads.sourceforge.net/cgi-bin/redirect.pl?keyn0001en > _______________________________________________ > Webmacro-devel mailing list > Web...@li... > https://lists.sourceforge.net/lists/listinfo/webmacro-devel > -- Lane Sharman Learn About Conga, All Java GUI Builder: http://opendoors.com/conga Java Software Portal: http://opendoors.com |
From: Eric B. R. <eb...@tc...> - 2003-03-28 15:01:00
|
On Thursday, March 27, 2003, at 09:50 PM, Keats Kirsch wrote: > I've committed this change along with a little test in main(). There's actually a .testRandom() method in the test suite. I don't remember exactly which TestCase tho. eric > > Keats > > Eric B. Ridge wrote: > >> On Thursday, March 27, 2003, at 11:29 AM, >> kea...@na... >> wrote: >> >> > > I may fail to understand the code, but it seems wrong to me >> > > so I changed it to >> > > >> > > public static final int random(int start, int end) { >> > > int iRet = start + (int) ((end - start + >> > > 1)*java.lang.Math.random()); >> > > return iRet > end ? end : iRet; >> > > } >> > >> > Your code looks right to me, but the final test is unnecessary, >> since >> > Math.random() is always less than 1.0. >> > >> > Eric, I think this was your thing. Do you want to do the fix, or >> > shall I? >> >> If you're in the mood, go ahead. :) I'm snowed under here at the >> office. >> >> eric >> > > > |
From: Keats K. <kea...@na...> - 2003-03-28 02:49:49
|
I've committed this change along with a little test in main(). Keats Eric B. Ridge wrote: > On Thursday, March 27, 2003, at 11:29 AM, kea...@na... > wrote: > > > > I may fail to understand the code, but it seems wrong to me > > > so I changed it to > > > > > > public static final int random(int start, int end) { > > > int iRet = start + (int) ((end - start + > > > 1)*java.lang.Math.random()); > > > return iRet > end ? end : iRet; > > > } > > > > Your code looks right to me, but the final test is unnecessary, since > > Math.random() is always less than 1.0. > > > > Eric, I think this was your thing. Do you want to do the fix, or > > shall I? > > If you're in the mood, go ahead. :) I'm snowed under here at the > office. > > eric > |
From: Marc P. <ma...@an...> - 2003-03-28 02:01:27
|
On Wed, 26 Mar 2003 16:36:14 -0800, Brian Goetz <br...@qu...> wrote: > I added constructors for WM(Properties) and WM(Servlet, Properties). If > someone could check over the changes to make sure I didn't break > anything, that would be helpful. Hi Brian, I tested the new ctor (Servlet, Properties) you added and it seems to work great! I haven't done any regression testing yet I'd afraid. Thanks very much for doing that... I have a couple of bugs to track down and then do some major documentation and more testing of this... then I will put it into CVS so that others can look at it and we can discuss a list of pending issues and any extra features we want (such as some comments from Lane re: transaction lifecycle stuff) Best wishes, Marc -- http://www.wangjammers.org |
From: <kea...@na...> - 2003-03-27 18:23:15
|
> If you're in the mood, go ahead. :) I'm snowed under here at the > office. I know the feeling. :-{ I'll try to get to this tonight. Keats |
From: Eric B. R. <eb...@tc...> - 2003-03-27 16:33:55
|
On Thursday, March 27, 2003, at 11:29 AM, kea...@na...=20= wrote: > > I may fail to understand the code, but it seems wrong to me > > so I changed it to > > > > public static final int random(int start, int end) { > >=A0=A0=A0=A0=A0=A0 int iRet =3D start + (int) ((end - start + > > 1)*java.lang.Math.random()); > >=A0=A0=A0=A0=A0=A0 return iRet > end ? end : iRet; > > } > > Your code looks right to me, but the final test is unnecessary, since=20= > Math.random() is always less than 1.0. > > Eric, I think this was your thing.=A0 Do you want to do the fix, or=20 > shall I? If you're in the mood, go ahead. :) I'm snowed under here at the=20 office. eric |
From: <kea...@na...> - 2003-03-27 16:29:46
|
> I may fail to understand the code, but it seems wrong to me > so I changed it to > > public static final int random(int start, int end) { > int iRet = start + (int) ((end - start + > 1)*java.lang.Math.random()); > return iRet > end ? end : iRet; > } Your code looks right to me, but the final test is unnecessary, since Math.random() is always less than 1.0. Eric, I think this was your thing. Do you want to do the fix, or shall I? Keats |
From: <jim...@ag...> - 2003-03-27 15:50:13
|
I've experienced bad bahaviour when using $Math.random(int min, int = max) to generate pseudo-random integers. It seems like it always returns min, which when looking at the code = doesn't seem very strange: public static final int random(int start, int end) { return start + (int) (end *java.lang.Math.random()/(Integer.MAX_VALUE+1.0)); } Since java.lang.Math.random() returns a value between 0 and 1 and Integer.MAX_VALUE =3D 2^31 - 1 the division should always return almost zero, right? I may fail to understand the code, but it seems wrong to me so I = changed it to=20 public static final int random(int start, int end) { int iRet =3D start + (int) ((end - start + = 1)*java.lang.Math.random()); return iRet > end ? end : iRet; } The check shouldn't be neccesary, but better safe than sorry... :-) Any comments? ------------------------------------------------ Jimmy M=E4kel=E4 Programmerare Agent25 Sverige AB Slottsbacken 6 111 30 Stockholm Direkt: 08-534 80 423 Mobil: 073-623 05 51 ------------------------------------------------ Jag tycker att du borde anlita en agent. G=E5 till: www.agent25.se |
From: Marc P. <ma...@an...> - 2003-03-27 02:28:55
|
On Wed, 26 Mar 2003 16:36:14 -0800, Brian Goetz <br...@qu...> wrote: > I added constructors for WM(Properties) and WM(Servlet, Properties). If > someone could check over the changes to make sure I didn't break > anything, that would be helpful. Great Brian! Many thanks... I will get the latest CVS snapshot in the morning. Been toiling away with the webapp some more... testing the framework. I have implemented a basic "clickthrough" counter action, and as a result added a new feature to the framework - plugins (and hence actions) can introduce new helper objects that will be supplied to ALL template pages, not just those that the plugin or action is executed. This means, for example, that the click-through action can make the current stats available to all templates :-) It's been a hairy ride though this one - lots of coding and "discovery" :-) Well, I had to do something while I waited for the servlet/properties/broker "patch" ! -- Marc Palmer |
From: Lane S. <la...@op...> - 2003-03-27 01:08:34
|
I am a little slammed just at the moment. it sounded to me like the instance partitioning of the broker based on different combos of a Servlet and Properties instance was pretty straightforward. if the servlet is reloaded by the container, do you create a new broker and dereference the prior servlet's broker allowing a gc of all its assets? -Lane Brian Goetz wrote: > I added constructors for WM(Properties) and WM(Servlet, Properties). > If someone could check over the changes to make sure I didn't break > anything, that would be helpful. > > -- > Brian Goetz > Quiotix Corporation > br...@qu... Tel: 650-843-1300 Fax: > 650-324-8032 > > http://www.quiotix.com > > > > > ------------------------------------------------------- > This SF.net email is sponsored by: > The Definitive IT and Networking Event. Be There! > NetWorld+Interop Las Vegas 2003 -- Register today! > http://ads.sourceforge.net/cgi-bin/redirect.pl?keyn0001en > _______________________________________________ > Webmacro-devel mailing list > Web...@li... > https://lists.sourceforge.net/lists/listinfo/webmacro-devel > -- Lane Sharman Learn About Conga, All Java GUI Builder: http://opendoors.com/conga Java Software Portal: http://opendoors.com |
From: Brian G. <br...@qu...> - 2003-03-27 00:36:27
|
I added constructors for WM(Properties) and WM(Servlet, Properties). If someone could check over the changes to make sure I didn't break anything, that would be helpful. -- Brian Goetz Quiotix Corporation br...@qu... Tel: 650-843-1300 Fax: 650-324-8032 http://www.quiotix.com |
From: Lane S. <la...@op...> - 2003-03-26 23:56:21
|
I've followed the thread and it seems Brian that your refactoring approach would help Marc. +1 from me. -Lane Brian Goetz wrote: > >>> Remind me again -- what is the short-term goal you're looking for? >>> new WM(Servlet, config-resource-name)? >> >> >> Yes sort of... but ideally: >> >> new WM( Servlet / ServletContext, Properties settings) > > > OK, this is actually pretty easy now that we can rely on > Properties.equals() and Properties.hashCode() to do the right thing. > It involves: > > - new ctors to Servlet20Broker/Servlet22Broker to include the > Properties in the settings-load path; > - a new getBroker(Servlet, Properties) in ServletBroker; > - a new ctor in WM() > > I think these can be done without too much bother. > > I also would like to remove the reference counting on the broker. > Garbage collection should take care of it. Any simplifications we can > make here are good... > > Any objections? > > > -- > Brian Goetz > Quiotix Corporation > br...@qu... Tel: 650-843-1300 Fax: > 650-324-8032 > > http://www.quiotix.com > > > > > ------------------------------------------------------- > This SF.net email is sponsored by: > The Definitive IT and Networking Event. Be There! > NetWorld+Interop Las Vegas 2003 -- Register today! > http://ads.sourceforge.net/cgi-bin/redirect.pl?keyn0001en > _______________________________________________ > Webmacro-devel mailing list > Web...@li... > https://lists.sourceforge.net/lists/listinfo/webmacro-devel > -- Lane Sharman Learn About Conga, All Java GUI Builder: http://opendoors.com/conga Java Software Portal: http://opendoors.com |
From: Brian G. <br...@qu...> - 2003-03-26 22:57:40
|
>>Remind me again -- what is the short-term goal you're looking for? >>new WM(Servlet, config-resource-name)? > >Yes sort of... but ideally: > >new WM( Servlet / ServletContext, Properties settings) OK, this is actually pretty easy now that we can rely on Properties.equals() and Properties.hashCode() to do the right thing. It involves: - new ctors to Servlet20Broker/Servlet22Broker to include the Properties in the settings-load path; - a new getBroker(Servlet, Properties) in ServletBroker; - a new ctor in WM() I think these can be done without too much bother. I also would like to remove the reference counting on the broker. Garbage collection should take care of it. Any simplifications we can make here are good... Any objections? -- Brian Goetz Quiotix Corporation br...@qu... Tel: 650-843-1300 Fax: 650-324-8032 http://www.quiotix.com |
From: Marc P. <ma...@an...> - 2003-03-26 21:49:20
|
On Wed, 26 Mar 2003 13:38:28 -0800, Brian Goetz <br...@qu...> wrote: > Here's the problem with Properties -- we want to have this > one-size-fits-all, lazy initialization idiom. Its easy to tell when > two servlets refer to the same servlet context. Its easy to tell when > two file names are the same. It wasn't at the time easy to tell that > two Properties are actually the same set (now that Hashtable and > HashMap have been merged, Hashtable follows the equals/hashCode > requirements of Map.) (And its still not all that lightweight.) > > But given that Properties now is Map-compliant, adding WM(Properties) > and WM(Servlet, Properties) isn't that hard. I'll do this. That would be great if you could... but in terms of getting a unique broker instance per Servlet + Properties combination, that's going to be a bit more tricky isn't it? You'll have to wrap the ServletContext + Properties in a new object to use as a key for findBroker, and implement hashcode and equals, right? -- Marc Palmer |
From: Brian G. <br...@qu...> - 2003-03-26 21:38:45
|
> new WM( Servlet / ServletContext, Properties settings) > > AFAICS ServletContext is the only info needed, so I think we should only > pass SC in not the servlet - a detail however. Passing in the Properties is > really just a degenerate case of passing in the config resource name - both > should be supported IMO. Here's the problem with Properties -- we want to have this one-size-fits-all, lazy initialization idiom. Its easy to tell when two servlets refer to the same servlet context. Its easy to tell when two file names are the same. It wasn't at the time easy to tell that two Properties are actually the same set (now that Hashtable and HashMap have been merged, Hashtable follows the equals/hashCode requirements of Map.) (And its still not all that lightweight.) But given that Properties now is Map-compliant, adding WM(Properties) and WM(Servlet, Properties) isn't that hard. I'll do this. |
From: Brian G. <br...@qu...> - 2003-03-26 21:26:37
|
> Well don't beat yourself up - I dread to think what it was like before :) Heh, come out for a beer sometime and I'll tell you stories... > OK I see that. Though I have never thought of using WM like that, since > webapps came along. This happens a lot. > > Any site that deploys more than one WM-based web-app in a servlet > > container. > > ...but only if they use a shared WM in the container /lib right? If WM's > jar is in each webapp's own /lib then they will all be on separate > classloaders and there will be no crosstalk between webapps and their WM > settings/brokers. Right, but its a robustness thing. What if someone tried to be clever and put it in the container /lib (or some site-wide .rc script puts it in the class path). Then the second web-app to be deployed would break. It seems pretty bad if WM apps started failing if someone tried to put it in the site-wide lib (and, there have been cases where I've been forced to do so, for classloader reasons I don't fully understand.) > OK... I see this I think, though it sounds a lot more work than the > proposal I have made to augment the current system... I think it can be done in stages, so that you solve your current problem without doing all the work now and without taking the WM interface further in the direction its going in now. |
From: Marc P. <ma...@an...> - 2003-03-26 21:18:03
|
On Wed, 26 Mar 2003 12:57:37 -0800, Brian Goetz <br...@qu...> wrote: > Actually, it was a sequence of decision. The ones I made were > attempts to clean up the refuse of those made before me... :) > Obviously I was only partially successful. Well don't beat yourself up - I dread to think what it was like before :) [snip] > In a servlet container with multiple web apps, there WILL be multiple > sets of WM configurations, as configuration can be loaded from the web > app or from the deployment descriptor. So yes, you need to support > partitions if you want to put the WM.jar in the container-wide > classpath. OK I see that. Though I have never thought of using WM like that, since webapps came along. >> How many apps create multiple WM instances that exactly the same broker? > > Any site that deploys more than one WM-based web-app in a servlet > container. ...but only if they use a shared WM in the container /lib right? If WM's jar is in each webapp's own /lib then they will all be on separate classloaders and there will be no crosstalk between webapps and their WM settings/brokers. >> I would have made it so that everything uses its own new broker by >> default, and only uses a "shared" broker if it is explicitly passed >> to the WM constructor. i.e. >> >> Broker mySharedBroker = Broker.findBroker( mySharedKey); >> WM wm = new WM(mySharedBroker); >> >> ...rather than having using this hidden "sharing" mechanism. > > What I want is to say: > > WM wm = getWM(Servlet) > or > WM wm = getWM(config-file) > > There can be an explicit sharing mechanism if you want to roll your own, > say a WM tht gets its config from a Properties. OK. >> Hmm... how about a new ctor for WM that takes an Object that is the >> WM/broker partition "key". I think this can be done quite easily by >> passing this key to the static getBroker methods on Broker and >> ServletBroker (and 22 and 20 Broker). > > This is part of it. > >> FWIW I have always cursed the fact that WM could not init from a >> Properties object! > > Me too. You'd need an explicit naming/sharing mechanism for this. > > Here's what I want to see: > > - create an abstraction called "WMInstance". It will export some, but > not > all, of the Broker interface. - make a sharing repository that lets you > find WM instances. - make factory methods that replace the functionality > of new WM(Servlet) > and friends. > - make the new WM() constructors work with that, but mark them clearly as > convenience wrappers only. > > Then, behind the scenes, we can break up Broker. OK... I see this I think, though it sounds a lot more work than the proposal I have made to augment the current system... -- Marc Palmer |
From: Brian G. <br...@qu...> - 2003-03-26 20:57:54
|
> Argh! I just looked at the source and you are right... bah this is why I > hate singleton-like behaviour (vis a conversation I recently had with > Lane!). > > I don't understand what design decision led to this system of "caching" > brokers. Actually, it was a sequence of decision. The ones I made were attempts to clean up the refuse of those made before me... :) Obviously I was only partially successful. > I'm sure there's genius hidden in there somewhere, but this > concept of "WM partitions" and one broker per partition (just gleaned from > the Javadocs) seems very strange to me. The problem is in large part class naming. The key concept is that of a "WM Instance", or "partition" as it was called earlier. An instance is defined by its configuration. Its configuration is determined by where it gets its configuration information from (file, servlet, etc). All of these are encapsulated a Broker object once all this goo is loaded. The WM object is just a thin facade onto the Broker (think, 'instance') so you can say "new WM()" and have it be lightweight. (I don't like this either!) In a servlet container with multiple web apps, there WILL be multiple sets of WM configurations, as configuration can be loaded from the web app or from the deployment descriptor. So yes, you need to support partitions if you want to put the WM.jar in the container-wide classpath. > How many apps create multiple WM instances that exactly the same broker? Any site that deploys more than one WM-based web-app in a servlet container. > I would have made it so that everything uses its own new broker by > default, and only uses a "shared" broker if it is explicitly passed > to the WM constructor. i.e. > > Broker mySharedBroker = Broker.findBroker( mySharedKey); > WM wm = new WM(mySharedBroker); > > ...rather than having using this hidden "sharing" mechanism. What I want is to say: WM wm = getWM(Servlet) or WM wm = getWM(config-file) There can be an explicit sharing mechanism if you want to roll your own, say a WM tht gets its config from a Properties. > Hmm... how about a new ctor for WM that takes an Object that is the > WM/broker partition "key". I think this can be done quite easily by > passing this key to the static getBroker methods on Broker and > ServletBroker (and 22 and 20 Broker). This is part of it. > FWIW I have always cursed the fact that WM could not init from a Properties > object! Me too. You'd need an explicit naming/sharing mechanism for this. Here's what I want to see: - create an abstraction called "WMInstance". It will export some, but not all, of the Broker interface. - make a sharing repository that lets you find WM instances. - make factory methods that replace the functionality of new WM(Servlet) and friends. - make the new WM() constructors work with that, but mark them clearly as convenience wrappers only. Then, behind the scenes, we can break up Broker. |
From: Marc P. <ma...@an...> - 2003-03-26 20:46:43
|
On Wed, 26 Mar 2003 15:25:46 -0500, <kea...@na...> wrote: > I think it would be great to add this Constructor, but it's a bit more > complicated. The args to the WM constructor are used to determine the > Broker instance. Currently the key used to retreive the Broker for a > Servlet is just the ServletContext. Since the broker manages the > settings, > you would want a separate broker instance for each > ServletContext/Settings > combination AFAICT. Argh! I just looked at the source and you are right... bah this is why I hate singleton-like behaviour (vis a conversation I recently had with Lane!). I don't understand what design decision led to this system of "caching" brokers. I'm sure there's genius hidden in there somewhere, but this concept of "WM partitions" and one broker per partition (just gleaned from the Javadocs) seems very strange to me. How many apps create multiple WM instances that exactly the same broker? I would have made it so that everything uses its own new broker by default, and only uses a "shared" broker if it is explicitly passed to the WM constructor. i.e. Broker mySharedBroker = Broker.findBroker( mySharedKey); WM wm = new WM(mySharedBroker); ...rather than having using this hidden "sharing" mechanism. $0.02 - and I know it's easy to say this with hindsight. > The best approach may be to implement a new Broker class that the new WM > constructor would use. Then the new Broker could handle the various > kinds > of settings that you want to throw at it transparently. Hmm... how about a new ctor for WM that takes an Object that is the WM/broker partition "key". I think this can be done quite easily by passing this key to the static getBroker methods on Broker and ServletBroker (and 22 and 20 Broker). Have a quick look at the code with this in mind. What do you think? It shouldn't need much in the way of changes: a few new ctors for WM, and add an "Object" parameter to the static getBroker calls, and change it to use that param in the findBroker call. Existing static getBroker methods would be adjusted to call the new form of it, passing their current "key" (i.e. ServletContext) as the key parameter. Thus, nothing should break. Perhaps my understanding of the broker "caching" mechanism is oversimplified? > btw, this seems like a lot of extra complexity in order to accommodate > this > particular functionality. I'm guessing that the idea here is that this > would require less system resources than lots of separate Web apps. > Perhaps > this should be a post 1.0 enhancement? Just a thought. (I like to > follow > the XP model of building the simplest solution first and then > refactoring.) I appreciate this, but I think it's a very fundamental feature of this. Plus, it is already implemented. The only problem is getting each new WM instance to read the right settings. Once I have cracked that, it's done. FWIW I have always cursed the fact that WM could not init from a Properties object! Marc |
From: Brian G. <br...@qu...> - 2003-03-26 20:44:17
|
> I think it would be great to add this Constructor, but it's a bit more > complicated. The args to the WM constructor are used to determine the > Broker instance. Currently the key used to retreive the Broker for a > Servlet is just the ServletContext. Since the broker manages the settings, > you would want a separate broker instance for each ServletContext/Settings > combination AFAICT. > > The best approach may be to implement a new Broker class that the new WM > constructor would use. Then the new Broker could handle the various kinds > of settings that you want to throw at it transparently. > > btw, this seems like a lot of extra complexity in order to accommodate this > particular functionality. I'm guessing that the idea here is that this > would require less system resources than lots of separate Web apps. Perhaps > this should be a post 1.0 enhancement? Just a thought. (I like to follow > the XP model of building the simplest solution first and then refactoring.) It makes sense, but could be messy. Eric and I (motivated by suggestions from Marc) have discussed what we think is the sensible refactoring here -- create an entity called WMInstance. This is the missing concept, and what complicates the various construction woes. A big part of the problem is that the WM object is a thin facade onto the broker. Better would be to have factory methods for locating WM instances -- getWM(config-file), getWM(Servlet), etc. They would either find the right instance or create a new one. Then, if you wanted to manage instances yourself, you could do so. An instance would "own" a broker, its settings, etc. The other part of the problem is just that the names for the major classes, like Broker, are inappropriately chosen, which is confusing. |
From: Marc P. <ma...@an...> - 2003-03-26 20:32:11
|
On Wed, 26 Mar 2003 14:59:07 -0500, Eric B. Ridge <eb...@tc...> wrote: > Actually, Brian and I have chatted about this off-list before. We > thought it was a good thing to do, but neither of us got around to doing > it. > > If you need it now, I say go for it. I do need it. I just don't have all the in-depth WM knowledge yet to do it. I'll see how it goes! -- Marc Palmer |
From: <kea...@na...> - 2003-03-26 20:25:59
|
I think it would be great to add this Constructor, but it's a bit more complicated. The args to the WM constructor are used to determine the Broker instance. Currently the key used to retreive the Broker for a Servlet is just the ServletContext. Since the broker manages the settings, you would want a separate broker instance for each ServletContext/Settings combination AFAICT. The best approach may be to implement a new Broker class that the new WM constructor would use. Then the new Broker could handle the various kinds of settings that you want to throw at it transparently. btw, this seems like a lot of extra complexity in order to accommodate this particular functionality. I'm guessing that the idea here is that this would require less system resources than lots of separate Web apps. Perhaps this should be a post 1.0 enhancement? Just a thought. (I like to follow the XP model of building the simplest solution first and then refactoring.) Keats > -----Original Message----- > From: Marc Palmer [mailto:ma...@an...] > Sent: Wednesday, March 26, 2003 2:49 PM > To: web...@li... > Subject: [Webmacro-devel] The webapp: I need help with WM > config hassles > > > > Hi all, > > I'm trying to create instances of WM at runtime based on the > "modules" a > user has configured in this webapp I'm writing. Basically > each "module" has > its own properties file with settings for the webapp, but > also they can > supply WebMacro properties that would normally be in > WebMacro.properties. > > The problem is that I need to load templates from the webapp > context, but > if I use the WM(Servlet) constructor I cannot force it to use > a specific > .properties file for the settings. > > If I don't use the WM(Servlet) constructor, things won't work > obviously. > I'm using the delegating template provider and need to use > webapp:/WEB- > INF/templates (for example) as a path. > > I think I would need to introduce a new ctor for WM - > WM(Servlet, String > configFile). What do you think? > > Following on from this, I actually want my webapp to > predetermine some of > the settings, without them existing in a file. For example I > want to set > the template provider to the delegating template provider, > and set the > default template path to webapp:/WEB-INF/templates and > webapp:/templates > and webapp:/ - and still allow the module writer to override > this with new > settings in their module properties file. > > To do this programmatically I would plan to create a > Properties object and > set my template path properties on it. Then I would create another > Properties and set the first Properties I created as its > "ancestor" in the > constructor - and then load the module's specific properties into it. > > THEN I would pass that Properties to the constructor of WM... which I > can't. Is there any reason anyone can see why I can't just > add a ctor to WM > that takes a Properties object instead of the filename? Of > coure I'd have > to add WM(Servlet, Properties) too. > > Thoughts? > > Marc > |