Lift/J Updates

30 views
Skip to first unread message

David Pollak

unread,
Feb 8, 2011, 5:38:41 PM2/8/11
to liftweb
Folks,

I've update the Seven Things/J code to get the chat example working:

https://github.com/lift/seventhings/commit/3725cd24bba7c12d72103dc075bcd49048507c00

I've added some stuff to core Lift to make it work:

https://github.com/lift/framework/commit/6bb502bf78ddde525d53d827bbda9711a7b9c18d

I renamed some of the Actor stuff so it's consistent (e.g., LiftActorJ).

I did the composition of CometActorJ, CometActorJWithCometListener, LiftActorJWithListenerManager so we can subclass those abstract classes and get the right result.

I added a mechanism for vending SessionVars so you can get SessionVars in Java.

I added java.util.List as a valid collection for the CSS Selector Transforms.

Right now, Jenkins (aka Hudson) isn't building Lift reliably, so you'll have to build Lift locally to use the new code.

Thanks,

David

PS -- Thanks to Torsten for pointing me in the right direction.  I'm hoping he'll morph the APIs to keep them sane and consistent.

PPS -- Java collections suck compared to Scala collections.  Not having immutable collections is a real bear for multithreaded code.  It makes me hope that Functional Java gets up into a Maven repo real soon.

--
Lift, the simply functional web framework http://liftweb.net
Beginning Scala http://www.apress.com/book/view/1430219890
Follow me: http://twitter.com/dpp
Blog: http://goodstuff.im
Surf the harmonics

Jamie Paulson

unread,
Feb 8, 2011, 6:44:34 PM2/8/11
to lif...@googlegroups.com


On Tue, Feb 8, 2011 at 2:38 PM, David Pollak <feeder.of...@gmail.com> wrote:


PPS -- Java collections suck compared to Scala collections.  Not having immutable collections is a real bear for multithreaded code.  It makes me hope that Functional Java gets up into a Maven repo real soon.



Could you use Collections.unmodifiable<type>() methods?

David Pollak

unread,
Feb 8, 2011, 6:48:02 PM2/8/11
to lif...@googlegroups.com

unmodifieable is the worst of all possible worlds.

scala> val l2 = new CopyOnWriteArrayList()
l2: java.util.concurrent.CopyOnWriteArrayList[Nothing] = []

scala> val l2 = new CopyOnWriteArrayList[String]()
l2: java.util.concurrent.CopyOnWriteArrayList[String] = []

scala> l2.add("Hello")
res10: Boolean = true

scala> l2.add("Hello2")
res11: Boolean = true

scala> l2
res12: java.util.concurrent.CopyOnWriteArrayList[String] = [Hello, Hello2]

scala> val l3 = Collections.unmodifiableList(l2)
l3: java.util.List[String] = [Hello, Hello2]

scala> l2.add("THree")
res13: Boolean = true

scala> l2
res14: java.util.concurrent.CopyOnWriteArrayList[String] = [Hello, Hello2, THree]

scala> l3
res15: java.util.List[String] = [Hello, Hello2, THree]


 

--
You received this message because you are subscribed to the Google Groups "Lift" group.
To post to this group, send email to lif...@googlegroups.com.
To unsubscribe from this group, send email to liftweb+u...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/liftweb?hl=en.

Jamie Paulson

unread,
Feb 8, 2011, 6:51:49 PM2/8/11
to lif...@googlegroups.com
Gah. Never used it before, but yeah, after further reading it's clearly a total horror.

drwho

unread,
Feb 9, 2011, 2:32:43 AM2/9/11
to lif...@googlegroups.com
"joke" is what i'd label that.

Christopher Taylor

unread,
Feb 9, 2011, 3:09:49 AM2/9/11
to lif...@googlegroups.com
PPS -- Java collections suck compared to Scala collections.  Not having immutable collections is a real bear for multithreaded code.  It makes me hope that Functional Java gets up into a Maven repo real soon.

I like the immutable collections provided by Google's Guava library:

List<Integer> l = ImmutableList.builder().add(1).add(2).addAll(Arrays.asList(3,4,5).build();

Regards,
  --Chris

David Pollak

unread,
Feb 9, 2011, 8:33:18 AM2/9/11
to lif...@googlegroups.com

Thanks.

I looked at the Google stuff and it suffers from a lack of ability to create a new collection from the existing ImmutableList.

I've wrapped Scala's List and Vector collections in a Java-friendly wrapper... that's good enough for now.
 

Regards,
  --Chris

--
You received this message because you are subscribed to the Google Groups "Lift" group.
To post to this group, send email to lif...@googlegroups.com.
To unsubscribe from this group, send email to liftweb+u...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/liftweb?hl=en.

AGYNAMIX Torsten Uhlmann

unread,
Feb 9, 2011, 9:28:10 AM2/9/11
to lif...@googlegroups.com
Hi all,

I added FetchAd and LongTime to the Java-nized snippets.

My experience so far:

- If you look at the Java code (Boot, ChatIn, others) in Idea 10 you see lot's of red. The parser seems to have problems with the code although it ultimately compiles.
- The class JavaActorBase is package local but should be public, otherwise the IDE complains to not know @Receive- although in the end it compiles
- The IDE only accepted reRender as super.reRender()
- The method nsToNsFuncToRenderOut is nowhere found (but of course, it does compile)
- I'd like to have a HelpersJ class to take advantage of helper methods
- What is the idiom for singleton snippets in Java? In Scala code some snippets are object (singleton) others are class (new instance each time, right?). As I understand it there are currently only class snippets possible in Java.

- How are we going to express XML in Java?

Another thing: Can someone point me to a nice and short introduction to Git? My past multi person projects where done with Subversion and I seem to have trouble understanding the concepts of push/pull/fetch/rebase and these things - and I don't want to screw things up :)

So, what is the workflow, if I want to update my local repository with the remote changes (pull?) and what is the workflow I use to commit my changes to the remote repo (push?)

What is stash and shelf, and which commands should I never use on a public repo (rebase?).

Thanks,
Torsten.

Paul Dale

unread,
Feb 9, 2011, 12:39:28 PM2/9/11
to lif...@googlegroups.com
Another thing: Can someone point me to a nice and short introduction to Git? My past multi person projects where done with Subversion and I seem to have trouble understanding the concepts of push/pull/fetch/rebase and these things - and I don't want to screw things up :)

So, what is the workflow, if I want to update my local repository with the remote changes (pull?) and what is the workflow I use to commit my changes to the remote repo (push?)

What is stash and shelf, and which commands should I never use on a public repo (rebase?).


Git from the bottom up ( http://www.newartisans.com/2008/04/git-from-the-bottom-up.html ) was useful for me in getting my head around git.
 

AGYNAMIX Torsten Uhlmann

unread,
Feb 9, 2011, 1:45:40 PM2/9/11
to lif...@googlegroups.com
Thanks, I'm gonna read through it...

 

--
You received this message because you are subscribed to the Google Groups "Lift" group.
To post to this group, send email to lif...@googlegroups.com.
To unsubscribe from this group, send email to liftweb+u...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/liftweb?hl=en.

Mit freundlichen Grüßen,
Kind Regards,

Torsten Uhlmann

-- 
Torsten Uhlmann
AGYNAMIX(R). Passionate Software.
Inh. Torsten Uhlmann
Buchenweg 5, 09380 Thalheim
Phone:       +49 3721 273445
Fax:             +49 3721 273446
Mobile:       +49 151 12412427
Web:           http://www.agynamix.de
Skype:        torsten.uhlmann
Facebook, Twitter: agynamix

Reply all
Reply to author
Forward
0 new messages