Re: [Lift] The role of LiftRules

2010-03-03 Thread Naftoli Gugenheim
When are the implicits on a companion object invoked without needing to be imported? - Jeppe Nejsum Madsen wrote: Naftoli Gugenheim writes: > Would it be a bad idea to use java.util.Date for now, and if and when support > is added for JodaTime, change it to

Re: [Lift] The role of LiftRules

2010-03-03 Thread Naftoli Gugenheim
See David's last post on this thread, and the updated diff on RB. - Jeppe Nejsum Madsen wrote: Naftoli Gugenheim writes: > Would it be a bad idea to use java.util.Date for now, and if and when support > is added for JodaTime, change it to a DateHolder (which

Re: [Lift] The role of LiftRules

2010-03-02 Thread Jeppe Nejsum Madsen
Naftoli Gugenheim writes: > Would it be a bad idea to use java.util.Date for now, and if and when support > is added for JodaTime, change it to a DateHolder (which would be added then)? Haven't looked in detail, but wouldn't this require two changes to client code? 1) One to use the new Conver

Re: [Lift] The role of LiftRules

2010-03-02 Thread Naftoli Gugenheim
Would it be a bad idea to use java.util.Date for now, and if and when support is added for JodaTime, change it to a DateHolder (which would be added then)? - David Pollak wrote: A ConversionRules singleton is the wrong concept. What you want is: case class D

Re: [Lift] The role of LiftRules

2010-02-26 Thread Naftoli Gugenheim
Sounds good! - David Pollak wrote: A ConversionRules singleton is the wrong concept. What you want is: case class DateHolder(date: JodaTime) { implicit def asJt: JodaTime = date implicit def asJavaDate: java.util.Date = // convert to Java date here } obj

Re: [Lift] The role of LiftRules

2010-02-26 Thread David Pollak
A ConversionRules singleton is the wrong concept. What you want is: case class DateHolder(date: JodaTime) { implicit def asJt: JodaTime = date implicit def asJavaDate: java.util.Date = // convert to Java date here } object DateHolder { implicit def dateToDH(in: java.util.Date): DateHolder

Re: [Lift] The role of LiftRules

2010-02-26 Thread Naftoli Gugenheim
Oh, right--I forgot about per-session and request. So what do you vote on this, then: A. ConversionRules is its own singleton, but as a bonus it can also be accessed from LiftRules. B. Same as A but ConversionRules is private[liftweb], so there's only one path. C. Less redundant: define (a renamed

Re: [Lift] The role of LiftRules

2010-02-26 Thread David Pollak
The basic DI (the stuff Factory/FactoryMaker are built on) are located in util: see Maker.scala The Factory stuff is in webkit because it relies on session and request state. You can change the rules for vending something on a session-by-session and request-by-request basis. LiftRules is the sin

Re: [Lift] The role of LiftRules

2010-02-25 Thread Ross Mellgren
We were talking in another thread about having something kind of similar to this where the configuration is held in lift-util (maybe lift-common) but it is accessible through LiftRules. I think it could be a good idea to do this for this as well, to help guide people to the right place for this

[Lift] The role of LiftRules

2010-02-25 Thread Naftoli Gugenheim
Hi, I'd like to get some opinions on the following. You may want to read http://reviewboard.liftweb.net/r/158/. I have on Review Board a patch for some date-and-time parsing and formatting configuration. I put the settings inside a singleton object called ConversionRules. The question is, where do