Archive

Archive for the ‘Scala’ Category

ACCU 2013 Taking Scala to the Enterprise: Slidedeck

April 13th, 2013 Comments off

Thanks to all of the organisers at the ACCU 2013 and to the people I met at the conference in Bristol. I only spent two days over in the West Country, and they were very enjoyable. Actually, I found the Marriott Bristol City Hotel as a great location, as it was nice to walk [at night] to the restaurants and see more the sites. There is also the river and a small park area opposite the hotel, where one can grab some fresh air. Of course, Bristol is much further away from London than Oxford is and WIFI in an individual hotel room, for a speaker is not free.

The biggest benefit I have from ACCU this year is talking to people about Agile, the industry, the prospects of software development and getting a uniquely British perspective on where we all could be going in the year. I was surprised by the interest of ACCU conference goers into the functional programming movement. Lots of the attendee are well informed about C++ initiatives of Lambdas  in the next upcoming standard. The ACCU audience tends to be knowledgeable about the lower levels of abstraction, which are most of time closer to the metal [the hardware]. A few delegate will definitely written assembler code from the ground up once upon time.

I also have to mention the Bloomberg Game Zone; I had great fun playing Defender, Galaga and Donkey Kong. After 25 years, it was embarrassing to see how bad I have become with Defender, especially. When I was fourteen or so, I spent my youth and multitudes of ten piece coins “getting good”, the planet exploded many times, regularly I clocked over 100,000 points per game, kill scores of Mutants and Baiters. Now I was paltry, I struggled to get over 20,000 points.  Hot Tip: Mr. John Lakos please bring over Mr. Do, Gorf and PacMan arcade consoles to 2014.

Find the slide-deck to my talk on Wednesday 10th April, here:

I must come back to ACCU and do it special on intermediate Scala and Play Framework, something that stretches way beyond the beginner and introduction. We will see in 2014 and beyond.

Special shout-out, in no particular order: Astrid Byro, Phil Nash, Ewan Milne, Brian Marick, Martin Waplington, Schalke Cronje, Russel Winder, Roger Orr, Kevlin Henney, Michel Grootjans, Steve Love, Frances Buontempo, Detlef Vollman, Beth McKenzie, Ann-Jayne Metcalfe, James SlaughterJon Jagger and Kjersti Sendeberg; and finally Julie Archer and Belinda Wiacek.

+PP+

Categories: ACCU, Conference, Scala, technical Tags:

Wednesday JPR 2013

March 3rd, 2013 Comments off

Wednesday was my absolute favourite day of the round-up. It was mid-week, we were half way through, already, the round-up. But before I can begin, I must say many of us had a late night at Joe Webber’s Princess bar. The jet lag had caught up with me by then, and the morning was rough, and yet I rush to the Parish Hall to get to session that I pinned up on the board: “How to be a Better Consultant?”. Well it did not happen, people were not interested in this topic and there was another one happening at the same. Instead, Romain Pelisse and I had a long chat downstairs in the comfy chairs. We poured over web sockets, Java, Scala, Red Hat and of course travelling to different countries to see clients. I just found Romain fascinating, and the fact that he does training for Red Hat is a good thing too. Sometimes, coincidence is the best thing, what does not occur is the destiny and the true path.

JPR 13

This is the official sheet that host must fill in to record a podcast session for the JavaPosse Round-Up; here is mine on Functional Programming

The second session of the second day was a little vacant. So I thought I am going to propose an session. I grabbed a post-it note and felt tip pen and scribbled down: Functional Java. Well what did I know. People was interested, people including Bill Robertson, Dick Wall, Bruce Eckel and Daniel Hinojosa. I think from this talk that I was letting my Scala learnings slip away. I know why, because I have writing feverishly on the Java EE 7 book, which is the main priority. I will get back on the Scala horse sooner rather later. Bill Robertson had a great deal to say about Closure and ClojureScript schemas. It was an interesting session to say the least.

The title Engineering Management Techniques and Insights was the final and third session of Wednesday. This was hosted by Barry Hawkins and Guy and myself. The other people were the instigators of the session, in truth. As guy put it: how can we lead without managing? The session revealed that there were no easy answers to great engineering management. There topics dived into a performance reviews, 360 reviews, Agile retrospectives; management by walking around the office was controversially seen by some, not particularly myself, as a bad idea. I believe this is going to be an interesting podcast, because you may or may not agree with the points on the tape.

Untitled

In the afternoon, I met up with Chris Phleps and we went to the Crested Butte, the weather was gorgeous, absolutely kind to us. Chris is a skier and I am a snowboarder; the funny thing is that we are both owners of GoPro helmet camera. Chris had a first generation and I had recently invested 200 quid in a third generation. It was a lot of fun riding together. If you want to see more about winter sports, please see my other related blog entry.

Day 2 of the Conference Wall.

Untitled

In between the sessions on Wednesday, I went to the Camp Four coffee shop just around the corner from the church. I saw this outside painting with oil colours the Crested Butte mountain. This local painter is called Shaun Horne; his paintings are displayed at the Telluride Gallery in Colorado, http://shaunhorne.com

JPR 13

Camp 4 Coffe shop just around the corner. Hmmm Coffee+++

JPR 13

The mystery cosmopolitan cocktail from the Princess bar on Tuesday night: actually, it tasted delicious. A chance for developers to unwind and truly forget about professional work and the day job.

JPR 13

Uh oh. I have been caught red-handed with the cocktail in hand! To my right is Bruce Eckel, the co-organiser of the JavaPosse Round-Up open space conference, Bruce Eckel. This photo was taken by James Ward, who was working behing the Princess bar, helping out Joe Webber.

+PP+

Categories: community, Conference, javaposse, Scala, Travel Tags:

Speaking at UK Conferences in 2013: Devoxx UK and ACCU Bristol

February 18th, 2013 Comments off

In the early months of 2013, I have two conference that I, definitely, will be speaking at:

  • Devoxx UK 2013, London. My talk is called Test Driven Development with Java EE 7, Arquillian and Enterprise Containers. This is the first edition of the Devoxx franchise in the United Kingdom. The conference is taking place at the Business Design Centre from March 26th and 27th. The schedule for Devoxx UK is still being determined at the time of writing. It looks like my talk is on the Tuesday at 14:30 in the schedule.
  • ACCU Conference 2013, Bristol. My talk is called Taking Scala into the Enterprise. This is the first edition of the ACCU conference in Bristol; it usually runs from the Barcelo Hotel in Oxford. This year the organiser have decided move the whole conference to the Marriott Hotel in Bristol, which is quite exciting as I have never visited this city. I certainly driven pass it in a car many times. My Scala talk is on the Wednesday 10th April, which is actually on the first day of the regular conference. The conference itself runs from Wednesday 10th April to Saturday 13th. The schedule for the ACCU 2013  has already been published.

