addressalign-toparrow-leftarrow-leftarrow-right-10x10arrow-rightbackbellblockcalendarcameraccwcheckchevron-downchevron-leftchevron-rightchevron-small-downchevron-small-leftchevron-small-rightchevron-small-upchevron-upcircle-with-checkcircle-with-crosscircle-with-pluscontroller-playcredit-cardcrossdots-three-verticaleditemptyheartexporteye-with-lineeyefacebookfolderfullheartglobe--smallglobegmailgooglegroupshelp-with-circleimageimagesinstagramFill 1languagelaunch-new-window--smalllight-bulblightning-boltlinklocation-pinlockm-swarmSearchmailmediummessagesminusmobilemoremuplabelShape 3 + Rectangle 1ShapeoutlookpersonJoin Group on CardStartprice-ribbonprintShapeShapeShapeShapeImported LayersImported LayersImported Layersshieldstar-shapestartickettrashtriangle-downtriangle-uptwitteruserwarningyahooyoutube

RE: [ljc] Java 8 Code Examples

From: Tanyel B.
Sent on: Monday, May 4, 2015, 11:18 AM
Hi,

I wrote a small Rock Paper Scissors app using Java 8/JavaFX 8 a few months ago that uses lambda expressions to implement functional interfaces using the strategy pattern as suggested in a chapter of Effective Java 2nd ed called "Use function objects to represent strategies".

Here's the link to my github:

If you look at the package com.rockpaperscissors.model.strategies and com.rockpaperscissors.eventhandlers for examples of that.

I also implemented Joshua Bloch's modified builder pattern for the JavaFX 8 GUI code in the com.rockpaperscissors.view package.

I only graduated in October and this was my first time with Java 8, but I thought I'd throw it out there in case it's of any interest.

Cheers,

Tanyel



From: [address removed]
Subject: Re: [ljc] Java 8 Code Examples
To: [address removed]
Date: Mon, 4 May[masked]:49:46 -0400

Thanks everyone for your replies on and off list, that's very useful.

Other than tutorial code, does anyone have links to real code (i.e. github) showing great examples of Java 8 usage? Would be most useful if you can point me to particular sections too.

Thanks!
Trisha

On 1 May 2015 at 13:07, Mani <[address removed]> wrote:
Hi Trish

Links to the below lambda tutorials are a good starting point and examples of Lambdas, if you would like to talk about them:

- https://github.com/AdoptOpenJDK/lambda-tutorial
(LJC member Graham Allan, @Grundlefleck)

- https://github.com/NightHacking/LambdasHacking
(Nighthacking: Stephen Chin, Oracle - @steveonjava)

My favourite links remain:
Maurice Naftalin's Lambda FAQ: http://www.lambdafaq.org/
Java 8 Lambdas in the Stream - video: http://parleys.com/play/535fbe6ee4b03397a8eee8ea/chapter0/about)
The Road to Lamdas - video: http://parleys.com/play/5250e2fbe4b0c4f11ec57682/about)
Java 8 and beyond keynote - video: http://parleys.com/play/52ada612e4b0cc758a757a77/chapter68/about

And all these have inspired me to come up with some simple examples (showing the old and the new):
https://github.com/neomatrix369/LambdaExamples

But I want to extend this further, with more sophisticated ones if others are game for it.

Cheers,
Mani

-- 
@theNeomatrix369  | Blog (http://neomatrix369.wordpress.com) |
LJC Associate & LJC Advocate  (@adoptopenjdk & @adoptajsr)



From: [address removed]
Subject: [ljc] Java 8 Code Examples
To: [address removed]
Date: Thu, 30 Apr[masked]:11:07 -0400

Hi Everyone,

I'm in the process of doing some research on Java 8, and I thought maybe the awesome people on this list could help :)

There are two things that would be dead useful for me, as I'm trying to pull together good material to teach people how to use Java 8.

1) Good examples of idiomatic use of lambdas and streams (actually and Date/Time too). I appreciate it's quite early to define "idiomatic", but maybe you've seen some great examples of the new APIs in use. I have a number of github projects I can look at, but more interesting to me would be specific lines of code or classes to take a look at. Have you come across (or written) any code which you think is a really great example of how you use the new Java 8 features?

2) What tripped you up when you were learning to use the new features? Obviously this only applies if you've been trying to learn/use Java 8, but since many people are already using it, I thought I'd ask for horror stories - what did you find hard? What's not intuitive? What did you have to look up, and then promptly forgot so you have to look it up every time? Are there things you still don't really understand the point of, or how to use?

These are two areas I'm particularly interested in, but if anyone has anything to share about what they love/hate about Java 8, I reckon that's pretty interesting to more than just me.

Trisha




--
Please Note: If you hit "REPLY", your message will be sent to everyone on this mailing list ([address removed])
This message was sent by Trisha ([address removed]) from LJC - London Java Community.
To learn more about Trisha, visit his/her member profile
To report this message or block the sender, please click here
Set my mailing list to email me As they are sent | In one daily email | Don't send me mailing list messages

Meetup, POB 4668 #37895 NY NY USA 10163 | [address removed]




--
Please Note: If you hit "REPLY", your message will be sent to everyone on this mailing list ([address removed])
This message was sent by Mani ([address removed]) from LJC - London Java Community.
To learn more about Mani , visit his/her member profile
To report this message or block the sender, please click here
Set my mailing list to email me As they are sent | In one daily email | Don't send me mailing list messages

Meetup, POB 4668 #37895 NY NY USA 10163 | [address removed]





--
Please Note: If you hit "REPLY", your message will be sent to everyone on this mailing list ([address removed])
This message was sent by Trisha ([address removed]) from LJC - London Java Community.
To learn more about Trisha, visit his/her member profile
To report this message or block the sender, please click here
Set my mailing list to email me As they are sent | In one daily email | Don't send me mailing list messages

Meetup, POB 4668 #37895 NY NY USA 10163 | [address removed]

People in this
group are also in: