Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
Message from discussion Enhanced stateless support in 2.4-master

Received: by 10.52.117.164 with SMTP id kf4mr59535vdb.24.1314632942808;
        Mon, 29 Aug 2011 08:49:02 -0700 (PDT)
X-BeenThere: liftweb@googlegroups.com
Received: by 10.220.149.206 with SMTP id u14ls170114vcv.4.canary; Mon, 29 Aug
 2011 08:48:58 -0700 (PDT)
Received: by 10.236.177.73 with SMTP id c49mr17822576yhm.0.1314632938418;
        Mon, 29 Aug 2011 08:48:58 -0700 (PDT)
Received: by 10.236.177.73 with SMTP id c49mr17822575yhm.0.1314632938399;
        Mon, 29 Aug 2011 08:48:58 -0700 (PDT)
Return-Path: <feeder.of.the.be...@gmail.com>
Received: from mail-yi0-f47.google.com (mail-yi0-f47.google.com [209.85.218.47])
        by gmr-mx.google.com with ESMTPS id i9si2845438yhe.7.2011.08.29.08.48.58
        (version=TLSv1/SSLv3 cipher=OTHER);
        Mon, 29 Aug 2011 08:48:58 -0700 (PDT)
Received-SPF: pass (google.com: domain of feeder.of.the.be...@gmail.com designates 209.85.218.47 as permitted sender) client-ip=209.85.218.47;
Authentication-Results: gmr-mx.google.com; spf=pass (google.com: domain of feeder.of.the.be...@gmail.com designates 209.85.218.47 as permitted sender) smtp.mail=feeder.of.the.be...@gmail.com; dkim=pass (test mode) header...@gmail.com
Received: by mail-yi0-f47.google.com with SMTP id 28so3302368yia.6
        for <liftweb@googlegroups.com>; Mon, 29 Aug 2011 08:48:58 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=gamma;
        h=mime-version:in-reply-to:references:date:message-id:subject:from:to
         :content-type;
        bh=PBPY8aS5wGSimbPEYRDDkjCBeW3IRx00ByeyU0mTafw=;
        b=NcOwVB00DeIEmCT0daa/az6ppE9G+7vfamH7kVo7HwE3Xl3PF8GpR7XzfdsKyxyxRj
         2TiOcHnIiDcdLnvZSYGCSzhvjYz5wf4sOwVser2ClzJ8YCIBDJoKJQ7fX9QSDWa3TR3u
         S55pXjkWoOt75OqofUN5AzDXThREuRzbJqwiY=
MIME-Version: 1.0
Received: by 10.236.72.233 with SMTP id t69mr25735962yhd.55.1314632938129;
 Mon, 29 Aug 2011 08:48:58 -0700 (PDT)
Received: by 10.146.246.6 with HTTP; Mon, 29 Aug 2011 08:48:58 -0700 (PDT)
In-Reply-To: <CANpg8PDFiEkSWaVNh6ZRLHYqxSWpL-_NFSXLBpT3V+zrRcRtbA@mail.gmail.com>
References: <CAH6e9LiDJe3uJburq6uaRGacB-vKw7dvq8s5S8O0C3zUXv8...@mail.gmail.com>
	<CANpg8PA6D7PXG362CHwOn5nAnoDon__c1mgQZWTGCvKoDwv...@mail.gmail.com>
	<CAH6e9LjpHnht4ccBT32cFu8hStUKz7kSUtGD1FXUXocPJtF...@mail.gmail.com>
	<CANpg8PCc-NZJw8nyrtFnE7ss5Te=prEeNNnTDz88tWLM7Ow...@mail.gmail.com>
	<CAH6e9LgQBaUhjetnxLVS=St8YmZJ-RuXca=fonY-h3yDH7a...@mail.gmail.com>
	<CANpg8PBUrk64t-GZ46by0yo0ZppF1bHiBeH+dteH=t1_ptS...@mail.gmail.com>
	<CAH6e9LhqonzaffT+6jL7TJW4W46pnn0FC2V8UZnYJK-At=h...@mail.gmail.com>
	<CANpg8PDFiEkSWaVNh6ZRLHYqxSWpL-_NFSXLBpT3V+zrRcR...@mail.gmail.com>
Date: Mon, 29 Aug 2011 08:48:58 -0700
Message-ID: <CAH6e9Lh1nbng_1dOy8xXUPfeai5U3b=ov-_A30wVf2svqti...@mail.gmail.com>
Subject: Re: [Lift] Enhanced stateless support in 2.4-master
From: David Pollak <feeder.of.the.be...@gmail.com>
To: liftweb@googlegroups.com
Content-Type: multipart/alternative; boundary=20cf30050e70498a6d04aba6d502

--20cf30050e70498a6d04aba6d502
Content-Type: text/plain; charset=UTF-8

On Sun, Aug 28, 2011 at 8:26 PM, Naftoli Gugenheim <naftoli...@gmail.com>wrote:

> Thoughts?
>
>
I'm not keen on StatelessDispatch... because it's a behavior only in
stateless mode.  I think it would be confusing to people who would see it as
a stateless counterpart to StatefulSnippets.  Sorry... I guess I'm a better
critic than I am a doer.  What do others think?  If I'm the only one seeing
a likelihood of confusions, let's go with it.  If there are a couple of
other folks who see a likelihood of confusions, let's try a different name
(not necessarily StatelessBehavior.)


> diff --git
> a/web/webkit/src/main/scala/net/liftweb/http/StatefulSnippet.scala
> b/web/webkit/src/main/scala/net/liftweb/http/StatefulSnippet.scala
> index 3d533e4..468cba2 100644
> --- a/web/webkit/src/main/scala/net/liftweb/http/StatefulSnippet.scala
> +++ b/web/webkit/src/main/scala/net/liftweb/http/StatefulSnippet.scala
> @@ -173,29 +173,29 @@ trait DispatchSnippet {
>  * the snippet (usually render, but there may be others if you specify a
> method
>  * after the snippet name: MySnippet.dothing).
>  */
> trait [-StatelessBehavior-]{+*StatelessDispatch*+} {
>   /**
>    * Given the method name, return the transformation for the method
>    */
>   def [-behaviorDispatch:-]{+*statelessDispatch*:+}
> PartialFunction[String, NodeSeq => NodeSeq]
> }
>
> /**
>  * A simpler way to define behavior if the snippet is invoked.  Just
> implement the behavior() method
>  * and all methods for the snippet will use that behavior.
>  */
> trait [-DefaultStatelessBehavior-]{+*SimpleStatelessDispatch*+} extends
> [-StatelessBehavior-]{+*StatelessDispatch*+} {
>   def [-behavior():-]{+*stateless*:+} NodeSeq => NodeSeq
>   def [-behaviorDispatch:-]{+*statelessDispatch*:+}
> PartialFunction[String, NodeSeq => NodeSeq] = {
>     case _ => [-behavior()-]{+*stateless*+}
>   }
> }
>
> /**
>  * A "default" implementation of
> [-StatelessBehavior.-]{+StatelessDispatch.+}  Just ignore everything and
> return a zero-length Text.
>  */
> trait [-BlankStatelessBehavior-]{+*BlankStatelessDispatch*+} extends
> [-StatelessBehavior-]{+*StatelessDispatch*+} {
>   def [-behaviorDispatch:-]{+*statelessDispatch*:+}
> PartialFunction[String, NodeSeq => NodeSeq] = {
>     case _ => [-ignore-]{+_+} => NodeSeq.Empty
>   }
>
>  --
> You received this message because you are subscribed to the Google Groups
> "Lift" group.
> To post to this group, send email to liftweb@googlegroups.com.
> To unsubscribe from this group, send email to
> liftweb+unsubscribe@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/liftweb?hl=en.
>



-- 
Lift, the simply functional web framework http://liftweb.net
Simply Lift http://simply.liftweb.net
Follow me: http://twitter.com/dpp
Blog: http://goodstuff.im

--20cf30050e70498a6d04aba6d502
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

<br><br><div class=3D"gmail_quote">On Sun, Aug 28, 2011 at 8:26 PM, Naftoli=
 Gugenheim <span dir=3D"ltr">&lt;<a href=3D"mailto:naftoli...@gmail.com">na=
ftoli...@gmail.com</a>&gt;</span> wrote:<br><blockquote class=3D"gmail_quot=
e" style=3D"margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;"=
>
<div dir=3D"ltr">Thoughts?<div><br></div></div></blockquote><div><br>I&#39;=
m not keen on StatelessDispatch... because it&#39;s a behavior only in stat=
eless mode.=C2=A0 I think it would be confusing to people who would see it =
as a stateless counterpart to StatefulSnippets.=C2=A0 Sorry... I guess I&#3=
9;m a better critic than I am a doer.=C2=A0 What do others think?=C2=A0 If =
I&#39;m the only one seeing a likelihood of confusions, let&#39;s go with i=
t.=C2=A0 If there are a couple of other folks who see a likelihood of confu=
sions, let&#39;s try a different name (not necessarily StatelessBehavior.)<=
br>
=C2=A0</div><blockquote class=3D"gmail_quote" style=3D"margin: 0pt 0pt 0pt =
0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;"><div =
dir=3D"ltr"><div></div><div><div><div>diff --git a/web/webkit/src/main/scal=
a/net/liftweb/http/StatefulSnippet.scala b/web/webkit/src/main/scala/net/li=
ftweb/http/StatefulSnippet.scala</div>
<div>index 3d533e4..468cba2 100644</div>
<div>--- a/web/webkit/src/main/scala/net/liftweb/http/StatefulSnippet.scala=
</div><div>+++ b/web/webkit/src/main/scala/net/liftweb/http/StatefulSnippet=
.scala</div><div>@@ -173,29 +173,29 @@ trait DispatchSnippet {</div><div cl=
ass=3D"im">
<div>
=C2=A0* the snippet (usually render, but there may be others if you specify=
 a method</div><div>=C2=A0* after the snippet name: MySnippet.dothing).</di=
v><div>=C2=A0*/</div></div><div>trait [-StatelessBehavior-]{+<b>StatelessDi=
spatch</b>+} {</div>
<div class=3D"im">
<div>=C2=A0 /**</div><div>=C2=A0 =C2=A0* Given the method name, return the =
transformation for the method</div><div>=C2=A0 =C2=A0*/</div></div><div>=C2=
=A0 def [-behaviorDispatch:-]{+<b>statelessDispatch</b>:+} PartialFunction[=
String, NodeSeq =3D&gt; NodeSeq]</div>
<div class=3D"im">
<div>}</div><div><br></div><div>/**</div><div>=C2=A0* A simpler way to defi=
ne behavior if the snippet is invoked. =C2=A0Just implement the behavior() =
method</div><div>=C2=A0* and all methods for the snippet will use that beha=
vior.</div>

<div>=C2=A0*/</div></div><div>trait [-DefaultStatelessBehavior-]{+<b>Simple=
StatelessDispatch</b>+} extends [-StatelessBehavior-]{+<b>StatelessDispatch=
</b>+} {</div><div>=C2=A0 def [-behavior():-]{+<b>stateless</b>:+} NodeSeq =
=3D&gt; NodeSeq</div>

<div>=C2=A0 def [-behaviorDispatch:-]{+<b>statelessDispatch</b>:+} PartialF=
unction[String, NodeSeq =3D&gt; NodeSeq] =3D {</div><div>=C2=A0 =C2=A0 case=
 _ =3D&gt; [-behavior()-]{+<b>stateless</b>+}</div><div>=C2=A0 }</div><div>=
}</div><div><br></div>

<div>/**</div><div>=C2=A0* A &quot;default&quot; implementation of [-Statel=
essBehavior.-]{+StatelessDispatch.+} =C2=A0Just ignore everything and retur=
n a zero-length Text.</div><div>=C2=A0*/</div><div>trait [-BlankStatelessBe=
havior-]{+<b>BlankStatelessDispatch</b>+} extends [-StatelessBehavior-]{+<b=
>StatelessDispatch</b>+} {</div>

<div>=C2=A0 def [-behaviorDispatch:-]{+<b>statelessDispatch</b>:+} PartialF=
unction[String, NodeSeq =3D&gt; NodeSeq] =3D {</div><div>=C2=A0 =C2=A0 case=
 _ =3D&gt; [-ignore-]{+_+} =3D&gt; NodeSeq.Empty</div><div>=C2=A0 }</div></=
div></div><div><br></div>

</div><font color=3D"#888888">

<p></p>

-- <br></font><div><div></div><div class=3D"h5">
You received this message because you are subscribed to the Google Groups &=
quot;Lift&quot; group.<br>
To post to this group, send email to <a href=3D"mailto:liftweb@googlegroups=
.com" target=3D"_blank">liftweb@googlegroups.com</a>.<br>
To unsubscribe from this group, send email to <a href=3D"mailto:liftweb%2Bu=
nsubscribe@googlegroups.com" target=3D"_blank">liftweb+unsubscribe@googlegr=
oups.com</a>.<br>

For more options, visit this group at <a href=3D"http://groups.google.com/g=
roup/liftweb?hl=3Den" target=3D"_blank">http://groups.google.com/group/lift=
web?hl=3Den</a>.<br>


</div></div></blockquote></div><br><br clear=3D"all"><br>-- <br>Lift, the s=
imply functional web framework <a href=3D"http://liftweb.net" target=3D"_bl=
ank">http://liftweb.net</a><div>Simply Lift <a href=3D"http://simply.liftwe=
b.net" target=3D"_blank">http://simply.liftweb.net</a><br>
Follow me: <a href=3D"http://twitter.com/dpp" target=3D"_blank">http://twit=
ter.com/dpp</a><br>Blog: <a href=3D"http://goodstuff.im" target=3D"_blank">=
http://goodstuff.im</a><br></div><br>

--20cf30050e70498a6d04aba6d502--