Tickets are still available for both of these conferences; so I hope to see you there at one or both of these excellent events.

+PP+

 

Categories: community, Conference, Java, javaee7, Scala, testing Tags:

Devoxx 2012 Report: The State of the Expansion

November 19th, 2012 Comments off

Devoxx 2012: Bam!

IMG_1435
Stephen Chin rode into the Wednesday morning Keynote with his NightHacking.com motorbike. It was an exciting start to the conference days!

They say that change is inevitable and you cannot never ever truly predict exactly what will happen in the future. This is common knowledge. Perhaps, the only way we can be sure of the trends, initiatives and the arrow of time, is to take a sampling of the product and the mood at frequent points in time. Measure more often and frequently.

This is one for me the whole point of going to conferences. Beyond a laugh and joke with people you know; there is a serious business of finding out exactly what is interesting people, what is the latest technology and asking what else do I have to learn?

Devoxx UK

The biggest news from my point of view is that they gone and announced Devoxx UK. Yes, that is correct. After the successful launch of Devoxx France, a couple of members of the London Java Community wanted to push ahead with the London version. The main  positive for the London IT developer is that  they do not take the Eurostar or fly; and they can get to see a version of the Antwerp conference with, I presume, the high standard of technical content; and it will be on their own doorstep.

The fly on the ointment for me in the marketing so far, which I can see, is the slight political situation in Great Britain. We have at the moment, a disunited kingdom currently where Wales and Scotland are pressing for devolution of the central government and local council controls; and so in the branding of Devoxx UK the organizers should be careful.  In other words, the conference should take care of the sensibilities and sensitivities of all the British citizens. Personally, being a person of Black Afro-Carribean origin, and also being a rare example of a person who is an experienced software developer in the London information technology industry,  I will advise maximum inclusive and openness in the out-going messages.

Generally, I see great advantages in Devoxx UK for people near and around London, because I have just checked my full travel costs to California; and whilst I do not regret going to and speaking at the JavaOne conference, let us just say the San Francisco hotel costs were expensive. It is for good name of JavaOne, being the Mecca for the world-wide Java development, that I could do it.

With Devoxx UK on our doorstep, for fellow Brits, the cost is significantly reduced especially for the young and old, the unwaged, and any other soul struggling to keep a straight face with their monthly bank balance. Even for folk, who want to travel down from Scotland or make their trip from up North [Northern England; City of Liverpool, Manchester, Sheffield, Leeds, Newcastle, etc] or across the Irish Sea, the cost for people living in the UK should be cheaper and easier to travel to. I also believe Devoxx UK should be cost effective for contractors to take a couple of days of work for self-funded training. So I will keep my fingers crossed for the success Devoxx UK.

IMG_1485
Adam Bien, last session of the conference, Java EE Patterns Revisited: a great talk!

Apple iOS

The conference was also a watershed for myself to embrace Apple iOS programming, thanks to Michael Segher’s excellent university talk and hands-on-lab on the Monday. This is the bonus that taking time out at conference can do especially if you disconnect yourself completely from the constant stream of interruptions from the workplace.  Suddenly, you can be hacking in an unfamiliar domain and furthering your education.

Somebody once wrote in a book about learning to play electric guitar, which I read years ago, that you are now guitarist since you picked up the book and/or the DVD; and essentially start practising the licks on a real instrument. It is a change of mental attitude. If you want to go off on a tangent by yourself into another field; it does not matter even if it is outside technology, find a conference or a setting where an instructor is willing to lay down a bridge stone and gently show the way to get into the new subject. I cannot claim instant gratification of being a virtuoso iOS software developer, but know just like the young girl Lex Murphy, the granddaughter of the scientist, flawed investor and billionaire owner John Hammond in the movie adaption of Michael Crichton’s fantasy novel Jurassic Park; and I can now heartily exclaim, “I know iOS, I know that system”.
IMG_1460
Bill Venners gives some very practical, simple and design advices during his talk about “Simplicity in Scala!”

Hacking Gardens

Andres Almiray organised a Hackergarten for folk who wanted to get involved in projects. I liked the concept of it in theory, however, in practice, when I came down at lunchtime or between the sessions, I did not understand who was hacking on which systems. I could see the JBoss folk huddled together in one area of the exhibition hall and on the other side, where Stephen Chin was conducting Nighthacking interviews, I think there was a Groovy programming activity. The idea was good; it could be better signposted to the observers as they walked around.
IMG_1459
The JDuchess team from L to R: Linda van der Pal, Yolande Poirier and Regina ten Bruggencate

Java EE 7

Whilst I was in Antwerp, I had a task to find out more about the upcoming changes in Java EE land. I especially wanted to learn about the Context and Dependency Injection appearing in Java SE. I was disappointed to learn that this will not make into the Java EE 7. David Blevins intimated that he thought it would be a discussion point for CDI 2.0.

In fact, David Blevins had a rather interesting talk on Extensibility in Java EE 7. I really liked his more powerful and reusable custom Stereotype annotations proposal. Currently in CDI 1.0 for Java EE 6 you are allow to define custom annotations and aggregate them together, unfortunately they cannot be reused with the semantic information applied. David Blevins idea of Metatypes would be a welcome addition. https://github.com/dblevins/metatypes/

He also had another idea for standardising custom connectors with resource adaptors for message drive beans: namely written custom connectors that synchronised command over an input and queue channel to a service, such as Telnet provider or email service. For my point of view, I was not sure about this particular use case and you can read for yourself https://github.com/dblevins/mdb-improvements.  I think this is small-scale enterprise application integration, which is better served in my opinion, by a dedicated framework like Spring Integration, Apache Camel and others.

JavaFX and Embedded Devices

Seeing JavaFX running on embedded devices was a great highlight of Devoxx. I think this reaffirms the direction and intention of where Java as a client-side technology could be going.  There is a whole industry of mobile computing devices waiting to explode out. I believe that impact of the Raspberry Pi and Beagle board will only be truly known a couple of years from now, down the road.
IMG_1447
Simon Ritter wore an EEG headset to detect brain-waves using a Raspberry Pi and JavaFX / Java port to ARM Linux
Gerrit Grunwald, the current wizard of gauge interfaces in JavaFX, demonstrated his Beagle board set-up at the JavaFX University day. We learnt that we should optimising the number of nodes in a scene-graph; if we want reasonable performance on an embedded device, simply because the number of cores in a Graphical Processor Unit (GPU) on a ARM processor boards are at least two orders of magnitude different from a MacBook Pro Retina Display GPU.

Simon Ritter had an interesting presentation that demonstrated JavaFX running on an Raspberry Pi, on a beta release Java SDK, which Oracle announced a couple of weeks ago at JavaOne. The Oracle advocate had a cheap robot mechanical robot, bought from Maplins; a Lego mindstorm with a motor, which any child can plead for their parent to buy; and an Electro-Cardiogram EEG headset connected via USB, working in his presentation. I recommend you catch this talk on Parleys on some stage, because it was fun. I would also like to commend Angela Caicedo for showing off the Java embedded stuff at the JavaFX Bootstrap university.
IMG_1423
Gerrit Grunwald’s Beagle board and JavaFX application, which read the current room temperature

Just to finalise the intention of returning Java back to embedded devices; the original design concept of Java, the so-called Oak, and Project Green, was to develop a set-up top for Television; Jasper Potts shipped the JavaOne consoles, which were Panda Boards, all the way from the USA to Belgium. He updated the conference data, and four of the consoles were in operations in the Metropolis.

I think JavaFX is now the replacement for Swing, and it is getting there, surely after five years now. It needs the other technologies from current embedded devices and desktop machines, namely: Web Camera support, USB input support, Magnetometer, Accelerator, and of course most obviously Geo-location senor input. Perhaps, through the open sourcing of JavaFX by early 2013, we can as community quickly developed these APIs.  In fact, when I had a conversation with Jo Voorendeckers in the hallway, he felt that JavaScript via Phone Gap and HTML5 were still just a couple of strides ahead of JavaFX. In this regard, Jo Voorendeckers and Benjamin Dobler demonstrated how powerful JavaScript and HTML5 are right now with upcoming HTML5-based version of Parleys.

IMG_1472
Yakov Fain talks about JavaScript for Java developers, which actually very amusing and full of that New Jersey Italian Mafia goodness. I really mean this was a very good talk; just to be sure that any gangsters do not come for me in the middle of the night!

JavaScript

Yakov Fain had this final session of the day on Thurday, which was called JavaScript for Java Developers. What a comedic brain this guy has? The best variable name I was seen for a long time was this:

function Tax(income,dependents) {
var mafiaTaxDeduction = 300
// calculate the tax
}

Actually, Yakov seriously gave the audience a very good introduction into the JavaScript programming language. We should respect it as a very general and malleable programming language, and there are very important good parts as well as the script-kiddie bad parts. For instance, JavaScript has closures (lambdas with hoisting) and it can do mix-ins through something called a prototypical inheritance. If you are betting woman [or man], then learn JavaScript [again] for the education major task of 2013 just to cover your bases.

Coda

Well this is not quite the end. Devoxx 2012 was very successful, especially for technologies, which lies on the periphery.  I will certainly remember my first experiences with iOS here. The resurgence of JavaScript was rather well once again made out to be true as the emerging web platform. JavaFX needs to catch up with the sensory device input; and as for JavaEE 7 we have make sure that we, the Java EE community, deliver on our promises. [I will probably add an extra bit of piece to this entry later, as addendum sections. Stay
tuned.]
IMG_1476
This was about the JUG Leaders meeting, and Antonia Gonclaves, the Paris JUG, and Devoxx France organiser, was taking his turn to speak to everyone

Shout-Outs

Here are the traditional shout-out; there is no order implied whatsoever:-

  • Jo Voorendeckers
  • Stephan Janssen
  • Stephen Chin
  • Keith Combs
  • Michael Seghers
  • Yolanda Poirer
  • Constantin Partac
  • Galder Zamarreno
  • Thomas Bolz
  • Dr Mark Little
  • Carlo de Wolf
  • David Blevins
  • Gerrit Grunwald
  • Lucy Weaver
  • Jim Weaver
  • Alessandro Alfonso
  • Angela Caicedo
  • Fabrizo Gianneschi
  • Jose Pereda Llamas
  • Tasha Carl
  • Johan Vos
  • Linda van der Pal
  • Yakov Fain
  • Nicole Scott
  • Jamie McGivern
  • Martijn Verburg
  • Regina ten Bruggencate
  • Heather VanCura
  • Dan Allen
  • Patrick Curran
  • Simon Ritter
  • Terrence Barr
  • Sharat Chandler
  • Renato Guerra Cavalcanti
  • Kirk Pepperdine
  • Antonio Goncalves
  • Joe Darcy
  • Andres Almiray
  • Trish Gee
  • Ben Evans
  • Luc Duponcheel
  • Dick Wall
  • Carl Quinn
  • Tor Norbye
  • Sonya Barry
  • Oliver White
  • Jonathan Giles

To anyone I missed, I did not mean to do it. See you all next year 2013!

IMG_1467
The JavaPosse Live! This was recording number 400, where Chet Haase officially replaced Joe Nuxoll. Episode 400! Congratulations!

IMG_1505
It is my hand. The organisers deployed Near-Field Communications as wristbands on everybody for both parts University and Conference days. Obviously, after five days of shaking hands, showers and general distress these wristbands look worse for wear. I had to get help cutting them too after the last session!

IMG_1416
Gerrit Grunwald (L) and Jim Weaver (R) at the JavaFX Bootstrap university session this year.

IMG_1417
I caught a brief glimpse of Kirk Pepperdine and Aleksey Shipilev talk on Java SE Performance, especially on the part about generational counts and memory leaks. It was useful revision for me!

IMG_1493
Antwerp is supposed to be Belgium’s fashionable city. It is probably true; it certainly has great architecture worth seeing

DSCF4446
Here is a picture of me sitting close to the stage just before the JavaPosse Live episode 400 with Joe Voorendeckers to my left. I was sitting with the blue hooded folk, the Devoxx volunteers and support staff. Ah! Bless them for all their hard work.

 

+PP+ 2012

JavaOne 2012 Report Part 1

October 11th, 2012 Comments off

DSCF3950

 

JavaOne 2012 Conference was last week, as I travel around Southern California, it seems like it happened yesterday. I write this blog initially in Monterey Bay, and then I finish it somewhere near Paso Robles, may be Los Angeles, probably. I have to say, that this year the JavaOne conference was a blast, and not just because I presented three times. Java has moved forward, following the tagline from the 2011 conference, “Moving Java Forward”. This year’s tag line is on the tee-shirt was “Make The Future Java”, indeed.

 

DSCF3979
This is Elber, at one-time an actor, a creative artist, sculpture maker and also a technologist from Brazil. He created the illuminated fish head. I am not sure what type of fish it is by the way. Ask Elber when you see him!

 

The Gathering

Why do we all come to JavaOne? We travel hard to get here, because this is the premier league conference where people from the four corners of the Earth can meet up, discuss the latest trends, solve headaches, come with new solutions, get involved with the community, learn from one another, socialise and finally measure the exact state-of-the-art, the technology rampantly swirlingly around the Java Virtual Machine. The most important and obvious reasons are that Oracle, the stewards of the Java, host this mega conference and they are based in California, so this is their home event. If you will, it probably feels like a home match. I think many people forget about that last relative sentence.

 

DSCF3980
[L] Van Riper, Google and [R] Stephen Colebourne, OpenGamma, both Java Champions, are chatting amongst themselves before the Strategy Keynote. Sitting behind them are Andres Ix-chel Ruiz and Andres Almiray [R-to-L]

 

I went out the JavaOne in order to find out what will happen to JavaFX from personally interest point of view and also to learn about the enterprise Java side, Java EE 7. I was pleasantly surprised to see a lot of Scala talks in the online content catalogue, although I did not go to many of them. Typesafe were featured predominantly.

Bundling JavaFX JAR

Why is jfxrt.jar bundled as a JRE separate  file, and not inside rt.jar?
The answer is that the JavaFX is not official part of the Java SE 7 standard. The only way to be standard is to provide certification Java SE committee. Thus JavaFX, in the future, has to be submitted, by Oracle, to the Java Community Process as new Java Specification Request in order that other valid Java SE implementations such as IBM, OpenJDK and SAP can make their choices. Choose to include JavaFX or not.

JavaFX

The story of JavaFX continues onwards. For the desktop environments and operating systems, JavaFX is not cross platform. JavaFX 2.2 runs on Windows, Mac OS X and Linux. As far as I am concerned, Oracle kept their promise to make JavaFX viable on the desktop, they also include JavaFX now with JDK and JRE for Java 7 Update 6 and better.

Hasan Rivi, a vice president at Oracle, Enterprise Middleware Products and Java, announced in a keynote that JavaFX will be fully open sourced by the end of the year 2012. Rivi said, “On the FX front, on the client, again a lot of new capabilities in the release, we really think that it is at a point now, we continue the process on open sourcing FX .. we will finish all components of FX by the end of the year. And we dearly like to invite the community to actively participate with us in taking FX forward”. The Sunday keynote were updates around products Java SE, Java EE and Java ME, you can watch it here. You might remember a couple of years ago, Stephen Chin, originally petitioned for JavaFX being open sourced fully. Ironically, Stephen Chin, is now a JavaFX ambassador for Oracle, and his wish is coming true. The code bundles will appear shortly in OpenJDK project dedicated to JavaFX.

Other folk were expecting that JavaFX would be ported to Android or other smartphone devices, and therefore expressed disappointment that this target was not announced at the conference. Oracle did say that they had already demonstrated some of the technical possibility of running JavaFX on devices to important corporations recently, however the take-up and the follow-through had been poor. It is hoped that open sourcing of JavaFX will produce the extra impetus to push the framework and architecture to mobile and embedded devices.

Personally, I believe we are close to getting a critical turning point. We need just one viable, fun and creative JavaFX desktop application that tips the below, which has the x-factor, with amazing vision and has been put together with talent and skill, using the best user interface design patterns, which provides the compelling reason, “Why are we not porting this existing and excellent JavaFX and Java application to a tablet device?”.

The open sourcing premise of JavaFX is promising, because it should allow third parties to jump in to the source code and add features to the platform that Oracle have not yet decided on? ( support for accelerometry, magnetometry, geo-location and photo cameras. I think it would be wise to check that Oracle have not yet invented any of these wheels internally first? However, history has shown that business does not prefer to wait for anybody, especially when they think that they can make money from the idea by doing it first.)

 

DSCF4001 Jasper Potts' JavaFX Content Catalog Kiosk
The Kiosk that Jasper Potts built to demonstrate JavaFX running on an embedded device. The application is the content catalog for entire JavaOne conference.

 

DSCF4002
Jasper Pott’s embedded JavaFX console side view

 

Oracle did announce JavaFX for Linux as a developer preview, JavaFX for Linux / Embedded ARM devices, and SceneBuilder version 1.1. Oracle is focused on their effort on embedded devices, which are always-on electronic kiosk, terminal, point-of-sole and monitoring domains. In fact, Oracle organised a parallel and separate conference called JavaOne Embedded, which ran on the Wednesday and Thursday, aimed for business managers and decision makers.

As if it to prove this point, Jasper Potts and Richard Bair, created four hand-made production kiosks, in a month long skunkworks and proof-of-concept project. The kiosks were displaying the entire JavaOne Content Catalogue as a JavaFX application running on Java SE Embedded on an embedded device. The LCD screens were multi-touch allowing the conference goers to log-in and plan their schedule touch UI. The kiosk were placed at certain points in the JavaOne complex, the Hilton, Parc 55 and Nikko hotels. As usual with embedded devices, the technical capabilities of the hardware was limited by the amount of available memory, the CPU speed, the number of cores, and the number of threads that could be run simultaneously. Jasper explained that there were even limits on the number of instructions that could be sent from the CPU to the GPU in order to maintain the illusion of performance through user responsiveness. Sending image buffer frames from CPU to GPU and back could be expensive if thought and effort are naively implemented. Porting JavaFX 2.2 to Java Embedded SE over the past months of was a humbling task, therefore it revealed many bugs and refactorings that were solved, which in turn benefitted to the JavaFX desktop product. This previous fact was revealed by Richard Bair in a hallway conversation. The penny should be dropping by now as you are reading this blog.

