object MyVendor {
def apply(in: Params): MyThing = (in, runMode) match {
case (p, Test) => new BusinessLogic(p) with MockStorage
case (p, Development) => new BusinessLogic(p) with H2Storage with
Debugging
case (p, Production) if Amazon.running_? => new BusinessLogic(p) with
S3Storage
case (p, Production) => new BusinessLogic(p) with PostgreSQLStorage
}
}
I'm not sure I would change how snippets are dispatched based on run mode or
other parameters. They are ostensibly business logic that is independent
from runtime constraints.
On Mon, Aug 24, 2009 at 12:49 PM, greekscala <[email protected]> wrote:
>
> Hello,
>
> ok. I know that I can compose my logic together.
> But I dont know how to configure my parts and where to do it.
>
> David says to create objects that do extend my traits?
> How do you guys do it, so that you have a seperation of
> Lift and application layer...?
>
> I am getting better :D
>
> thanks a lot
>
> On 24 Aug., 00:19, greekscala <[email protected]> wrote:
> > Hello David,
> >
> > thanks for helping.
> > Do you mean by composing my business logic with traits
> > like the example of Jonas Bonerhttp://
> jonasboner.com/2008/10/06/real-world-scala-dependency-injectio...
> > ?
> > I understand the example.
> >
> > What do you mean by objects? The object Scala keyword?
> >
> > It would be great if you can give me a little example. How to glue it
> > with a Lift Snippet.
> >
> > Thanks
> > kind regards
> >
> > On 23 Aug., 19:23, David Pollak <[email protected]> wrote:
> >
> > > On Sun, Aug 23, 2009 at 5:15 AM, greekscala <[email protected]>
> wrote:
> >
> > > > Hello Timothy,
> >
> > > > thank you.
> > > > I know that I do not need Spring for Scala.
> > > > I dont expressed it well. How do I glue my app parts
> > > > together. And how do I glue the lift part with a facade or
> > > > application service of my domain layer.
> >
> > > Use traits to describe the pieces of your business logic rather than
> > > classes. Traits can be composed very easily.
> >
> > > Don't use "new", but use object's as factories that make run-time
> decisions
> > > about how to compose traits and vend them.
> >
> > > > Thanks for your help
> >
> > > > On 23 Aug., 13:12, Timothy Perrett <[email protected]> wrote:
> > > > > Can you please be more specific about your app tier that you wish
> to
> > > > > access - im unfortunately not seeing what hurdle stops you from
> > > > > accessing it just as you would from Java?
> >
> > > > > Cheers, Tim
> >
> > > > > On Aug 22, 9:45 pm, greekscala <[email protected]> wrote:
> >
> > > > > > Hello Lift Community,
> >
> > > > > > I want to implement a new Project in Scala with Lift. I am new to
> > > > > > Scala/Lift.
> > > > > > Scala looks great and it expanded my horizon. FP is a new concept
> to
> > > > > > me.
> >
> > > > > > My background is Java and a little bit of Spring. I read three
> Scala
> > > > > > books
> > > > > > and a lot on blogs. But there is a missing part for me on how to
> > > > > > combine
> > > > > > my classes. I read the Scalable Components Paper and I dont get
> it
> > > > > > 100%.
> > > > > > I need a little bit more input on structuring a web app and I
> hope to
> > > > > > get the 100%
> > > > > > with you guys.
> > > > > > With Spring you let the container manage the classes. ok.
> > > > > > I think my problem is, I dont know how you structured a web app
> in
> > > > > > days
> > > > > > without Spring.
> >
> > > > > > I would like to have Lift access my domain logic over an
> application
> > > > > > layer (Domain
> > > > > > Driven Design).
> > > > > > In Wicket I would have my SpringBean annotation.....
> >
> > > > > > So I hope to understand, how
> > > > > > - can I access my app layer?
> > > > > > - how could I organize my domain logic. I want to use DDD. I know
> I
> > > > > > have to use
> > > > > > "object" and "class" in a bigger sense...?
> >
> > > > > > I hope you guys can give me some hints.
> >
> > > > > > Thanks a lot
> >
> > > --
> > > Lift, the simply functional web frameworkhttp://liftweb.net
> > > Beginning Scalahttp://www.apress.com/book/view/1430219890
> > > Follow me:http://twitter.com/dpp
> > > Git some:http://github.com/dpp
>
> >
>
--
Lift, the simply functional web framework http://liftweb.net
Beginning Scala http://www.apress.com/book/view/1430219890
Follow me: http://twitter.com/dpp
Git some: http://github.com/dpp
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Lift" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/liftweb?hl=en
-~----------~----~----~----~------~----~------~--~---