|
From: Keith D. <ke...@in...> - 2005-06-17 20:12:58
|
We're missing a convenience method to call from styling code. e.g ToStringStyler.style(value); Doing this: ToStringStyler.DEFAULT_VALUE_STYLER.style(value) is a bit lengthy :-) How about StylerUtils.style(value)? Keith -----Original Message----- From: spr...@li... [mailto:spr...@li...] On Behalf Of Juergen Hoeller Sent: Friday, June 17, 2005 5:30 AM To: spr...@li... Subject: Re: [Springframework-developer] enums, styler, comparator I share that view. Making the styling strategies pluggable is nice for ToStringCreator itself (for creating a custom instance of it through the overloaded constructor), but I doubt that anyone will want to change the global default styling strategies. I've already added a public static DEFAULT_VALUE_STYLER field to ToStringCreator, exposing the default ValueStyler alongside the default ToStringStyler. I've also added a further convenience constructor to ToStringCreator, allowing to specify a specific ValueStyler to use (instead of specifying the entire ToStringStyler). So we have shared default instances now, plus the option to specify custom instances on ToStringCreator or on direct ValueStyler use. The only thing missing is overriding the global default stylers, which I consider acceptable. I don't want people to be able to override static global instances - at any time - in the first place. Juergen -----Original Message----- From: spr...@li... [mailto:spr...@li...]On Behalf Of Erwin Vervaet Sent: Friday, June 17, 2005 9:19 AM To: spr...@li... Subject: Re: [Springframework-developer] enums, styler, comparator > Creating objects with new is arguably a bad idea here, as now I've got > that > new operator spread around everywhere with no capability to plug in custom > value styling strategies for my own types of objects, for example. Agreed, but is making the styling strategies pluggable something users would ever do in practice? Seems to be a bit of an exotic feature. > > On the other hand, with a loader to easily plug-in a custom global > implementation, users can easily switch on custom string styling > algorithms > for types they use but don't have control over without any hassle. They > simply switch it in at runtime when their application is bootstrapped. > > In any case, what's most appropriate to customize here is the ValueStyler > strategy, not the ToStringCreator strategy. It's where the magic for > pretty > printing objects of different types happen... > > Keith > > -----Original Message----- > From: Keith Donald [mailto:ke...@in...] > Sent: Thursday, June 16, 2005 6:23 PM > To: 'spr...@li...' > Subject: RE: [Springframework-developer] enums, styler, comparator > > Yeah, but injection there is not at al practical. Singleton usage for > this > kind of usage is acceptable IMO. The singleton has a default that is not > expensive to initialize (its just a POJO with no other dependencies). > Furthermore, that default is still configurable through a static load > method. I don't see the problem there. > > Now, I am up for just changing the exception messages in webflow to rely > on > the standard collections toString implementations. However I admit that > would be a bit of a step back, especially after someone just remarked in a > training how descriptive and "great looking" that one exception message > was > ;-) > > Keith > > -----Original Message----- > From: spr...@li... > [mailto:spr...@li...] On Behalf > Of > Juergen Hoeller > Sent: Thursday, June 16, 2005 2:07 PM > To: spr...@li... > Subject: Re: [Springframework-developer] enums, styler, comparator > > It's been replaced by the ValueStyler interface and DefaultValueStyler > implementation, in the "core.style" package. > > I'm currently discussing with Keith whether a ValueStyler singleton should > be re-introduced. Currently, the only singleton held is ToStringCreator's > DefaultToStringStyler, which in turn holds a DefaultValueStyler instance. > > I'd like to keep singletons as minimal as possible. There's always the > option to use "new DefaultValueStyler()" / "new DefaultToStringStyler()" > or > even receive a ValueStyler / ToStringStyler through dependency injection. > > Juergen > > > -----Original Message----- > From: spr...@li... > [mailto:spr...@li...]On Behalf > Of Colin Sampaleanu > Sent: Thursday, June 16, 2005 6:02 PM > To: spr...@li... > Subject: Re: [Springframework-developer] enums, styler, comparator > > > Juergen Hoeller wrote: > >>Everybody, >> >>Keith's LabeledEnum and ToStringCreator stuff has been moved over from the >>sandbox, to be shipped with Spring 1.2.2 (and to be used by Web Flow PR4). >> >>I've rearranged the structure and also reworked the implementations / >>interfaces quite a bit. ToStringCreator and its helpers reside in the >>"core.style" package now; LabeledEnum and LabeledEnumResolver in >>"core.enums" (without separate support subpackage; it's all in one package >>name). >> >>I've also reworked the generic comparators: they reside in > "util.comparator" >>now. The biggest change there is that there is no SortDefinition class >>anymore. Instead, an InvertibleComparator decorator takes over the same >>role. SortDefinition already was a Comparator decorator before, so was >>arguably misnamed. >> >>Keith / Erwin, could you please make sure that everything's compiling >>again >>on the Web Flow side of things. Once the Web Flow module has found its > final >>home in the CVS structure, that is ;-) >> >> > > What happened to the 'Styler' class? > > http://cvs.sourceforge.net/viewcvs.py/springframework/spring/src/org/springf > ramework/core/Attic/Styler.java?view=markup > I tried to make the SWF code compile against current Spring CVS while on > a plane ride back to Toronto yesterday, but Styler seems to be gone. So > right now the SWF code is still building against a snapshot from June > 13th. > > Colin > > > > > > > ------------------------------------------------------- > SF.Net email is sponsored by: Discover Easy Linux Migration Strategies > from IBM. Find simple to follow Roadmaps, straightforward articles, > informative Webcasts and more! Get everything you need to get up to > speed, fast. http://ads.osdn.com/?ad_id=7477&alloc_id=16492&op=click > _______________________________________________ > Springframework-developer mailing list > Spr...@li... > https://lists.sourceforge.net/lists/listinfo/springframework-developer > > > > ------------------------------------------------------- > SF.Net email is sponsored by: Discover Easy Linux Migration Strategies > from IBM. Find simple to follow Roadmaps, straightforward articles, > informative Webcasts and more! Get everything you need to get up to > speed, fast. http://ads.osdn.com/?ad_id=7477&alloc_id=16492&op=click > _______________________________________________ > Springframework-developer mailing list > Spr...@li... > https://lists.sourceforge.net/lists/listinfo/springframework-developer > > > > ------------------------------------------------------- > SF.Net email is sponsored by: Discover Easy Linux Migration Strategies > from IBM. Find simple to follow Roadmaps, straightforward articles, > informative Webcasts and more! Get everything you need to get up to > speed, fast. http://ads.osdn.com/?ad_id=7477&alloc_id=16492&op=click > _______________________________________________ > Springframework-developer mailing list > Spr...@li... > https://lists.sourceforge.net/lists/listinfo/springframework-developer > > ------------------------------------------------------- SF.Net email is sponsored by: Discover Easy Linux Migration Strategies from IBM. Find simple to follow Roadmaps, straightforward articles, informative Webcasts and more! Get everything you need to get up to speed, fast. http://ads.osdn.com/?ad_id=7477&alloc_id=16492&op=click _______________________________________________ Springframework-developer mailing list Spr...@li... https://lists.sourceforge.net/lists/listinfo/springframework-developer ------------------------------------------------------- SF.Net email is sponsored by: Discover Easy Linux Migration Strategies from IBM. Find simple to follow Roadmaps, straightforward articles, informative Webcasts and more! Get everything you need to get up to speed, fast. http://ads.osdn.com/?ad_id=7477&alloc_id=16492&op=click _______________________________________________ Springframework-developer mailing list Spr...@li... https://lists.sourceforge.net/lists/listinfo/springframework-developer |