In case, you did know it already, JavaFX 2.2 has some great features in current edition. There is Canvas support. You can program graphics like HTML5, the Canvas API looks quite familiar. With Canvas in JavaFX, you get the ability to instantiate a writable image buffer with a fixed resolution associated with a Java 2D graphics context. Suddenly, you can develop interesting pixel rendering effects in, some might say, traditional computer graphic programming mode. There is also Pixel image buffer I/O support, where utility classes PixelReader and PixelWriter provide high performance access to reading and writing pixels.

JavaFX 2.2 already has JavaScript support, namely:

// Java
class DataSource {
	public List getCustomers();
}

// JavaScript
JSObject window = (JSObject)webEngine.executeScript("window")
window.setMember("ds", new DataSource() );

JavaFX Maven Integration Niggles

Due to licensing concerns, it is not yet possible to redistribute the jfxrt.jar
in to a third-party Apache Maven repository ( http://repo.maven.apache.org/maven2 or http://uk.maven.org/maven2). Therefore in Maven, Gradle or another build tool you need to explicit link to the JavaFX SDK.

JavaFX relies on native libraries in order to tap in to the underlying operating system’s graphics and media interfaces. These are guaranteed to be different for Linux, Windows and Mac OS X, and the issue is that the JavaFX needs to load one of these libraries dynamically at runtime. Bundling static link to jfxrt.jar is not enough, because the NativeLibLoader class inside of it, must resolve and load a platform specific native library. Therefore it prevents a deployment headache as well as a dependency headache. How do organise jfxrt.jar and decide on the proper Maven Group, Artifact and Version coordinates.

JavaFX will have amazing 3D capabilities. Attendees of the strategy keynote were treated to demonstration of a shipping container terminal system application, which was using an early alpha version of JavaFX 3D API. This was a demo from Navis Corporation [Arvinder Brar]  in collaboration Canoo [Dierk Koenig]. You can also watch this presentation yourself on line CON4853 – JavaFX for Business: Monitoring a Container Terminal. It would be appear the JavaFX 3D will ship with meshes, textures and of course polyhedra. You can also see Nandini Ramini in the Strategy Keynote. Canoo also announced an open source project about their interesting collaboration project Dolphin.

JavaFX 3D will have moving cameras, because they are now going to be treated as like javafx.scene.Node types. I can image translating and rotating a camera through 3D space, but scaling and shearing it. What the does mean? Scaling a camera could be zooming in and out , shrinking and enlarging the view pyramid. Shearing a camera in mathematic 3D transformation, I believe, would be just weird. Actually, I can imagine a sci-fi effect with lots of randomly placed stars [points] in 3D space. Yes I very am excited about the 3D possibilites for the next JavaFX version. I wonder personally, if I could simulate Hyperspace with it, but perhaps it involved non-affine transformations, a non-linear concept anyway ;-) .

The next version of JavaFX jumps from 3.0 to 8.0 in order to match the upcoming Java SE 8 release. I wholeheartedly agreed about this version jump so that matching the Java numbers, and also because the JavaFX library jar is bundled with the JDK. In the future, JavaFX will be itself a module in Java 9, which is expected to implement modularisation (Project Jigsaw).

JavaFX 8.0 will have really great rich text support. Richard Bair showed slides in one his JavaFX presentations about the TextPane and TextFlow controls. Finally, we will be able write an Integrated Developer Editor (IDE) with syntax handling in a JavaFX. Moreover, the new text controls will be composable, support bi-directional languages like Arabic and Hebrew, both at the same time. The text more important will also wrap correctly and best of all, developer will be able to add generic shapes to the TextFlow component so that the rich text wraps around and aligns correctly.

To find out more, watch the JavaOne 2012 Keynote Highlights.

 

DSCF4070
Brazilian are always in attendance at JavaOne USA. If you can’t beat them [for passion] then you might as well join them.

 

Java SE

Java SE 8 will have Lambda functions (JSR 335) long overdue for five years. Brian Goetz gave a talk on lambda functions, which I could not attend, of course, because of clashes [I am sure I will catch it again in Devoxx]. Lambda brings essential functional programming to the platform. Here is a word of caution here, the proposal does not introduce higher order functions, although they can be implemented in a library. Lambda functions will simply the event handling logic in JavaFX, and code will must more functional and readable.

Mark Reinhold explained his reasons again for deferring the Jigsaw project to 2015. Although the full implementation will be delayed, he mentioned at least four profiles. Each of these profiles builds extra functions into the other platform until the full version. Mark Reinhold explained in his session, which I did attend, how hard it has been to refactor and restructure the Java Runtime Environment. His major concern was testing and building a guaranteed implementation of module system that would work from version 1.0 with little flaw.

I believe he is correct in delaying Jigsaw to Java 9. Consider the flawed Apple iOS 6 map implementation that was released as a production code earlier this year. If Java Jigsaw were released as early and as buggy as the iOS 6 Maps then we would be crying, despairing and wondering how on earth we did not test, and test early. The profiles in Java SE are a great idea, in the Java EE land, we already have two, the WEB and FULL. It is a great compromise.

People are looking forward to the new Date Time API (JSR 310) and also improved Annotations on Types (JSR 308).

Oracle also announced the Sumatra project in OpenJDK, which looks to see how the Java Virtual Machine and HotSpot can take advantage of the abundance of cores in Graphical Processor Unit (GPU) chips, which are found in hardware accelerated graphics cards.

 

DSCF3993
Sharat Chandler addresses the gathering of JUG Leader and Java Champions at the social event where he expressed his thanks to all of us.

 

Miscellany

Sharat Chandler is moving somewhere in the Oracle chain. I think it is polite to allow him announce his final destination, when he gets there. The title of Chairperson of the JavaOne Program Committee passed from Sharat Chandler to Stephen Chin on the Thursday community keynote. This was a surprise to all of us. None of the Java Champions and / or JUG Leader knew this was happing. Stephen kept his secret under wraps.

I believe Stephen taking over the organisation of JavaOne will be asset to the collective, because he is very familiar with the community of user groups around the world. He travels to the conference, does a great job presenting and always involves the audience. Stephen starts his new role with the Nighthacking Tour of Europe.

Sharat Chandler also did a great job taking over the running of JavaOne in the past two years. He did listen to the concerns of the community, and push to support the leaders, the attendees and made JavaOne at least viable. One of the things he did, was reduce the markitecture of the conference. There were two days of key notes, and the rest of the conference with given over to the technical sessions. So I want to congratulations on both Sharat and Stephen.

This is the end of part one. In part two I will cover the Java Enterprise part of the conference, in particular “Moving Java EE to Cloud” or not, as it proved to be, provide more analysis and perspectives on Java and miscellany.

See you in part two

Los Angeles, October 2012
+PP+

 

DSCF4073
[L] Sharat Chandler’s landyard compared to mine [R], spot the difference, no prizes.

 

DSCF4065
Stephen Chin, on stage, on the Community Keynote, has just become the Chairperson of Program Committee for all future JavaOne events from 2012 onwards.

 

DSCF4049
[L] James Gosling, the Father of Java, makes a welcome return to JavaOne after three year absence, promoting Liquid Robotics and Java working inside oceanographical science.

 

DSCF4030
On the way to and from from the Oracle Appreciation Event, I hung out with the Brazilian contingent at JavaOne. We were on our way back to the Hilton SF, when this photo was taken.

 

DSCF4027
[L] Simon Ritter is on demo kiosk duty explaining his Maker-make passion with JavaFX and strange and wonderful hardware to an attendee.

 

DSCF4017
This is me just moments before my first solo talk on Wednesday, on Contemporary User Interface Design Patterns in JavaFX 2.2. I was nervous as hell. Well you always need a little bit fear to give you a kick of adrenalin.

 

DSCF4015
Gerrit Grunwald is talking about writing JavaFX custom controls and all about the cool looking gauges that he has been implementing.

 

DSCF4011
[L] Bruno Souza of the Brazilian SouJava user group. He is holding the special JCP award for his user group’s involvement.

 

DSCF4006
Book authors should stick together, although at the time of writing [Oct 2012] and I am at the start of the journey of being a writer. [L] Paul Anderson and [M] Gail Anderson authors of Essential JavaFX (2009)

 

DSCF4087
[L] Stephen Chin, my partner in crime in the JavaFX Developer Guide for JavaOne 2012. This photo was taken at the annual desktop lunch that Stephen and Jonathan Giles organising for the conference.

 

DSCF4010
Centre stage, Chairperson of the Java Community Process, Patrick Curran, shares his delight at the JCP evening

 

 

+PP+

JavaOne 2012 Slide-Decks and Code Bundles

October 5th, 2012 Comments off

CON4643 – Contemporary User Interface Design Patterns in JavaFX 2.2

Wednesday, Oct 3, 1:00 PM – 2:00 PM – Hilton San Francisco – Imperial Ballroom B

Download the Slide Deck for CON4643
Download the Code bundle for CON4643

The deck contains some extra slides that lists the UI design patterns. There are actually over 100 patterns in Jenifer Tidwell’s 2010 second edition book.

On Wednesday, in the interest of saving time, I skipped over the ModalPanel (otherwise known as Light Box) design pattern. I have added it back to the slide deck and you can run it yourself from the code bundle.

The code compiles against Java SE 7 update 6, which bundles the JavaFX library jar.

For Java SE 6 update 29 and better, you need to, first, define the environment variable JAVAFX_HOME and point it to the Oracle JavaFX 2.2 distribution. The JavaFX SDK is a separate distribution for Java SE 6.

CON4648 – Scala, JavaFX, Java EE 7, and Enterprise Integration

Wednesday, Oct 3, 4:30 PM – 5:30 PM – Hilton San Francisco – Imperial Ballroom B

Download the Slide Deck for CON4648
The deck contains some extra slides and addenda from Wednesday’s technical session.
NB: This was not any code bundle for this talk

TUT5466 – JavaFX 2: A Java Developer’s Guide

Stephen Chin – Java Evangelist, Oracle
Peter Pilgrim – Developer Consultant, Independent Contractor

Tuesday, Oct 2, 12:30 PM – 2:30 PM – Hilton San Francisco – Continental Ballroom 1/2/3

Download the Slide Deck for TUT5466
Download the Code bundle for TUT5466

I wish to thank all of the attendees who came to my talks at JavaOne 2012. I very much hope you enjoyed the subject matter. Please feel free to inquire and ask further questions.

Building ScalaFX 1.0 with Gradle 1.1

August 28th, 2012 2 comments

After becoming a little disenchanted with the SBT for Scala, I wanted an alternative that was more logical, simpler to understand and had a better user experience. After all, the whole point of a domain specific language is to make the writing of the script, formulae or grammar to be affordable to the users. A DSL must be comprehensible to the users, it must be relatively easy to write the script in the language of the domain, and surely must be mostly free of annoyances. The great examples of course are spreadsheets like Excel, the XML Stylesheet Language for Transformations (XSLT) and shell scripts (like DOS, BASH).

I recently added a build.grade file to the ScalaFX project. Here is a screen cast about how to use Gradle build instead of the current SBT file.

Building ScalaFX 1.0 with Gradle 1.1 from Peter Pilgrim on Vimeo.

The only sore point so far, I have found with Gradle, is that the project takes it name from the containing folder. In other words, I found that force setting the artifactId does not work.

group = 'org.scalafx'
artifactId = 'ScalaFX-javaone-2012'  // This does not work
version = '1.0-SNAPSHOT'

That might be worth considering when moving project folders around in order to make a quick research branch for a delta, or look at some other committer’s changes separately from your own.

Because Gradle is written in Groovy, you have the full power of that dynamic language to play with. I was able to write a groovy task to push a UNIX bash launcher script in less than ten minutes. I was also able to run a launcher within Gradle for the Colorful Circles demo app. The Gradle documentation is a lot better than SBT, in my humble opinion.

In SBT, if you missed adding a single blank line between statement declarations, or you forgot to add an extra delimiter between to Seq() or perhaps used the wrong method name “+” versus “++” then you could be lost for quite a long time.

It would good to see how the Scala Plugin for Gradle could work with recently announced Zinc and Incremental Compilation from Typesafe. After reading that blog post, I think Zinc, Gradle and Scala plug-in should just work. Has anyone tried this combination yet? I have not yet.

PS: Under Windows, you need to comment out the “chmod” line in the build.gradle for now. I will fix this later on before the 1.0 release.

PS PS: With the Vimeo, you might prefer to click on the HD option to see improved clarity.

+PP+

ScalaFX – Working Configuration for MacOS X Lion, Java 7 Update 5

July 26th, 2012 Comments off

Here is a complete verbatim build.sbt for ScalaFX that works on MacOS X Lion and Java SE 7 Update 5:

// Important - Set the JAVAFX_HOME environment variable to the root of your JavaFX installation for this script to work

// You can also set your scala or java home if necessary like this:
// javaHome := Some(file("/Library/Java/JavaVirtualMachines/1.6.0_24-b07-330.jdk/Contents/Home"))
// scalaHome := Some(file("/Users/Sven/scala-2.9.1/"))
// javaHome := Some(file("/Library/Java/JavaVirtualMachines/1.7.0.jdk/Contents/Home"))

javaHome := Some(file(System.getenv("JAVA_HOME")))

name := "ScalaFX"

version := "1.0-SNAPSHOT"

organization := "org.scalafx"

scalaVersion := "2.9.2"

resolvers += "Local Maven Repository" at "file://"+Path.userHome.absolutePath+"/.m2/repository"

unmanagedSourceDirectories in Compile <++= baseDirectory { base =>
  Seq(
    base / "src",
    base / "demo"
  )
}

// set the Scala test source directory to be <base>/test
scalaSource in Test <<= baseDirectory(_ / "test")

// testListeners <<= target.map(t => Seq(new eu.henkelmann.sbt.JUnitXmlTestsListener(t.getAbsolutePath)))

// append several options to the list of options passed to the Java compiler
javacOptions ++= Seq("-source", "1.5", "-target", "1.5")

// append -deprecation to the options passed to the Scala compiler
scalacOptions += "-deprecation"

// define the statements initially evaluated when entering 'console', 'console-quick', or 'console-project'
initialCommands := """
  import System.{currentTimeMillis => now}
  def time[T](f: => T): T = {
    val start = now
    try { f } finally { println("Elapsed: " + (now - start)/1000.0 + " s") }
  }
"""

// libraryDependencies += "com.oracle" % "javafx-runtime" % "2.1"

// set the main class for the main 'run' task
// change Compile to Test to set it for 'test:run'
mainClass in (Compile, run) := Some("scalafx.ColorfulCircles")

// add <base>/input to the files that '~' triggers on
watchSources <+= baseDirectory map { _ / "input" }

// disable updating dynamic revisions (including -SNAPSHOT versions)
offline := true

// set the prompt (for this build) to include the project id.
shellPrompt in ThisBuild := { state => Project.extract(state).currentRef.project + "> " }

// set the prompt (for the current project) to include the username
shellPrompt := { state => System.getProperty("user.name") + " (SBT) > " }

// disable printing timing information, but still print [success]
showTiming := false

// disable printing a message indicating the success or failure of running a task
showSuccess := false

// change the format used for printing task completion time
timingFormat := {
    import java.text.DateFormat
    DateFormat.getDateTimeInstance(DateFormat.SHORT, DateFormat.SHORT)
}

// disable using the Scala version in output paths and artifacts
crossPaths := false

// fork a new JVM for 'run' and 'test:run'
fork := true

// fork a new JVM for 'test:run', but not 'run'
fork in Test := true

// add a JVM option to use when forking a JVM for 'run'
javaOptions ++= Seq (
  "-Xmx512M" ,
  "-Djavafx.verbose"
)

// only use a single thread for building
parallelExecution := false

// Execute tests in the current project serially
//   Tests from other projects may still run concurrently.
parallelExecution in Test := false

// add JavaFX 2.0 to the unmanaged classpath
unmanagedJars in Compile += Attributed.blank(file(System.getenv("JAVA_HOME") + "/jre/lib/jfxrt.jar"))

// publish test jar, sources, and docs
publishArtifact in Test := false

// disable publishing of main docs
publishArtifact in (Compile, packageDoc) := false

// change the classifier for the docs artifact
artifactClassifier in packageDoc := Some("doc")

// Copy all managed dependencies to <build-root>/lib_managed/
//   This is essentially a project-local cache and is different
//   from the lib_managed/ in sbt 0.7.x.  There is only one
//   lib_managed/ in the build root (not per-project).
retrieveManaged := true

/* Specify a file containing credentials for publishing. The format is:
realm=Sonatype Nexus Repository Manager
host=nexus.scala-tools.org
user=admin
password=admin123
*/
credentials += Credentials(Path.userHome / ".ivy2" / ".credentials")

// Directly specify credentials for publishing.
credentials += Credentials("Sonatype Nexus Repository Manager", "nexus.scala-tools.org", "admin", "admin123")

publishMavenStyle := true

publishTo := Some(Resolver.file( "file",  new File( Path.userHome + "/.m2/repository" )) )
# End

Java 7 up to Update 5 already includes JavaFX 2.1. Therefore there is no need to explicitly install in the jfxrt.jar inside a Maven directory. However, I am unsure how to link ScalaFX with JavaFX 2.2 beta and 3.0 code from the OpenJfx repositories; and how the platform toolkit with those codebases for Mac OS X explicitly loads native libraries at initialisation.

On a new Mac OS machine, especially Lion, you will definitely want to re-enable Java to run inside web browsers. You might also want to prefer to use as a default the Java SE 7 from Oracle instead of the Apple JDK 6 release. Fire up the Java Preferences App. Open a terminal and execute the following command at the Bash shell prompt.

> ls -lF /Applications/Utilities/Java\ Preferences.app/Contents/MacOS/Java\ Preferences 
-rwxr-xr-x  1 root  wheel  39072 18 Jul 02:55 /Applications/Utilities/Java Preferences.app/Contents/MacOS/Java Preferences*
> /Applications/Utilities/Java\ Preferences.app/Contents/MacOS/Java\ Preferences  

Re-enable JRE to run inside all of your installed web browsers: Firefox, Chrome and Safari. Select Java 7 Runtime Environment with the mouse, drag it to the top of the list. Check that Java 7 is now the default.

> /usr/libexec/java_home
/Library/Java/JavaVirtualMachines/1.7.0.jdk/Contents/Home

You can add this call to your ~/.bash_profile script, so your Java environment is automated every time you fire up a terminal command.

export JAVA_HOME=`/usr/libexec/java_home`

export PATH=${JAVA_HOME}/bin:${JAVA_HOME}/jre/bin:[whatever your path was before>]

Finally, the java_home program can dump a list of your installed JREs.

macosx [248] > /usr/libexec/java_home -V
Matching Java Virtual Machines (3):
    1.7.0_05, x86_64:	"Java SE 7"	/Library/Java/JavaVirtualMachines/1.7.0.jdk/Contents/Home
    1.6.0_33-b03-424, x86_64:	"Java SE 6"	/System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home
    1.6.0_33-b03-424, i386:	"Java SE 6"	/System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home

/Library/Java/JavaVirtualMachines/1.7.0.jdk/Contents/Home
macosx [249] > /usr/libexec/java_home -X
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<array>
	<dict>
		<key>JVMArch</key>
		<string>x86_64</string>
		<key>JVMBlacklisted</key>
		<false/>
		<key>JVMBundleID</key>
		<string>com.oracle.java.7u05.jdk</string>
		<key>JVMEnabled</key>
		<true/>
		<key>JVMHomePath</key>
		<string>/Library/Java/JavaVirtualMachines/1.7.0.jdk/Contents/Home</string>
		<key>JVMIsBuiltIn</key>
		<false/>
		<key>JVMName</key>
		<string>Java SE 7</string>
		<key>JVMPlatformVersion</key>
		<string>1.7</string>
		<key>JVMVendor</key>
		<string>Oracle Corporation</string>
		<key>JVMVersion</key>
		<string>1.7.0_05</string>
	</dict>
	<dict>
		<key>JVMArch</key>
		<string>x86_64</string>
		<key>JVMBlacklist
        ...
</plist> 

+PP+

ScalaFX – Some Workarounds for SBT Issues

July 24th, 2012 Comments off

ScalaFX build does not work out of the box with SBT. Here is a little bit of extra help if you are new to ScalaFX, Scala and SBT; and are attempting to build the project yourself.

The Plugin configuration has the wrong URL, if your set up does not allow GIT as HTTP protocol. Fortunately, one can easily fix this by changing it to HTTPS.

Edit projects/plugins/project/PluginBuild.scala file

import sbt._

object MyPlugins extends Build {
  lazy val root = Project("root", file(".")) dependsOn (junitXmlListener)
  lazy val junitXmlListener = uri("git://github.com/ijuma/junit_xml_listener.git#fe434773255b451a38e8d889536ebc260f4225ce")
}

Change the Protocol from "git://..." to "https://github.com"

Next, edit the build.sbt in the root folder of the project. Uncomment or remove the line:-

testListeners <<= target.map(t => Seq(new eu.henkelmann.sbt.JUnitXmlTestsListener(t.getAbsolutePath)))

I am unsure why the Xml test listener was needed in the first place. However, we do not need it out of the box to compile and build the project.

Finally, upgrade the Scala version of the project to a 2.9.2 if you want

scalaVersion := "2.9.2"

In the ScalaFX, there are two source code roots.

unmanagedSourceDirectories in Compile <++= baseDirectory { base =>
  Seq(
    base / "src",
    base / "demo"
  )
}

No changes are required here. It is decidedly a un-Maven like structure for a project.

I believe, actually, we should split up the ScalaFX project into multiple modules. One module for the core and the other for the demonstrations. Lots of engineers are familiar with this type project organisation coming from Maven style world. The project committers, however, need to agree to this manoeuvre.

In the recent JavaPosse Episode 390, Dick Wall had some comments to say about the SBT. I agree with many of his comments that SBT is no longer a simple build tool. It is anything but. It is quite hard to get your head around this domain specific language and it is an illustration when such a DSL becomes a burden on the developer, its user base. Were it not for the fact that very fast build times are achievable, because of its incremental compilation features, I believe many users would leave SBT behind.

+PP+

Categories: Framework, JavaFX, Rich User Interface, Scala Tags:

Custom Ordering Scala TreeMap

July 12th, 2012 1 comment

How do you get custom ordering in a Scala TreeMap?

Well this puzzled me for a while. The answer lies in the world of implicits and receiver type converters.

In a nut shell, a scala.collection.immutable.TreeMap is a SortedMap. If you look at the documentation for TreeMap, you will see it takes an Ordering[T] as an implicit argument.

Normally when you declare a TreeMap, say inline, it will use the default Ordering object like so:-

scala> val dtm = TreeMap( "a" -> 1, "bc" -> 2, "def" -> 3 )
dtm: scala.collection.immutable.TreeMap1 = Map(a -> 1, bc -> 2, def -> 3)

If you want to change the ordering of the keys, for example, instead of the ascending order by String content, into, say, a descending order of strings length then you need an Ordering type.

scala> object VarNameOrdering extends Ordering[String] {
         def compare(a:String, b:String) = b.length compare a.length
       }
defined module VarNameOrdering

Now you can use the second argument list in an explicit fashion like this:

scala> val tm1 = TreeMap( "a" -> 1, "bc" -> 2, "def" -> 3 )( VarNameOrdering )
tm: scala.collection.immutable.TreeMap1 = Map(def -> 3, bc -> 2, a -> 1)

We pass the object to the TreeMap, which is rather similiar to a Java Collection Comparator object without the boilerplate instantiation. The keys of the TreeMap are now ordered by String lengths. We add more elements and the map will stay ordered.

 val tm2 = tm1 + ( "food" -> 4 )
cala.collection.immutable.TreeMap1 = Map(food -> 4, def -> 3, bc -> 2, a -> 1)

However, a word of caution, one needs to be careful and remember that maps are usually implemented as hashes.

scala> val tm3 = tm2 + ( "z" -> 5 )
tm3: scala.collection.immutable.TreeMap1 = Map(food -> 4, def -> 3, bc -> 2, z -> 5)

Surprised? You should be.

Another way to sort a map is just to get access to the keys and sort.

scala> dtm.keys.toList.sortWith ( _.length > _.length )
res3: List1 = List(salad, def, bc, a)

scala> dtm.keys.toList.sortWith ( _.length > _.length ).map( k => ( dtm.get(k).get ))
res4: List[Int] = List(10, 3, 2, 1)

scala> dtm.keys.toList.sortWith ( _.length > _.length ).map( k => ( k, dtm.get(k).get ))
res5: List[(java.lang.String, Int)] = List((salad,10), (def,3), (bc,2), (a,1))

This may well be a better solution, as you have not lost a key in flight! Considering how data is going to be stored is a major decision that needs to be taken early. You can always decide how to write projection of that data much later.

Finally, it is interesting to see the parallels between Java and Scala

scala> dtm.keys
res6: Iterable1 = Set(a, bc, def, salad)

scala> dtm.keys.toList
res7: List1 = List(a, bc, def, salad)

PS: I can safely say I have used Scala professionally today in financial enterprise.

Categories: Development, language, programming, Scala Tags: