tag:blogger.com,1999:blog-50729379519800928702024-03-18T02:47:51.399-07:00Jim Gough's BlogAnonymoushttp://www.blogger.com/profile/07726019498269380968noreply@blogger.comBlogger27125tag:blogger.com,1999:blog-5072937951980092870.post-23945397984300331722017-05-18T23:30:00.001-07:002017-05-18T23:34:20.024-07:00Getting Started: Introduce Coding Using Swift Playgrounds on iPad<div dir="ltr" style="text-align: left;" trbidi="on">
<a href="https://www.apple.com/uk/swift/playgrounds/" target="_blank">Swift Playgrounds</a> is an application for the iPad built by Apple to help developers learn how to write Swift applications.<br />
<blockquote class="tr_bq">
<span style="background-color: white; color: #333333; text-align: center;"><span style="font-family: inherit;">Swift Playgrounds is a revolutionary new app for iPad that makes learning Swift interactive and fun. Solve puzzles to master the basics using Swift — a powerful programming language created by Apple and used by the pros to build many of today’s most popular apps. [</span></span><a href="https://www.apple.com/uk/swift/playgrounds/">https://www.apple.com/uk/swift/playgrounds/</a>]</blockquote>
Although the application is designed primarily for developers, it can also be used to help engage children in coding. For younger children, this does require adult supervision to help with explaining what the function does.<br />
<br />
The session is designed for younger coders, for children aged 6 and upward it might be better to try the <a href="https://www.apple.com/retail/code/hourofcode_guide.pdf" target="_blank">Hour of Code</a> session created by Apple.<br />
<h2 style="text-align: left;">
Getting Started</h2>
<h3 style="text-align: left;">
Session Time</h3>
<div>
<br /></div>
<div>
Around 30 minutes</div>
<div>
<br /></div>
<h3 style="text-align: left;">
What you need</h3>
<div>
<br /></div>
<div>
<ul style="text-align: left;">
<li>An iPad, probably Air 2 or newer. The graphics that render are quite cool, but require some power. I haven't tried it on an older device, but it seems fine on the Air 2</li>
<li><a href="https://itunes.apple.com/gb/app/swift-playgrounds/id908519492?mt=8" target="_blank">Download Swift Playgrounds</a> from the Apple App Store</li>
<li>Download Learn to Code 1 as an in App download form the Swift Playgrounds app</li>
</ul>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhSc5AjYYLsMLhjapE8O0sCpcIeQiO6KGKh2A5p-Yhu3M8bkcZ0CEgI9ofQaxunbGqW6AXpkmLcrCtcQ3GTeyTFSkr1iq2EAH6-nj4UgaSNpWTuVfEH3htkDkCf3BYAI9fsUFE6hPSvrQw/s1600/IMG_0236.PNG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="240" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhSc5AjYYLsMLhjapE8O0sCpcIeQiO6KGKh2A5p-Yhu3M8bkcZ0CEgI9ofQaxunbGqW6AXpkmLcrCtcQ3GTeyTFSkr1iq2EAH6-nj4UgaSNpWTuVfEH3htkDkCf3BYAI9fsUFE6hPSvrQw/s320/IMG_0236.PNG" width="320" /></a></div>
<h3 style="text-align: left;">
<b>Preparation </b></h3>
<div class="separator" style="clear: both; text-align: left;">
</div>
<ul style="text-align: left;">
<li>It is worthwhile taking a look around the app and getting familiar with how it works. You don't really need any significant programming experience. The session will focus on moving an alien around the screen to pick up gems and activate switches</li>
<li>For younger children the trainer will need to help with reading skills and choosing the correct function. The functions are <span style="font-family: "courier new" , "courier" , monospace;">moveForward()</span>, <span style="font-family: "courier new" , "courier" , monospace;">turnLeft()</span>, <span style="font-family: "courier new" , "courier" , monospace;">collectGem()</span>, <span style="font-family: "courier new" , "courier" , monospace;">toggleSwitch()</span>. If you haven't come across the term function before, just think of it as an action the alien will perform</li>
<li>This session is really just a game, there's no programming loops just yet. These are for a different session</li>
<li>You will probably find you can run this same session many times, children really like the interaction and ease of controlling the alien</li>
</ul>
<h3 style="text-align: left;">
Controls & Leading Play</h3>
<div>
<ul style="text-align: left;">
<li>Controls are as simple as pressing the name of the functions (actions) that you need. To go forward twice pick the <span style="font-family: "courier new" , "courier" , monospace;">moveForward()</span> function twice. Think of it like playing a step-by-step platform game</li>
<li>If the child says they're not sure what's next just run the program. The alien finishes up at the last instruction and then you can correct. <b>Allow the child to make mistakes</b>, this is really important and it's OK to not have the correct solution first time. They'll struggle later if this isn't done right from the beginning as the problems become more complex</li>
<li>Let them hold the iPad and control the pressing. You might want to have a small session where you show them first, but they will get more from being the one pressing the buttons</li>
</ul>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgrdT2XU4jc_1ig_mMkSrpQYs3h5ASx4djEQgbjMMEd2FRqGpoL7ggLyQyhrqzsHTg3-QtDl2Zeyf3A6oazT-_VH8Et1UYf1HTC50gIbAzvIi-zzN6DrmcrE6VI5eyF6V6l8fNXAkOphrU/s1600/IMG_0238.PNG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="240" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgrdT2XU4jc_1ig_mMkSrpQYs3h5ASx4djEQgbjMMEd2FRqGpoL7ggLyQyhrqzsHTg3-QtDl2Zeyf3A6oazT-_VH8Et1UYf1HTC50gIbAzvIi-zzN6DrmcrE6VI5eyF6V6l8fNXAkOphrU/s320/IMG_0238.PNG" width="320" /></a></div>
<div>
<br /></div>
</div>
<br />
<div>
The screen has a description and extra instructions of what needs to be done. The code is the list of instructions at the bottom left. Run my code/stop is at the bottom of the screen. </div>
</div>
<div>
<br /></div>
<h3 style="text-align: left;">
Lessons to Try</h3>
<div>
For a thirty minute session the following are probably enough to get started. I've also outlined some things to discuss and think about each lesson and a sample solution.<br />
<br />
<ul style="text-align: left;">
<li>Issuing Commands</li>
<li>Adding a New Command</li>
<li>Toggling a Switch</li>
<li>Portal Practice</li>
<li>Finding and Fixing Bugs</li>
<li>Bug Squash Practice</li>
<li>The Shortest Route</li>
</ul>
<div>
Below are some sample solutions that we came up with:</div>
<div>
<span style="line-height: 16px;"><br /></span></div>
<script src="https://gist.github.com/jpgough/1551ef0361059ca1afede58d9bd94839.js"></script>
</div>
<div>
In the next lesson we will look at how to make use of the Functions module and how to use that for teaching. </div>
</div>
Anonymoushttp://www.blogger.com/profile/07726019498269380968noreply@blogger.com1tag:blogger.com,1999:blog-5072937951980092870.post-33170999311793615092017-05-12T12:27:00.000-07:002017-05-12T12:27:59.020-07:00Kids Code Introduction<div dir="ltr" style="text-align: left;" trbidi="on">
<div class="separator" style="clear: both; text-align: left;">
In recent years my blog has been fairly empty, life in general has taken over most of my free time. We have two small children aged 4 and 7 months, who are hard work but a lot of fun. The way in which children interact with technology fascinates me, Emily is quicker at using the iPad than her grandparents! Inspired by <a href="http://www.devoxx.co.uk/">Devoxx UK</a>, I have decided to try get back into community work. </div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
For the last three years I have taught over 500 developers fresh from University how to code better and prepare for a career that is more than just hacking they may have done at Uni. Most of the trainees have significant experience coding and the rest have at least started their journey. Often friends who don't program ask "<i>How do I get into coding</i>" or "<i>How would I got about writing an app</i>". It's very difficult to explain what coding is to an adult, so how do you get this across to a child that is just learning to read and write?</div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj9KK61gBBsBD5V46nfVb3bfxz8oxtWgrnD44HWEkkPs9z1KHLbXp-rrom_nKmdLUkvfYMl6dH1DJ85CPJbuVkfz8VAajcI4c662BaHpjCp0Vy4ht7CmkyMKa0M5Mus3m9FY0EZfxF_E2c/s1600/graduation.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="240" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj9KK61gBBsBD5V46nfVb3bfxz8oxtWgrnD44HWEkkPs9z1KHLbXp-rrom_nKmdLUkvfYMl6dH1DJ85CPJbuVkfz8VAajcI4c662BaHpjCp0Vy4ht7CmkyMKa0M5Mus3m9FY0EZfxF_E2c/s320/graduation.jpg" width="320" /></a></div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
The are many educational games and activities targeting children, particularly for basic math and letters. Seeing how excited my daughter got by playing these games it inspired me to look at ways I could teach her the basics of programming. I wanted it to be something that we could do interactively together and that she also enjoyed spending time on. Making things fun is important, regardless of age group. An engaged trainee that is following a narrative or story along with hands on experience is usually the most successful in retaining information. </div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
In the blog posts to follow I'll be writing about the mini-training session plans I am working on with Emily (4 years old). Like any good training there should be some objectives and an understanding of the trainee:</div>
<div class="separator" style="clear: both; text-align: left;">
</div>
<ul style="text-align: left;">
<li><b>Make coding and thinking in a structured way appealing to children</b>. The goal here is not for Emily to join a start-up or to get to 10 and be a computer genius. It's adding an extra layer of thinking and approach to problems that schools are just getting to grips with. </li>
<li><b>Sessions are no more than 30 minutes</b>, anything longer and a young child may resent the task. I've found that it's also OK if they want to go and do something else, just start the session again from the beginning (if they remember they'll usually tell you). </li>
<li><b>Being able to read is not necessary</b>, but will help. We started this process before Emily could read, and now she can recognise some letters. We work together on choosing the right function calls and code as we go. Initially I drove that, but now she is much more confident in choosing the right functions.</li>
<li><b>Is not always on a computer</b>. Some of the sessions that I am planning are not on the computer at all, but will have tasks that related to designing and executing instructions. </li>
</ul>
<div>
Below is a video from one of my first training sessions with Emily. We are using software on the iPad called <a href="https://www.apple.com/uk/swift/playgrounds/" target="_blank">Swift Playgrounds</a>, which is designed to teach developers how to learn Swift. However some of the early content can be used to also teach children basic concepts in a fun game environment. This will be the subject of the first lesson plan that I will publish next week. This video is special to me personally as it shows that coding can be fun and rewarding, even from a young age. </div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<iframe allowfullscreen="" class="YOUTUBE-iframe-video" data-thumbnail-src="https://i.ytimg.com/vi/lHJ3KkmHz6k/0.jpg" frameborder="0" height="266" src="https://www.youtube.com/embed/lHJ3KkmHz6k?feature=player_embedded" width="320"></iframe></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
If you are interested in following the lesson plans please keep an eye on my <a href="http://javajimlondon.blogspot.co.uk/p/kids-code.html">Kids Code</a> page for links and on <a href="https://twitter.com/Jim__Gough">twitter</a>. Also please do comment or make suggestions, I hope you have as much fun as we are having. </div>
<br /></div>
Anonymoushttp://www.blogger.com/profile/07726019498269380968noreply@blogger.com0tag:blogger.com,1999:blog-5072937951980092870.post-17197521604521658942015-02-04T23:48:00.000-08:002015-02-04T23:48:31.269-08:00Pragmatic Functional Refactoring in Java 8<div dir="ltr" style="text-align: left;" trbidi="on">
<div style="line-height: 16px;">
<div style="line-height: normal;">
<span style="font-family: inherit;">Java 8 is here! Now the honeymoon period is over larger companies and innovators are starting to use the new features. However, Java 8 isn't just another version of Java, it fundamentally changes how you are able to approach problems.</span></div>
</div>
<div style="line-height: 16px;">
<span style="font-family: inherit;"><br /></span></div>
<div style="line-height: 16px;">
<span style="font-family: inherit;">"Java 8 and functional programming is not just for beards" -- <a href="https://twitter.com/raouluk">Raoul</a>, and is now available to developers in general. Many business problems can be expressed in an easier way than in a declarative style of programming. It is a well known fact however, if there is someone with a beard next to you they probably are a functional programmer. </span></div>
<div style="line-height: 16px;">
<span style="font-family: inherit;"><br /></span></div>
<div style="line-height: 16px;">
<span style="font-family: inherit;">The slide deck from <a href="http://www.jfokus.se/jfokus/index.jsp">JFokus</a> can be found <a href="http://www.jfokus.se/jfokus15/preso/Pragmatic%20Functional%20Refactoring%20with%20Java%208.pdf">here</a>, the session was also recorded by the <a href="http://virtualjug.com/pragmatic-functional-refactoring-with-java-8/">VirtualJug</a> in September last year.</span></div>
<div style="line-height: 16px;">
<span style="font-family: inherit;"><br /></span></div>
<div>
<span style="font-family: inherit;"><span style="line-height: 16px;">The talk is aimed at making functional techniques relevant to programmers and takes the approach of introducing a problem and how it can be solved using </span></span><span style="line-height: 16px;">functional</span><span style="font-family: inherit;"><span style="line-height: 16px;"> techniques. The good thing about this style is that the emphasis on how to apply functional programming techniques is not bogged down in buzzwords or potentially confusing terminology. </span></span></div>
<div>
<span style="font-family: inherit;"><span style="line-height: 16px;"><br /></span></span></div>
<div>
<span style="font-family: inherit;"><span style="line-height: 16px;">The talk starts out with a problem we often face as software developers. Initially we have </span></span><span style="line-height: 16px;">simple requirements that over time change and if the code is not designed correctly or refactored when necessary can be unwieldily and difficult to maintain. The problem domain introduced is around invoices:</span></div>
<div>
<ul style="text-align: left;">
<li><span style="line-height: 16px;">Filtering all customers of a specific name</span></li>
<li><span style="line-height: 16px;">Later we want to process different customers rather than a fixed customer</span></li>
<li><span style="line-height: 16px;">We also now want to separate out different functions with that company that may have a different suffix representing the type of activity carried out</span></li>
<li><span style="line-height: 16px;">We also now want to state whether we want the invoice included or not</span></li>
</ul>
<div>
<span style="line-height: 16px;">The result is some fairly messy code:</span><br />
<span style="line-height: 16px;"><br /></span></div>
<script src="https://gist.github.com/jpgough/1f126bb3e97a9cdc499c.js"></script>
</div>
<div>
<span style="line-height: 16px;"><br /></span></div>
<div>
<span style="line-height: 16px;">From the messy code the talk goes on to look at how applying functional methods can reduce some of the problems. Introducing the <span style="font-family: Courier New, Courier, monospace;"><a href="http://docs.oracle.com/javase/8/docs/api/java/util/function/Predicate.html">Predicate</a></span> interface from the Java 8 API allows a test for whether an invoice should be included. This simplifies the code dramatically as the test for inclusion of an invoice can be packaged up and passed into the method as a function. This is the core of how first-class functions work, allowing a function to be passed around as a first-class citizen in the language. The introduction of method reference is shown as an intermediate step, but we finally see our lambda solution that makes everything quite clear. As a <span style="font-family: Courier New, Courier, monospace;"><a href="http://docs.oracle.com/javase/8/docs/api/java/util/function/Predicate.html">Predicate</a></span> is a functional interface the test can be passed in as a simple lambda expression. The intent of the code is now clear and considerably simplified:</span><br />
<span style="line-height: 16px;"><br /></span>
<script src="https://gist.github.com/jpgough/28ab8d36c24596686f97.js"></script>
<span style="line-height: 16px;"><br /></span>
<span style="font-family: inherit; line-height: 16px;">Compositing functions together to create more advanced predicates is next on the agenda, introducing how more complex functions can be combined together using the </span><span style="line-height: 16px;"><span style="font-family: Courier New, Courier, monospace;"><a href="http://docs.oracle.com/javase/8/docs/api/java/util/function/Predicate.html#and-java.util.function.Predicate-">and</a></span></span><span style="font-family: inherit; line-height: 16px;">, </span><span style="line-height: 16px;"><span style="font-family: Courier New, Courier, monospace;"><a href="http://docs.oracle.com/javase/8/docs/api/java/util/function/Predicate.html#or-java.util.function.Predicate-">or</a></span></span><span style="font-family: inherit; line-height: 16px;"> methods. Just as it's a bit weird to wonder how this is working, as a </span><span style="font-family: Courier New, Courier, monospace; line-height: 16px;"><a href="http://docs.oracle.com/javase/8/docs/api/java/util/function/Predicate.html">Predicate</a></span><span style="font-family: inherit;"><span style="line-height: 16px;"> is simply an interface we learn a new concept </span></span><a href="http://docs.oracle.com/javase/tutorial/java/IandI/defaultmethods.html" style="font-family: inherit; line-height: 16px;">Default Methods</a><span style="font-family: inherit;"><span style="line-height: 16px;"> introduced in Java 8. The discussion finishes with a conversation about how pipelines can be used to chain functions together, where the sequence of application is important. The </span></span><span style="line-height: 16px;">example</span><span style="font-family: inherit;"><span style="line-height: 16px;"> discussed is an E-Mail where first the content is created, followed by the spell </span></span><span style="line-height: 16px;">check</span><span style="font-family: inherit;"><span style="line-height: 16px;"> and the addition of the signature. </span></span></div>
<div style="line-height: 16px;">
<span style="font-family: inherit;"><br /></span></div>
<div>
<span style="font-family: inherit;"><span style="line-height: 16px;">The next topic for the pragmatic approach to refactoring is </span></span><span style="line-height: 16px;">currying and partial application. Currying is a tricky topic to initially wrap your head around and involves taking an initial argument set and splitting them out, so parts of the overall logic can be reused as functions. The talk looks at how to refactor a conversation function to be used for converting common measurements such as temperature and mass. I like to think of the approach as at each step the initial argument set is locked down or partially applied. I definitely advise watching the section on currying, <a href="https://twitter.com/richardwarburto">Richard</a> and <a href="https://twitter.com/raouluk">Raoul</a> do a great job of explaining the concepts. Here is the example used in the presentation:</span><br />
<span style="line-height: 16px;"><br /></span>
<script src="https://gist.github.com/jpgough/10bcea58a03091dffef5.js"></script>
<span style="line-height: 16px;"><br /></span><span style="line-height: 16px;">Mutability is problematic, specifically where developers make things mutable that would be far better modelled as immutable objects. Mutability can introduce subtle bugs where a developer takes a reference and updates an object - however it could be years before that actually manifests itself as a production problem and can be tricky to find. There are however some cases where you need to use mutable objects and this is fine. The key is to use the right design for the right requirements within your application. </span><br />
<div>
<div style="line-height: 16px;">
<span style="font-family: inherit;"><br /></span></div>
<div style="line-height: 16px;">
<span style="font-family: inherit;">The talk goes on to cover </span><span style="font-family: Courier New, Courier, monospace;"><a href="http://docs.oracle.com/javase/8/docs/api/java/util/Optional.html">Optional</a></span><span style="font-family: inherit;"> and how it can be used to help prevent </span><span style="font-family: Courier New, Courier, monospace;">NullPointerExceptions</span><span style="font-family: inherit;"> in chained code and provide the ability for a developer to provide default values or return a slightly different result. Another key benefit of </span><span style="font-family: Courier New, Courier, monospace;"><a href="http://docs.oracle.com/javase/8/docs/api/java/util/Optional.html">Optional</a></span><span style="font-family: inherit;"> is the removal of lots of boilerplate null checks that can lead to issues around code readability. This part of the talk is extremely clever and introduces a practical case for the </span><span style="font-family: Courier New, Courier, monospace;"><a href="http://docs.oracle.com/javase/8/docs/api/java/util/stream/Stream.html#flatMap-java.util.function.Function-">flatMap</a></span><span style="font-family: inherit;"> method on </span><span style="font-family: Courier New, Courier, monospace;"><a href="http://docs.oracle.com/javase/8/docs/api/java/util/stream/Stream.html">Stream</a></span><span style="font-family: inherit;"> to get at the contents of the </span><span style="font-family: Courier New, Courier, monospace;"><a href="http://docs.oracle.com/javase/8/docs/api/java/util/Optional.html">Optional</a></span><span style="font-family: inherit;"> container. I actually heard several developers comment on how useful this was to them after the talk. </span></div>
<div style="line-height: 16px;">
<span style="font-family: inherit;"><br /></span></div>
<span style="font-family: inherit;"><span style="line-height: 16px;">The talk is a taster of the full course </span></span><span style="line-height: 16px;">that</span><span style="font-family: inherit;"><span style="line-height: 16px;"> is run by myself, <a href="https://twitter.com/richardwarburto">Richard</a> and </span></span><a href="https://twitter.com/raouluk" style="line-height: 16px;">Raoul</a><span style="font-family: inherit;"><span style="line-height: 16px;"> More information can be found on our <a href="http://java8training.com/">training site</a>, with public course running in Switzerland, United Kingdom and Sweden in the coming months. </span></span><br />
<div style="line-height: 16px;">
<span style="font-family: inherit;"><br /></span></div>
</div>
</div>
<div style="line-height: 16px;">
<br /></div>
</div>
Anonymoushttp://www.blogger.com/profile/07726019498269380968noreply@blogger.com0tag:blogger.com,1999:blog-5072937951980092870.post-3314242484924020772015-02-03T15:56:00.000-08:002015-02-03T15:56:10.626-08:00JFokus 2015 First Impressions<div dir="ltr" style="text-align: left;" trbidi="on">
<div style="text-align: left;">
<span style="font-family: -apple-system-font; font-size: 12px; line-height: 16px;">In the centre of Stockholm, on a snowy first week of February, is the start of <a href="http://www.jfokus.se/jfokus/index.jsp">JFokus</a> 2015. When I say cool it's currently -2</span><span style="font-family: -apple-system-font; font-size: 12px; line-height: 16px;">°C with a "feels like" </span><span style="font-family: -apple-system-font; font-size: 12px; line-height: 16px;">-11</span><span style="font-family: -apple-system-font; font-size: 12px; line-height: 16px;">°C. The conference is a three day event, the first consisting of tutorials, the second and third are traditional conference session styles. </span></div>
<div style="text-align: left;">
<span style="font-family: -apple-system-font; font-size: 12px; line-height: 16px;"><br /></span></div>
<div style="text-align: left;">
<span style="font-family: -apple-system-font;"><span style="font-size: 12px; line-height: 16px;">I came unprepared for Stockholm, and for future reference (mainly for myself) packing the extra items is recommended:</span></span></div>
<div style="text-align: left;">
</div>
<ul style="text-align: left;">
<li><span style="font-family: -apple-system-font;"><span style="font-size: 12px; line-height: 16px;">A hat. Only the speakers get the cool JFokus red hats!</span></span></li>
<li><span style="font-family: -apple-system-font;"><span style="font-size: 12px; line-height: 16px;">Proper shoes, the snow is amazing here. It falls and everything just continues on as normal. The only effort I have seen of any snow being removed was a guy shovelling it off the roof of <a href="http://en.wikipedia.org/wiki/Stockholm_Central_Station">Stockholm Central Station</a>. At least there was a barrier around the target area, on the pavement.</span></span></li>
<li><span style="font-family: -apple-system-font;"><span style="font-size: 12px; line-height: 16px;">A decent coat for when you're outside, a fleece doesn't really do it.</span></span></li>
</ul>
<div>
<span style="font-family: -apple-system-font;"><span style="font-size: 12px; line-height: 16px;">When I got to the hotel on Monday I felt very unwell, got an early check-in and went straight to bed. I missed the majority of the first day except a few beers with </span><a href="https://twitter.com/raouluk" style="font-size: 12px; line-height: 16px;">Raoul</a><span style="font-size: 12px; line-height: 16px;">, </span><a href="https://twitter.com/richardwarburto" style="font-size: 12px; line-height: 16px;">Richard</a><span style="font-size: 12px; line-height: 16px;"> and </span><a href="https://twitter.com/heathervc" style="font-size: 12px; line-height: 16px;">Heather</a><span style="font-size: 12px; line-height: 16px;">. The hotel bar was alive with conversations about the VM Tech Summit, which sounds to have proved popular with the attendees. </span></span></div>
<div>
<span style="font-family: -apple-system-font;"><span style="font-size: 12px; line-height: 16px;"><br /></span></span></div>
<div>
<span style="font-family: -apple-system-font;"><span style="font-size: 12px; line-height: 16px;">Tuesday morning I got up and explored the hotel prior to the keynote starting. The hotel is next to Central Station, but navigating to it seems impossible. Almost everyone has a story about how they ended up in the wrong place or took about 6-7 different streets to get there. Waterside is a decent venue, with lots of space for the 1700 conference delegates.</span></span></div>
<div>
<span style="font-family: -apple-system-font;"><span style="font-size: 12px; line-height: 16px;"><br /></span></span></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg1N43z5b6HeDpNTa2gnx0r0fZomanFYHpL6cB9SWzsGPHcR_lAt2Q5JcEzXOQyxCmF5pocPAIqjtrAh5Q9WOt2D4pA8xopK8zkFgPlRswus-AepsK-vd33sd23hcdWECzcRraCdYSzPBg/s1600/IMG_0307.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg1N43z5b6HeDpNTa2gnx0r0fZomanFYHpL6cB9SWzsGPHcR_lAt2Q5JcEzXOQyxCmF5pocPAIqjtrAh5Q9WOt2D4pA8xopK8zkFgPlRswus-AepsK-vd33sd23hcdWECzcRraCdYSzPBg/s1600/IMG_0307.JPG" height="240" width="320" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
<span style="font-family: -apple-system-font;"><span style="font-size: 12px; line-height: 16px;">The conference kicked off with a guy with a tape measure doing some robotic style dancing on the stage. My initial reaction was:</span></span></div>
<div align="center">
<blockquote class="twitter-tweet" lang="en">
<div style="text-align: left;">
<a href="https://twitter.com/hashtag/jfokus?src=hash">#jfokus</a> an enthusiastic developer takes the stage</div>
<div style="text-align: left;">
— Jim Gough (@JavaJimLondon) <a href="https://twitter.com/JavaJimLondon/status/562522517114748928">February 3, 2015</a></div>
</blockquote>
<script async="" charset="utf-8" src="//platform.twitter.com/widgets.js"></script>
</div>
<div class="separator" style="clear: both; text-align: left;">
<span style="font-family: -apple-system-font;"><span style="font-size: 12px; line-height: 16px;">The "developer" was the joined by some other dancers to a pretty decent routine. The stage was then taken by <a href="https://twitter.com/matkar">Mattias Karlsson</a>, sadly we did not get to see any of his dance moves. The main room is impressive here, with room for most of the delegates.</span></span></div>
<div class="separator" style="clear: both; text-align: left;">
<span style="font-family: -apple-system-font;"><span style="font-size: 12px; line-height: 16px;"><br /></span></span></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjiccDrtC4l9tw9WVsayFm_j54QIIa0pfWC6SL_oAirCbEjAOmXuk-OM94qGqj_KR5shBMGKsETIJacaA1AWSBsSCIPIAprecmQYVcCS3CwmnWK848NFuQ5XkfTnyAc3EYLU2SCm4A_s2E/s1600/IMG_0304.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjiccDrtC4l9tw9WVsayFm_j54QIIa0pfWC6SL_oAirCbEjAOmXuk-OM94qGqj_KR5shBMGKsETIJacaA1AWSBsSCIPIAprecmQYVcCS3CwmnWK848NFuQ5XkfTnyAc3EYLU2SCm4A_s2E/s1600/IMG_0304.JPG" height="240" width="320" /></a></div>
<div class="separator" style="clear: both; text-align: left;">
<span style="font-family: -apple-system-font;"><span style="font-size: 12px; line-height: 16px;"><br /></span></span></div>
<div class="separator" style="clear: both; text-align: left;">
<span style="font-size: 12px; line-height: 16px;">On day 2 I attended only a few talks.</span></div>
<div class="separator" style="clear: both; text-align: left;">
</div>
<ul style="text-align: left;">
<li><span style="font-size: 12px; line-height: 16px;">Christian Heilmann, <a href="http://www.jfokus.se/jfokus/talks.jsp#Youdon%27tneedanotherh">You don't need another hero app - you need one that survives the Thunderdrome</a></span></li>
<li><span style="font-size: 12px; line-height: 16px;">Richard Warburton, Raoul Urma, <a href="http://www.jfokus.se/jfokus/talks.jsp#PragmaticFunctionalR">Pragmatic Functional Refactoring with Java 8</a></span></li>
<li><span style="font-size: 12px; line-height: 16px;">Mark Reinhold, <a href="http://www.jfokus.se/jfokus/talks.jsp#Java9%3AMakeWayforModu">Make Way for Modules</a></span></li>
</ul>
<div>
<span style="font-size: 12px; line-height: 16px;">I am planning to write up each of the sessions over the coming weeks, along with some sessions from tomorrow. </span></div>
</div>
Anonymoushttp://www.blogger.com/profile/07726019498269380968noreply@blogger.com0tag:blogger.com,1999:blog-5072937951980092870.post-49779171889352748812014-08-03T06:20:00.002-07:002014-08-03T06:20:51.264-07:00Teaching ClassLoaders, Reflection and NIO2<div dir="ltr" style="text-align: left;" trbidi="on">
<div dir="ltr" style="text-align: left;" trbidi="on">
<div dir="ltr" style="text-align: left;" trbidi="on">
<div dir="ltr" style="text-align: left;" trbidi="on">
<div style="text-align: left;">
As a leader of the <a href="https://londonjavacommunity.wordpress.com/">London Java Community</a> and as a developer in several firms I have noticed one trait across Java developers. We are spoilt! We have nice APIs, abstractions, IDEs and build systems which means that often we don't appreciate some of the lower levels of what is actually happening within the Java ecosystem. Most people can get by without this knowledge, however in the situation that there is an outage or a problem and we simply have no idea why something has started to fail, it's not the best time to start reading up on advanced Java topics. </div>
<div>
<br />
Sometimes we think we have enough information, because in a topic like class loading it might be enough to say "<i>It's how Java loads classes</i>". In my opinion this lack of knowledge is fairly dangerous, so in the Advanced Java course I recently taught with <a href="http://www.matraining.com/">Mallon Associates</a> I wanted to build an example that would capture the attention of the delegates. It covers four topics that we may be forgiven for forgetting Java is capable of.<br />
<br />
The topics that I was aiming to teach amongst others were:<br />
<br />
<ul style="text-align: left;">
<li>NIO2 file watch service API</li>
<li>Classloaders</li>
<li>Compilation of code at runtime</li>
<li>Reflection</li>
</ul>
<div>
The example I came up with was the WatchingClassLoader. The WatchingClassLoader is a toy example which watches a folder for the arrival of a new file. When a file lands in the inbox it checks to see whether it is a <span style="font-family: Courier New, Courier, monospace;">.class</span> file or <span style="font-family: Courier New, Courier, monospace;">.java</span> file. If it is a <span style="font-family: Courier New, Courier, monospace;">.class</span><span style="font-family: Times, Times New Roman, serif;"> </span>file the class loader will load it, if it is a <span style="font-family: Courier New, Courier, monospace;">.java</span> file it first compiles it and then loads the compiled version. The main thread also holds a loop waiting for input into the terminal, this allows the user to specify a class and see via reflection the methods of the now loaded class within system. As the class loader is hierarchical if it is asked for a class it doesn't know about it defers to the parent. It works with simple classes that are in the default package (i.e. no package) - though it could be extended to be smarter. </div>
<div>
<br /></div>
<h3 style="text-align: left;">
WatchService</h3>
<div>
<br /></div>
<div>
The <a href="http://docs.oracle.com/javase/7/docs/api/java/nio/file/WatchService.html">WatchService</a> is a neat API that allows you to register a <a href="http://docs.oracle.com/javase/7/docs/api/java/nio/file/Path.html">Path</a> to monitor for a particular file based event to occur. You can specify the type of event that you are interested in using the <a href="http://docs.oracle.com/javase/7/docs/api/java/nio/file/StandardWatchEventKinds.html">StandardWatchEventKinds</a> class. Using the <span style="font-family: Courier New, Courier, monospace;">.take()</span><span style="font-family: Times, Times New Roman, serif;"> </span>method on the watcher blocks until that event occurs. In the final example this runs on a separate thread.<br />
<br /></div>
<script src="https://gist.github.com/jpgough/45dd9323f066adf8bb10.js"></script>
</div>
<h3 style="text-align: left;">
</h3>
<h3 style="text-align: left;">
Class Loader</h3>
<div>
<br />
It is possible to write your own class loader in Java. By default the class loader in Java looks on the classpath specified when running the java command - but more often this is provided from your build system specifying the path to all the library jars your running application will require. Class loading is lazy, so a class is only loaded into the system when it is first required - this is why your code can sometimes run for years and then when it goes down a spurious code path you suddenly find yourself with a <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/ClassNotFoundException.html">ClassNotFoundException</a>.<br />
<br />
Writing a custom class loader gives you the opportunity to change this default behaviour. Examples of class loaders might be that when a class is requested it is loaded from a remote network location or your class files are stored in an encrypted format and the class loader is responsible for decrypting the file. In this case I just want to load the class in from where I am watching for new files to be added. To create your own class loader you need to extend the <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/ClassLoader.html">ClassLoader</a> abstract class.<br />
<br />
At minimum you need to be looking to override the <span style="font-family: Courier New, Courier, monospace;">loadClass</span> method and basically get a byte array of the contents of class file to load. From here you need to call <span style="font-family: Courier New, Courier, monospace;">resolveClass</span> and <span style="font-family: Courier New, Courier, monospace;">defineClass</span> to correctly load the class into the virtual machine. My system works by checking if the class aiming to be loaded is visible in the directory I am watching - otherwise it defers to the parent class loader to load the class. Class loaders are hierarchical in nature so this is an acceptable way of delegating upwards the loading of the class. The situation that this occurs in my mini example is when the user types something like <span style="font-family: Courier New, Courier, monospace;">java.lang.String</span> into the console. A cutdown example of how to do this is below.</div>
<div>
<br /></div>
<script src="https://gist.github.com/jpgough/c3eaf9446868a28e902c.js"></script>
</div>
<h3 style="text-align: left;">
Compiling on the Fly</h3>
<div>
<br />
One feature that surprised many of the people who took my course was that it is possible to invoke the Java Compiler from within an executing Java process. <a href="http://docs.oracle.com/javase/7/docs/api/javax/tools/ToolProvider.html">ToolProvider</a> allows us to get hold of the <a href="http://docs.oracle.com/javase/7/docs/api/javax/tools/JavaCompiler.html">JavaCompiler</a> and from there we can pass in a <a href="http://docs.oracle.com/javase/7/docs/api/javax/tools/JavaCompiler.CompilationTask.html">CompilationTask</a> which contains the <span style="font-family: Courier New, Courier, monospace;">.java</span> file we are looking to compile. This is best shown by example: </div>
<div>
<br /></div>
<script src="https://gist.github.com/jpgough/7e28b1e9f3af84877dbd.js"></script>
</div>
<h3 style="text-align: left;">
Reflection</h3>
<div>
<br />
The final stage is reflection, which allows the user to look at the <span style="font-family: Courier New, Courier, monospace;">.java</span> file or <span style="font-family: Courier New, Courier, monospace;">.class</span> file they have added to the running system. In a demo this is the closest we get to the wow moment :). Reflection is the Java mechanism that allows inspection of a class at runtime. Most people are using reflection, even if they don't know they are doing so, as it is heavily used in frameworks such as <a href="http://spring.io/">Spring</a>. In the example I just print out the methods as this is enough to prove the point, though on the actual course we use reflection for many other purposes including to invoke methods and generally prove what is possible. The simple snippet for allowing reflection on our classes via a custom class loader looks like this:</div>
<div>
<script src="https://gist.github.com/jpgough/913eddcd8ebfd8616a7e.js"></script>
<br />
<h3 style="text-align: left;">
The Full Project</h3>
</div>
<div>
</div>
<br />
You can find the full toy example that you can run and play around with on <a href="https://github.com/jpgough/watching-classloader">GitHub</a>. As this is a teaching example, there are plenty of places that this could be taken further - so I welcome any pull requests or tidy up to the code. It was actually something originally produced via live coding in front of the class, which has been a fairly tricky learning curve to get used to. That said now I wouldn't run a course without live coding, as it's where you get the most questions and although it's massively stressful it makes for a great session.</div>
</div>
Anonymoushttp://www.blogger.com/profile/07726019498269380968noreply@blogger.com0United States37.09024 -95.712891000000013-36.4181565 99.052733999999987 90 69.521483999999987tag:blogger.com,1999:blog-5072937951980092870.post-69694857995547360602014-07-12T08:41:00.000-07:002014-07-12T08:41:51.396-07:00Update and New Career<div dir="ltr" style="text-align: left;" trbidi="on">
I thought it was about time I dropped an update onto the blog about why I've been quiet recently and what has been going on.<br />
<br />
Early this year I decided to change career paths slightly and become a technical trainer. The highlights of my career as a developer have been to help others improve and learn from others in an informal supportive environment. I am now lucky enough to be able to do this full time designing new and fun ways of helping others learn Java, Python, C++ and .NET technologies. I work for my own company James Gough Ltd, with one primary client <a href="http://www.matraining.com/">Mallon Associates</a>. So far I've run ten training courses and had people booking onto my future courses, it's been challenging but one of the best things I've done. I have a fairly packed end to 2014 as I gear up for our 15 week training program.<br />
<br />
As well as working on private training I have also teamed up with <a href="http://www.insightfullogic.com/blog/">Richard Warburton</a> and <a href="http://www.urma.com/">Raoul-Gabriel Urma</a>. I am excited to announce will be offering <a href="http://java8training.com/">public Java 8 courses</a> with a focus on Lambdas and preparing Java developers for the changes that are right on our doorstep. Java as we know it is going to change, for years some developers have been dragging their feet with Java 1.4 style syntax and missing some key changes. An appreciation for the Object Oriented/Functional relationship is now required to both be able to design and build code that is succinct and solves the business problem in the best way.<br />
<br />
This year is very busy with it being my first year in business and getting married so sadly I've had to put conferences on hold for a year, but I'm hoping that early next year I can attend <a href="http://www.jfokus.se/jfokus/">jfokus</a>.<br />
<br />
<br /></div>
Anonymoushttp://www.blogger.com/profile/07726019498269380968noreply@blogger.com1tag:blogger.com,1999:blog-5072937951980092870.post-59619254212493723282014-01-24T10:55:00.000-08:002014-06-03T14:44:30.567-07:00Live Coding on Java 8 Date Time API<div dir="ltr" style="text-align: left;" trbidi="on">
<div dir="ltr" style="text-align: left;" trbidi="on">
Yesterday I recorded a live coding session on java.time. Below is all the information so you can code along if you like:<br />
<br />
<h3 style="text-align: left;">
The Video</h3>
<div>
<iframe allowfullscreen="" frameborder="0" height="315" src="//www.youtube.com/embed/OIg9lNpMJew" width="560"></iframe></div>
<div>
<br /></div>
<h3 style="text-align: left;">
The Source Code</h3>
<div>
All the source code is freely available on <a href="https://github.com/">github</a> you can get this running the following command:</div>
<script src="https://gist.github.com/jpgough/8603252.js"></script>
<div>
<br /></div>
<div>
The (brief) details for setting up the IDE can be found in the readme.<br />
<br />
<h3 style="text-align: left;">
The Slides</h3>
<iframe allowfullscreen="" frameborder="0" height="356" marginheight="0" marginwidth="0" scrolling="no" src="http://www.slideshare.net/slideshow/embed_code/30399058" style="border-width: 1px 1px 0; border: 1px solid #CCC; margin-bottom: 5px; max-width: 100%;" width="427"> </iframe> <br />
<div style="margin-bottom: 5px;">
<strong> <a href="https://www.slideshare.net/jpgough/java-8-date-time" target="_blank" title="Introduction to Java 8 java.time">Introduction to Java 8 java.time</a> </strong> from <strong><a href="http://www.slideshare.net/jpgough" target="_blank">Jim Gough</a></strong> <br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjir2kGrxlzj1wFkjd_siel6dbQB0gYoMgsmRlrn-AZOp1zzlTBvfEb3_RqO2CtlMOxNIAFhgOr90ti0mrVdrlwsXeILKc3NvKklfTvmHKgSAmoUDGEYKApbh8yn_1Qrh4UyJktYaM26xM/s1600/nighthacking.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjir2kGrxlzj1wFkjd_siel6dbQB0gYoMgsmRlrn-AZOp1zzlTBvfEb3_RqO2CtlMOxNIAFhgOr90ti0mrVdrlwsXeILKc3NvKklfTvmHKgSAmoUDGEYKApbh8yn_1Qrh4UyJktYaM26xM/s1600/nighthacking.png" /></a></div>
<br /></div>
</div>
<script src="https://raw.github.com/moski/gist-Blogger/master/public/gistLoader.js" type="text/javascript"></script>
</div>
</div>Anonymoushttp://www.blogger.com/profile/07726019498269380968noreply@blogger.com1tag:blogger.com,1999:blog-5072937951980092870.post-90124864393983941822014-01-20T09:40:00.001-08:002014-06-02T18:15:02.217-07:00Java 8 Date Time: Happy Martin Luther King Day<div dir="ltr" style="text-align: left;" trbidi="on">
<div dir="ltr" style="text-align: left;" trbidi="on">
Today is <a href="http://en.wikipedia.org/wiki/Martin_Luther_King,_Jr._Day">Martin Luther King Day</a> in the US. I had totally forgotten about this holiday until I saw a few tweets this morning about it. The interesting thing about this holiday is that rather than being on a specific day, it is on the third Monday of January.<br />
<br />
As I'm currently preparing some JSR-310 material, I thought it would be interesting to share (and discuss) <a href="http://download.java.net/jdk8/docs/api/java/time/temporal/TemporalQuery.html">TemporalQuery</a> - a new interface in Java 8 that makes it possible to write custom queries against the new DateTime classes. There is often a use case in business that an event happens that is unique to a particular domain, an example would be Futures market rolls of contracts or time periods of validity.<br />
<br />
<a href="http://download.java.net/jdk8/docs/api/java/time/temporal/TemporalQuery.html">TemporalQuery</a> allows us to capture the logic to perform an operation against a temporal class and return an object representing what we were querying. The interface is generic so we can choose what we return. This is a really neat design feature in Java 8 allowing us to externalise logic outside of the core API, but encapsulate the functionality as a data operation.<br />
<br />
TemporalQuery is also a <a href="http://download.java.net/jdk8/docs/api/java/lang/FunctionalInterface.html">FunctionalInterface</a> so it can be used as a lambda on a stream of temporals. In the example below we just consider one date. To find the next Martin Luther King day we can take the current date and perform the following:<br />
<br />
<span style="background-color: white; color: #666666; font-family: Helvetica, arial, freesans, clean, sans-serif; font-size: 14px; line-height: 19px;">LocalDate.now().query(new NextMartinLutherKingDayQuery());</span><br />
<span style="background-color: white; color: #666666; font-family: Helvetica, arial, freesans, clean, sans-serif; font-size: 14px; line-height: 19px;"><br /></span>
The NextMartinLutherKingDayQuery is our implementation of a TemporalQuery:<br />
<script src="https://gist.github.com/jpgough/8524155.js"></script>
<br />
Here are some things to note about the implementation:<br />
<br />
<ul style="text-align: left;">
<li>In the private method I take a date at the beginning of January of the year passed. Using a <a href="http://download.java.net/jdk8/docs/api/java/time/temporal/TemporalAdjuster.html">TemporalAdjuster</a> I manipulate that date to cycle it forward to where I want to be. TemporalAdjusters add more power than just plusDays or minusMonths to allow us to work on more expressive situations with date and time. </li>
<ul>
<li>The <a href="http://download.java.net/jdk8/docs/api/java/time/temporal/TemporalAdjusters.html">TemporalAdjusters</a> class has some really nice methods as used here, or you can write your own TemporalAdjuster if it doesn't exist. </li>
<li>NextOrSame is useful for this type of operation where we don't know what day we are on, but if it's the day we are querying we don't want to advance the day. We use it to iterate to the third Monday of the month of January in the year in question.</li>
</ul>
<li>I then use a the <a href="http://download.java.net/jdk8/docs/api/java/time/Period.html">Period</a> class to find out from the date passed whether Martin Luther King Day has passed, or it is today. If it has passed I return next year's date, otherwise returning this year's date. Period is a nice abstraction so I don't have to start subtracting millisecond values etc - yes we've all seen it. </li>
</ul>
<div>
If you're interested in playing around with this I suggest downloading the latest <a href="http://www.oracle.com/technetwork/java/javase/downloads/ea-jsp-142245.html">Java 8 beta</a> and having a go. </div>
<div>
<br /></div>
<div>
Happy Martin Luther King Day!</div>
</div>
</div>Anonymoushttp://www.blogger.com/profile/07726019498269380968noreply@blogger.com1tag:blogger.com,1999:blog-5072937951980092870.post-42242897228938838432014-01-18T18:04:00.000-08:002014-01-18T18:04:27.153-08:00User Group Visit to San Francisco<div dir="ltr" style="text-align: left;" trbidi="on">
<h4 style="text-align: left;">
Why am I in San Francisco? </h4>
<div>
Is it:</div>
<div>
<ul style="text-align: left;">
<li>A micro brewery pub crawl?</li>
<li>The fact it's almost 20<span style="background-color: #f9f9f9; font-family: sans-serif; font-size: 13px; line-height: 19.1875px; text-align: center;">°C </span><span style="background-color: #f9f9f9; text-align: center;">tomorrow?</span></li>
<li><span style="background-color: #f9f9f9; text-align: center;">To attend a Brazilian BBQ in January? </span></li>
</ul>
<div style="text-align: left;">
These things are certainly going to be a nice bonus of being here, however that's not the main reason. I'm here representing the <a href="http://londonjavacommunity.wordpress.com/">London Java Community</a> at Oracle's big annual <a href="http://www.iouc.org/">user group leaders</a> convention. The purpose of the conference is to bring leaders of a variety of different Oracle user groups together to discuss best practices and drive improvement of communities and involvement for all those concerned. Particularly this year the topics I am interested in and will be participating in are:</div>
</div>
<div style="text-align: left;">
<ul style="text-align: left;">
<li>Using social media - I'm particularly interested in discussing handling negative discussion and feedback via this extremely public forum.</li>
<li>Turning members into leaders and growing speaker talent. This has been an active stream in the LJC and <a href="http://mechanitis.blogspot.com/">Trisha Gee</a> and team have been doing a fantastic job of running workshop and helping people gain the courage to make that first talk. </li>
<li>Gamifiying your user group experience and improving user group content. I'm mainly interested in this because I get motivated by badges and awards for certain things. I think it could put a fun spin on how we run certain events in the LJC.</li>
</ul>
<div>
I plan to blog about interesting conversations and what comes out of these themes over the course of the week. The summit will only be the beginning of the discussions and I look forward to seeing more about what our members think to some of the ideas and which may work for us. </div>
<div>
<br /></div>
<div>
When discussing any kind of conference and benefits of conferences I always say that it doesn't have to be a specific talk that motivates you but a catalyst to change. All the major turning points in my career have been down to ideas gained at conferences. It will be interesting to be involved in a non technical conference across a range of different products, experiences and backgrounds. </div>
<div>
<br /></div>
<div>
I have very kindly had partial sponsorship from the <a href="http://londonjavacommunity.wordpress.com/">LJC</a> and the <a href="https://www.jcp.org/">JCP Program Office</a> to be here this week and I can't thank them both enough for the opportunity. </div>
<div>
<h4>
I am now a JCP Executive Committee Representative</h4>
<div style="text-align: left;">
Why are the JCP helping to sponsor my visit here? After 3 years of working on JSRs with the London Java Community with the LJC JCP committee I have now stepped up my involvement and represent the LJC directly with other <a href="https://jcp.org/ja/participation/committee">JCP executive committee members</a>. I am attending my first face-to-face meeting at the end of this week. I'm really thrilled to be working with so many fantastic organisations and individuals to help maintain and form standards within Java. As the meeting has official minutes it's unlikely I will post anything further. </div>
</div>
</div>
</div>
Anonymoushttp://www.blogger.com/profile/07726019498269380968noreply@blogger.com0tag:blogger.com,1999:blog-5072937951980092870.post-5724748766908142162013-11-27T04:52:00.001-08:002013-11-27T04:52:36.394-08:00Contributing to Java<div dir="ltr" style="text-align: left;" trbidi="on">
I have just written a post on contributing to Java for the <a href="http://londonjavacommunity.wordpress.com/">London Java Community</a>'s JCP Panel. You can find the full post here:<br />
<br />
<div style="text-align: center;">
<a href="http://londonjavacommunity.wordpress.com/2013/11/27/contributing-to-java-the-jspa-and-the-oca/">Contributing to Java: The JSPA and the OCA</a></div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj7gGMzYfw9b-DblzHHIoI9HM9EmnWEQgvQC-S_dqnaq4aHEM3ZLBPUqQN3G2i2S6WU_UnC5S2qtyVq-IZ63MxMP2_M_CHCApvKraG3e1iV_a75AjWXPUB74dFWK9C40zSR-ek_bEr1s48/s1600/LJC+Banner.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="137" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj7gGMzYfw9b-DblzHHIoI9HM9EmnWEQgvQC-S_dqnaq4aHEM3ZLBPUqQN3G2i2S6WU_UnC5S2qtyVq-IZ63MxMP2_M_CHCApvKraG3e1iV_a75AjWXPUB74dFWK9C40zSR-ek_bEr1s48/s320/LJC+Banner.png" width="320" /></a></div>
<br /></div>
Anonymoushttp://www.blogger.com/profile/07726019498269380968noreply@blogger.com0tag:blogger.com,1999:blog-5072937951980092870.post-44083991386175122852013-11-24T09:31:00.000-08:002013-11-24T09:31:34.691-08:00The LJC Open Conference 2013<div dir="ltr" style="text-align: left;" trbidi="on">
<div class="p1">
Yesterday I attended my 5th <a href="https://sites.google.com/site/ljcopenconference/">LJC open conference</a>, and as always it is one of my favourite times in the year. Most of the major conferences have been and gone and people are winding down ready for Christmas. However, the combined knowledge and enthusiasm of the community doesn’t reflect this slower time of year. </div>
<div class="p2">
<br /></div>
This year I got a lot more involved with helping in set up and planning board activities, as well as giving a talk on TDD primer. The session board looked like this first thing in the morning:<br />
<div class="p1">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhG2-zW-vh7wBxwhjkaetqRhrnQwDY1U7McUxBaNhAJM2-watFZ1uc98anB37Z217RREmq4E3pHSn-iGn6DbaAyB01mu6UwZjZoXmRsisio91UXhumc2VzCEWpmI1d4rSg9-fBQ_p8NWJ4/s1600/BZwCQJeIQAAGS2h.jpg-large.jpeg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="181" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhG2-zW-vh7wBxwhjkaetqRhrnQwDY1U7McUxBaNhAJM2-watFZ1uc98anB37Z217RREmq4E3pHSn-iGn6DbaAyB01mu6UwZjZoXmRsisio91UXhumc2VzCEWpmI1d4rSg9-fBQ_p8NWJ4/s320/BZwCQJeIQAAGS2h.jpg-large.jpeg" width="320" /></a></div>
<div class="p1">
<br /></div>
<div class="p1">
There are roughly 5 streams of topics at the conference, what interested me was the focus on development of people skills and testing of code - there was definitely a strong feel of <a href="http://www.meetup.com/london-software-craftsmanship/">craftsmanship</a> in the air. </div>
<div class="p1">
</div>
<ul style="text-align: left;">
<li>Core Java</li>
<li>Java EE/Application Servers</li>
<li>Testing tools and processes</li>
<li>Community and soft-skills</li>
<li>Workshops</li>
</ul>
<div>
The slides I gave for my talk are below, it's based on a longer talk I gave at <a href="http://jaxlondon.com/">JAX London</a>. The idea was to give people who haven't tried Test Driven Development before some guidance in getting started and what some of the pitfalls can be. Sadly I had a Mavericks and projector based issue, which meant I lost about 10 minutes of the talk. However, the show must go on so I covered the first slides without a project whilst the hero of the day <a href="https://twitter.com/jr0cket">John Stevenson</a> fixed the projector. Minstrels will write songs about this day...</div>
<div>
<br /></div>
<iframe allowfullscreen="" frameborder="0" height="356" marginheight="0" marginwidth="0" scrolling="no" src="http://www.slideshare.net/slideshow/embed_code/28573973" style="border-width: 1px 1px 0; border: 1px solid #CCC; margin-bottom: 5px;" width="427"> </iframe> <br />
<div style="margin-bottom: 5px;">
<strong> <a href="https://www.slideshare.net/jpgough/test-drive-development-primer" target="_blank" title="Test Drive Development Primer LJC Open Conference">Test Driven Development Primer LJC Open Conference</a> </strong> from <strong><a href="http://www.slideshare.net/jpgough" target="_blank">jpgough</a></strong> <br />
<br />
I got some good feedback on the talk - I need to refactor the examples in the slides a fair bit, this will be done when I put the information I presented at JAX into a blog series.<br />
<br />
I also went to a talk on testing with <a href="https://code.google.com/p/spock/">Spock</a>. It's not usually something I'd be particularly interested with it not being core Java, however it was interesting to see a different take on testing. I quite liked the way you can be verbose in your tests and get a lot of boilerplate you require in JUnit for free. The final talk I went to was on progressing your career without losing technical focus. A lot of people looking for mentorship and guidance at a senior level on how to remain technical. It was a good session, but only touched on a few issues in the time - it looks like something that could be run as a bigger round table.<br />
<br />
It was great to catch up with old friends and people I've worked with in the community over the years, especially now I am not in London as often. It's also helped me start to focus on my own learning plan for next year. It's always a motivating weekend and if you didn't get chance to go this year I can't recommend it enough. As always thanks to the sponsors <a href="http://www.ibm.com/uk/en/">IBM</a> for a great venue and beer from <a href="http://zeroturnaround.com/">Zero Turnaround</a> and some dodgy car salesman <a href="https://twitter.com/sjmaple">Simon Maple</a> for organising the event.<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh8D6M6uVZJr4cTdhP988TJhvSKhYpdRHmD2UMBL3Ina6Oqmz2WQgSl6RhcwPNXOXex_9JoNOeaYM5Pot1dg9odoRIj44oONnoFYReagYG_8O_lHAMtnjTd6LPBtJgsuHLWhtJIxgghUnU/s1600/BZxdlhLIgAAOjG-.jpg-large.jpeg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh8D6M6uVZJr4cTdhP988TJhvSKhYpdRHmD2UMBL3Ina6Oqmz2WQgSl6RhcwPNXOXex_9JoNOeaYM5Pot1dg9odoRIj44oONnoFYReagYG_8O_lHAMtnjTd6LPBtJgsuHLWhtJIxgghUnU/s320/BZxdlhLIgAAOjG-.jpg-large.jpeg" width="181" /></a></div>
<br /></div>
<div>
<br /></div>
</div>
Anonymoushttp://www.blogger.com/profile/07726019498269380968noreply@blogger.com0tag:blogger.com,1999:blog-5072937951980092870.post-8680704457069918342013-09-03T11:34:00.002-07:002013-09-03T11:34:48.727-07:00Leaving London and keeping in touch<div dir="ltr" style="text-align: left;" trbidi="on">
At the beginning of the beginning of the year Megan and I had our first child Emily and moved to Bedford. This sounds more severe than it actually was, the commute down from Bedford to Kings Cross is only around 40 minutes. It's been a busy 6 months since then working on multiple projects with <a href="http://www.stackthread.com/">Stackthread</a>, getting promoted to Vice President at the firm and as you can imagine not too much sleep.<br />
<br />
As a family, we have decided to take a step which will involve us spending a lot more time together - but sadly means that I will be leaving London as a work hub. Having just completed major project milestones at the bank I work for, I decided it was time for a change of roles and found an exciting opportunity in Milton Keynes. From a personal perspective this also cuts down a 2 hour commute (each way to Canary Wharf) to 20 minutes, and reduces my outgoing costs on expensive rail tickets.<br />
<br />
This has left me with many decisions to make about what projects to keep working on in London and how to keep in touch with specifically the <a href="http://www.meetup.com/Londonjavacommunity/">London Java Community</a> and the <a href="http://londonjavacommunity.wordpress.com/category/jcp-2/">London Java Community Process Committee</a>. For now, I'm not going to make any rash decisions and see how things pan out in terms of time available and what I realistically commit to. With ever limited time, I am trying not to spread my contributions too thinly and want to ensure that whatever I do chose to work on in the next few years has a solid impact.<br />
<br />
Currently, I next plan to be in London on:<br />
<br />
<ul style="text-align: left;">
<li>29th-30th October for JAX London.</li>
<li>One Saturday towards the end of November for the LJC Open Conference</li>
</ul>
<div>
<br /></div>
</div>
Anonymoushttp://www.blogger.com/profile/07726019498269380968noreply@blogger.com0tag:blogger.com,1999:blog-5072937951980092870.post-37396361670445795442013-09-03T03:00:00.000-07:002013-09-03T03:00:04.316-07:00JAX London 2013 - TDD: The Benefits are more than just the tests<div dir="ltr" style="text-align: left;" trbidi="on">
<i>An introduction to my talk at JAX 2013 - also published <a href="http://jaxlondonblog.tumblr.com/post/57156293229/tdd-the-benefits-are-more-than-just-the-tests?utm_source=buffer&utm_campaign=Buffer&utm_content=buffere47f4&utm_medium=twitter">here</a></i>.<br />
<br />
Back when I first started my career as a developer following University I was unleashed with little training in best practices, development methodologies or what to expect from the uncertainties in real world development. Before I could start to learn all these things I was quickly placed in my first job. The type of role I was placed into was fix problems and develop new features - with only guidance relating to the specific tasks at hand. There was no training on industry best practices, which underpin the quality of the software as professionals we strive to deliver - my own development languished.<br />
<br />
Several years on, in my own time and through quizzing various industry leading technologists like <a href="https://twitter.com/sandromancuso">Sandro Mancuso</a> (at JAX London 2012) and <a href="https://twitter.com/karianna">Martijn Verburg</a> (at numerous beverage centric establishments) I started to discover my personal points of improvement. I realised that there were steps I could take to improve the approaches I had in my toolbox for software problems. I took a look at my peers and people that were applying for job roles. Many listed Test Drive Development (TDD) as something that they used on a regular basis. I very quickly realised that a lot of people claim to practice TDD, but either don't do this at all or write integration tests rather than unit tests, as well as other ideas about what TDD is.<br />
<br />
My talk at JAX London 2013 is designed for developers who have been too busy to appreciate the less obvious benefits of TDD, particularly the side effects and task breakdown from a cognitive perspective. The session will cover the basics of TDD, the use of mocking and how this helps break up the coding complexity using code and architecture examples. I will also convey my own experience of converting to TDD along with the benefits I have realised and how to convince developers who don't want to test the approach has merits outside of just high test coverage. The talk does not aim to sell TDD, but instead present facts and experiences that I have gained over the last year so developers can form their own opinions.<br />
<br />
From taking these steps myself I produce code closer to the requirements, more maintainable code that is able to respond quickly to changes and my colleagues can look at the code and tests and quickly understand what is going on. Conferences are often the catalyst for personal improvement, and people interested in this space but haven't had time to explore it themselves will get some good practical advice on how to get going and what to expect.</div>
Anonymoushttp://www.blogger.com/profile/07726019498269380968noreply@blogger.com0tag:blogger.com,1999:blog-5072937951980092870.post-49186164177883883252013-03-27T13:00:00.000-07:002013-03-27T13:00:39.455-07:00My First Devoxx<div dir="ltr" style="text-align: left;" trbidi="on">
<h3 style="text-align: left;">
Venue and kick off</h3>
I've walked past the venue many times, but had never realised it was even there (standard London). The space feels huge, with plenty power points, great wifi and crap coffee. Perfect for a great conference venue. The space isn't just space, it's been well planned and thought out to enable a fantastic community feel and corridore track. The venue is nothing without setting the right tone and introduction for the rest of the conference, which is what the keynote delivered. Conferences without keynotes and setting expectations really don't ever get going. Right from the beginning <a href="http://www.devoxx.com/display/UK13/Dan+Hardiker+(speaker)">Dan Hardiker</a> made it clear that the most important part of the conference was the attendees and helping attendees to find something at the conference to help them improve as a developer. The conference was also supported by a <a href="http://www.devoxx.com/display/UK13/2013/03/22/Devoxx+Code+of+Conduct">code of conduct</a>, everyone is safe and knows the expectations here. This is also supported by the number of keen volunteers and organisers who have done a fantastic job of making the event in London bring in the community feel of Devoxx.<br />
<div align="center">
<blockquote class="twitter-tweet">
<a href="https://twitter.com/search/%23DevoxxUK">#DevoxxUK</a> has successfully transplanted the Devoxx "feel" to London. Lots of good content!<br />
— Stephen Colebourne (@jodastephen) <a href="https://twitter.com/jodastephen/status/316549632396259328">March 26, 2013</a></blockquote>
<script async="" charset="utf-8" src="//platform.twitter.com/widgets.js"></script></div>
<h3 style="text-align: left;">
Keynote</h3>
<div>
The keynote by <a href="http://www.devoxx.com/display/UK13/Kevlin+Henney">Kevlin Henney</a> bolstered the standard that is expected for speakers at Devoxx. The keynote "The Programmer" was thought provoking about how we see ourselves as professionals and how can draw comparisons between our experiences and other professions. It also explored different types of programmers and how their approaches to problems can be ineffective given the cognitive performance of humans. From the keynote I've taken away that I need to revisit my approach to development and time management, especially with my recent promotion. I also took away the fact I really need to work on one presentation and make it the best it can be rather than lots of smaller presentations. I've got an idea in mind which I am planning to submit to <a href="http://jaxlondon.com/">JAX London</a> and <a href="http://jz13.java.no/">Java Zone</a>, not saying it will be even close to this - but a new standard is set!<br />
<h3 style="text-align: left;">
Talk Highlights and Takeaways</h3>
</div>
<div>
I could write a blog post on every talk that I've been to whilst being at Devoxx, but I'll try and put together my thoughts and the talks that these have come from. Hopefully, if you're interested, you can then grab them from <a href="http://www.parleys.com/">Parleys</a>.</div>
<div>
<br /></div>
<div>
Are some of the people that are jumping to functional programming being immature in their choice? Jumping because it's the Justin Bieber of technologies and OO sucks (awesome quote <a href="https://twitter.com/sandromancuso">Sandro</a>). This was a <a href="http://www.devoxx.com/display/UK13/Functional+is+cool%2C+but+do+you+know+OO">great talk</a> about OO principles and good quality design. It certainly matched a few talks I have given recently about "Is Object Oriented Programming Still Relevant" and why it is important to strike practical balances between OO theory and design.<br />
<br />
There have been a few references to "<i>You do write at least unit tests right?</i>" - and I'm quite sure that the people that are at this conference do. However, how do we approach the rafts of developers that are not at conferences that don't write tests and believe that good design, software principles and tests are not conducive to being more productive? </div>
<div>
<br /></div>
<div>
<a href="http://www.devoxx.com/display/UK13/Charles+Nutter">Charles Nutter</a>'s talk on invoke dynamic has taken a concept that I'm vaguely familiar with and got me thinking about how practical this could be to day-to-day Java developers. The one usage I've been thinking of is dependency injection without the need to do reflection. I need to think about this some more, but I'm also wondering if this could have an impact with not requiring to define dependency hierarchies - and effectively lazily load these or parts of these as required. This definitely needs more beer talk time.</div>
<div>
<br /></div>
<div>
<a href="http://www.devoxx.com/display/UK13/Richard+Warburton">Richard Warburton</a> gave an excellent low level discussion of hardware features and how applications can struggle or thrive under certain conditions. I was glad it came with a disclaimer that these techniques won't be for everyone, as there is usually so many other things you can optimise before you'd get down to this level of crazy!</div>
<div>
<br /></div>
<div>
My thoughts have long been out on whether JavaScript is a complete solution for some of the more powerful products you can build in <a href="http://www.adobe.com/uk/products/flex.html">Flex</a> and action script. <a href="http://www.devoxx.com/display/UK13/AngularJS+-+Extend+your+browser">Angular JS</a> provides food for thought that there is a decent supporting framework to study in more detail. The main benefit seems to be a framework that supports a good separation of concerns and with that the testability that is required by large organised code bases.</div>
<div>
<br /></div>
<div>
I attended a few decent short talks on <a href="http://www.devoxx.com/display/UK13/assertImmutable+++Introducing+Mutability+Detector">Mutability Detector</a> and <a href="http://www.devoxx.com/display/UK13/Docx4j+-+Generating+Word+and+Excel+files">docx4j</a>, both of which I wouldn't have been interested in a full talk, but was good to get an introduction as will potentially use both of these in the future.</div>
<h3 style="text-align: left;">
Final Thoughts</h3>
<div>
<ul style="text-align: left;">
<li>Devoxx really is a community conference prepared and delivered by the community.</li>
<li>The atmosphere and friendly nature is something I've not seen outside of the LJC Open Conference at a large event in the past.</li>
<li>Thanks to all the organisers and volunteers for a fun and informative few days.</li>
<li>The conference is only just beginning, I must have only seen around 30% of what I wanted to see at Devoxx and now need a few more days to catch up with everything else on <a href="http://www.parleys.com/">Parleys</a>.</li>
<li>I've learnt a lot about Java, wider technologies and approaches to a wide range of technical problems and challenges. I think this conference would have been useful to developers of all levels.</li>
</ul>
</div>
</div>
Anonymoushttp://www.blogger.com/profile/07726019498269380968noreply@blogger.com0tag:blogger.com,1999:blog-5072937951980092870.post-16412634578994073822013-03-11T14:10:00.000-07:002013-03-11T14:10:12.814-07:00Devoxx London 2013, What I'm Excited about on day 1It's been a while since I last wrote a blog post! A lot has been going on since last years conference tour. The main thing has been the birth of my first child Emily, who is now 2 months old and growing well. As well as that I was promoted at work and have moved into a house in Bedford, what that does is I now have more time to write as I will be spending more of my life on a train.<br />
<br />
Sadly, I did not have time to get my act in gear to get a submission in for Devoxx UK, however I have managed to obtain a ticket and am very excited about the event. I plan to write a few blog posts at and about the event as I don't have any talks to prepare. It's an amazing difference to be going to my first technical conference as a delegate, and in this stress free environment I'm excited about what I can learn and contribute to the conference. Conferences have had a positive impact on my career so far. The conversations I had with <a href="https://twitter.com/sandromancuso">Sandro Mancuso</a>, <a href="https://twitter.com/kittylyst">Ben Evans</a>, <a href="http://www.kodewerk.com/">Kirk Pepperdine</a>, <a href="http://insightfullogic.com/blog/">Richard Warburton</a> and <a href="https://twitter.com/karianna">Martijn Verburg</a> and others have shaped the products that I have been working on and my approach to technology. You simply don't get this from the average day, and you have to come out of your environment and comfort zone to improve your technical skills and appreciate new points of view. If you're in London Devoxx is simple the best opportunity to do this until JAX London in November.<br />
<br />
I thought I'd highlight some talks that I'm very interested in that I think will be awesome (this doesn't mean I'm not interested in others, but these I will definitely attend)<br />
<br />
<a href="http://www.devoxx.com/display/UK13/55+New+features+in+Java+SE+8">55 New Features in Java 8</a><br />
<br />
Looking forward to this one as although I've been involved in a few projects related to SE 8 it will be great to learn what's coming next. After seeing some interesting statistics on Java 7 uptake recently it will be interesting to see how many people make the direct jump from 6 to 8. <br />
<br />
<a href="http://www.devoxx.com/display/UK13/Banking%2C+how+hard+can+it+be">Banking, How hard can it be?</a><br />
<br />
The title says it all really, and for anyone that's ever worked in banking I imagine there will be something in this talk that can be related to. I'm specifically interest in how companies are approaching more modern processes and techniques for benefitting their business and the success they have had with this. <br />
<br />
<a href="http://www.devoxx.com/display/UK13/Functional+is+cool%2C+but+do+you+know+OO">Functional is cool, but do you know OO</a><br />
<br />
Sandro is one of my favourite speakers and has had a positive influence to the way I approach problems. Recently I've run several sessions on "Is OO still relevant", so I'm hoping this will challenge my view point and maybe I will learn something about this functional programming business!<br />
<br />
<a href="http://www.devoxx.com/display/UK13/Performance+Testing+Java+Applications">Performance Testing Java Applications</a><br />
<br />
I've actually never seen Martin give a full presentation, and its always been in an informal setting I've spoken to him in the past. Often baseline performance of even non performance based systems is something that can easily be overlooked. I'm interested to understand more about how to even begin approaching systems where performance is a key business driver.<br />
<br />
<a href="http://www.devoxx.com/display/UK13/Hitting+the+limits+of+your+hardware+with+Java">Hitting the limits of your hardware with Java</a><br />
<br />
I've spoken to Peter once before at the <a href="http://londonjavacommunity.wordpress.com/">London Java Community</a> developer sessions and again was amazed to have access to an expert developer. At the time we were talking about ways to improve OpenJDK, some of the ideas and explanations behind his thoughts were excellent.<br />
<br />
I think that actually just about confirms my 1st day and the first thing I've noticed is the schedule is quite narrow in terms of choice. However, I'm struggling to pick sessions because there's so many I want to go to. Several conferences I have attended have almost too much choice. The content committee has done an awesome job of making my life difficult. Not being able to chose what to go to is awesome, looking forward to sharing what I'm thinking about day 2 shortly.Anonymoushttp://www.blogger.com/profile/07726019498269380968noreply@blogger.com0tag:blogger.com,1999:blog-5072937951980092870.post-70533900248834114562012-12-04T04:10:00.000-08:002012-12-04T04:10:03.075-08:00Can Flex/Flash ever be considered a RESTful client?One of the most relevant discussions in software development today is what will be the future of client technology? There are several platforms that as a business you might wish to deliver content to:<br />
<br />
<ul>
<li>Web</li>
<li>Desktop</li>
<li>Mobile/Tablet</li>
<li>E-Mail report delivery</li>
<li>The next big thing....</li>
</ul>
<div>
<br /></div>
<div>
You can potentially solve the problem by using <a href="http://www.html5rocks.com/en/">HTML 5</a> with <a href="http://en.wikipedia.org/wiki/JavaScript">JavaScript</a> to deliver to all platforms. However, this may lack the native feel you might want your application to have. This isn't really the point of the post, my main point is one considering the architecture of server side components. Given that it is likely that we will want to deliver content to multiple systems over time, my goal would be to make the client as thin as possible and have the majority of the business logic on the server side. There are exceptions to this and it does depend how rich you want to make your client side solution.</div>
<div>
<br /></div>
<div>
REST is rapidly becoming a natural choice for the situation where you want to deliver content to multiple clients. Flex is in some circles considered a legacy technology, and in others a lot of people have bet their business on it. The issue with Flex and the compatibility with REST is it has only two modes of operation: Success and Failure. It is possible to dig further into the failure to find the exact HTTP status code. The problem is on failure you can't access the body of the message, so if you're sending a reason for the failure back to the client there is no way to capture this in Flex. The problem is discussed briefly <a href="http://stackoverflow.com/questions/4483004/getting-http-500-response-body-with-flex">here</a>. If you have to start wrapping everything in success to get at the underlying error, you defeat one of the purposes in having REST in the first place. Another <a href="http://forums.adobe.com/thread/438940">forum post</a> on <a href="http://www.adobe.com/">Adobe</a> informs us that this is a browser/plugin issue, as the Flash player cannot actually read the body of the response.</div>
<div>
<br /></div>
<div>
Given this constraint can Flex ever be considered a REST compatible client? Does it have a place in a world where the expectation is many thin clients for content delivery?</div>
Anonymoushttp://www.blogger.com/profile/07726019498269380968noreply@blogger.com1tag:blogger.com,1999:blog-5072937951980092870.post-50678143353350735952012-10-05T14:14:00.000-07:002012-10-05T14:14:16.795-07:00Highlights From Java One 2012<h2>
Highlights From Java One 2012</h2>
When my talks were first accepted for <a href="http://www.oracle.com/javaone/index.html">Java One 2012</a>, I never imagined I would feel like this at the end of the week. Currently, I'm a mixture of so burnt out I can barely walk yet so full of adrenaline I don't want to sleep. As a technologist this week has been the highlight of my career. This post will detail a few of the highlights of the week for me.<br />
<h3>
Keynote and Lunch with James Gosling</h3>
<div>
If someone had told me I'd be sat having lunch with James Gosling after participating in the <a href="http://www.oracle.com/javaone/index.html">Java One</a> <a href="https://blogs.oracle.com/javaone/entry/thursday_community_keynote_by_the">community keynote</a> I would have branded them insane. However, that's exactly what happened today. With my friends in the <a href="http://londonjavacommunity.wordpress.com/">London Java Community</a> we had a panel session discussing a flag ship initiative we have been working on known as <a href="http://adoptajsr.org/">Adopt-a-JSR</a>. The keynote was so far from corporate it was refreshing, it was all about community for the community. </div>
<div>
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiDquYkOLW3FYnELPak-cGuMxa1MwyEz5yCO2BkaJUzlhfFxjaVsNMLkpCpvjn9TQgpZVnXXIOb_XLCTjiwMCiA-Ie72P-qiBPBbLHq1NZnOroNknOAFk8TItIg3F3ddwdD7C8rWrxyTeQ/s1600/Panel.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="308" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiDquYkOLW3FYnELPak-cGuMxa1MwyEz5yCO2BkaJUzlhfFxjaVsNMLkpCpvjn9TQgpZVnXXIOb_XLCTjiwMCiA-Ie72P-qiBPBbLHq1NZnOroNknOAFk8TItIg3F3ddwdD7C8rWrxyTeQ/s320/Panel.JPG" width="320" /></a></div>
<div>
<br /></div>
<div>
We saw key technical companies participate in the initial panel, us and then a crazy robot chasing down Oracle executive <a href="http://www.linkedin.com/in/georgessaab">Georges Saab</a> on stage. Then something special happened, James Gosling entered the stage. He was talking about his new development at <a href="http://www.liquidr.com/">Liquid Robotics</a>. The best part about his appearance was James was back amongst a community of developers that have a high degree of respect for him and his work with Java. I found his presentation a highlight of innovation that is ongoing in the industry. After the keynote I headed over to <a href="http://steveonjava.com/">Stephen Chin's</a> Java Desktop lunch. We were sat at the same table as James and discussed details of the UI that he had built and demonstrated during the keynote and discussed some of the problems that data heavy systems would cause web based applications. What a great note to end <a href="http://www.oracle.com/javaone/index.html">Java One</a> on.</div>
<h3>
Java FX</h3>
<div>
<a href="http://www.oracle.com/technetwork/java/javafx/overview/index.html">Java FX</a> has been technically the most exciting product of <a href="http://www.oracle.com/javaone/index.html">Java One</a> for me. It really starts to represent the revival of Java on the desktop. Although Swing has lived on over the last few years, how many people have really wanted to do this? <a href="http://www.oracle.com/technetwork/java/javafx/overview/index.html">Java FX</a> simplifies a developer's ability to rapidly create flexible and maintainable user interfaces. <a href="http://docs.oracle.com/javafx/scenebuilder/1/release_notes_1-0/jsbpub-release_notes_1-0.htm">Scene Builder</a> also provides an abstraction away from code, so you can now have a design team that builds the basic CSS and component layout and the development team adds the functionality on top. </div>
<div>
<br /></div>
<div>
At <a href="http://www.oracle.com/javaone/index.html">Java One</a> myself and <a href="https://twitter.com/kittylyst">Ben Evans</a> presented our toy project visualising garbage collection in <a href="http://www.oracle.com/technetwork/java/javafx/overview/index.html">Java FX</a>. One other highlight of the week was when I met <a href="http://learnjavafx.typepad.com/">Jim Weaver</a> near the exhibition hall. He asked me if I'd like to come over to watch him give a demo. Within about 15 minutes I was stood at the front of the demo grounds giving a presentation on I'm new to <a href="http://www.oracle.com/technetwork/java/javafx/overview/index.html">Java FX</a> and this is what I've built. Thanks Jim! That said it was great fun and all the <a href="http://www.oracle.com/technetwork/java/javafx/overview/index.html">Java FX</a> team are really fun people to hang around with. </div>
<div>
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhoHSvelb3RDWFVEOYH2qTzkBbVCQeKeiJJJze5MqvVVE_4PpDqbK7dN9sG3aMM06Kf7wvkddBFe8P6nVvSSq-W5fhvBxBqeJSPEmvXsviyPWxM8FkYBRjDbOxwmUDz0Vk07C71fKAlh5g/s1600/Screen+Shot+2012-10-05+at+12.05.44.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="220" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhoHSvelb3RDWFVEOYH2qTzkBbVCQeKeiJJJze5MqvVVE_4PpDqbK7dN9sG3aMM06Kf7wvkddBFe8P6nVvSSq-W5fhvBxBqeJSPEmvXsviyPWxM8FkYBRjDbOxwmUDz0Vk07C71fKAlh5g/s320/Screen+Shot+2012-10-05+at+12.05.44.png" width="320" /></a></div>
<div>
<br /></div>
<div>
My challenge for our next JUG meeting is to get a <a href="http://www.oracle.com/technetwork/java/javafx/overview/index.html">Java FX</a> example running on the <a href="http://www.raspberrypi.org/">Raspberry Pi</a>. Hopefully the Pi will arrive before then, if not I'm really looking forward to sharing everything else about <a href="http://www.oracle.com/technetwork/java/javafx/overview/index.html">Java FX</a> back in the <a href="http://londonjavacommunity.wordpress.com/">London Java Community</a>.</div>
<h3>
Adopt a JSR</h3>
<div>
<a href="http://adoptajsr.org/">Adopt-a-JSR</a> is a global initiative that was kicked off in London to help make the <a href="http://jcp.org/">JCP (Java Community Process)</a> relevant to Java developers and increase their participation. <a href="https://www.adaptavist.com/">Adaptavist's</a> Dan Hardiker had the<a href="http://www.facebook.com/notes/jax-london/dan-hardiker-jax-london-2012-interview/503824229628012"> following to say</a> about the project:</div>
<div>
<blockquote class="tr_bq">
<strong>Jax - What in the development world (project or otherwise) is really interesting you at the moment?</strong><em><em><strong></strong></em></em></blockquote>
<blockquote class="tr_bq">
<em><em><strong>Dan - </strong></em>The Adopt-a-JSR programme ran by our own LJC, is one of the most important initiatives I've seen in a long time. It puts developers back in the driving seats helping to steer decisions on important areas of the language they live and breathe.</em></blockquote>
</div>
From attending <a href="http://www.oracle.com/javaone/index.html">Java One</a> it was clear to see that although we have managed to reach senior members of the community there are still many members of the Java community that are not aware of the program or the aims. A second interesting point was that many of the developers attending our sessions are not members of Java User Groups. In order to address these points we are going to look at how we can be wider reaching to developers that are not members of JUGs. Recording sessions and broadcasting them to the wider community is going to be part of the strategy we look at to address this.<br />
<h4>
JSR-310 - New Date Time API</h4>
<div>
In the background to <a href="http://www.oracle.com/javaone/index.html">Java One</a> we have been working hard with Oracle and <a href="http://feeds.feedburner.com/StephenColebournesBlog">Stephen Colebourne</a> to address the final design decision of <a href="http://jcp.org/en/jsr/detail?id=310">JSR-310</a>. A lot of hard work is going into this JSR behind the scenes and at the end of some fairly heated debates we are looking to be on track for Java 8. If you're reading this and you still want to help, we are making a push for people to help us with the following:</div>
<blockquote class="tr_bq">
<span style="background-color: white; color: #222222; font-family: arial, sans-serif; font-size: 13px;">In our continued efforts to evaluate and improve the Threeten </span><span style="background-color: white; color: #222222; font-family: arial, sans-serif; font-size: 13px;">Date/Time API for Java 8 we were discussing the effort of porting code </span><span style="background-color: white; color: #222222; font-family: arial, sans-serif; font-size: 13px;">from existing APIs. Does anyone have open source examples of code </span><span style="background-color: white; color: #222222; font-family: arial, sans-serif; font-size: 13px;">which they wrote against the existing java.util.Date or Calendar that </span><span style="background-color: white; color: #222222; font-family: arial, sans-serif; font-size: 13px;">you felt was overly complicated? I have some code myself, but I'd </span><span style="background-color: white; color: #222222; font-family: arial, sans-serif; font-size: 13px;">really like to hear from you if you have stuff that's open source and </span><span style="background-color: white; color: #222222; font-family: arial, sans-serif; font-size: 13px;">available for hacking on.</span></blockquote>
If you can help please feel free to drop me a tweet <a href="http://twitter.com/JavaJimLondon">@JavaJimLondon</a>.<br />
<h3>
Embedded</h3>
<div>
One final point that really excites me is robots! There has been a taster of Java running on embedded hardware, we've also seen some really cool demonstrations of <a href="http://www.oracle.com/technetwork/java/javafx/overview/index.html">Java FX</a> running on embedded hardware and a <a href="http://www.raspberrypi.org/">Raspberry Pi</a>. This is what I'm going to be playing with over the next few months, along with <a href="http://www.oracle.com/technetwork/java/javafx/overview/index.html">Java FX</a> to try push the bounds of what is possible.<br />
<h3>
Thanks</h3>
</div>
<div>
A big thanks has to go out to <a href="https://twitter.com/Sharat_Chander">Sharat</a> for organising a fantastic Java One, this year really had a community feel about it. Thanks to all the speakers and the content committee, it's been awesome!</div>
Anonymoushttp://www.blogger.com/profile/07726019498269380968noreply@blogger.com191640 20th St, San Francisco, CA 94107, USA37.760058699999988 -122.397855512.465987199999987 -162.827543 63.054130199999989 -81.968168tag:blogger.com,1999:blog-5072937951980092870.post-52866829089503428972012-09-30T23:21:00.001-07:002012-09-30T23:21:34.939-07:00Highlights From Java One: Day 1<h2>
Java One - San Francisco</h2>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiMZhiaZNvGGRo54cyXAlbfRoPWTSjyd2gGkvaU5fFmN2lKrnyoPXYFe5C3RxluiExdT1D7QQmGLq5IXiJJXkqBNaT28upbuZeFsOhdTRq0KoPdTPRv3KvF9hTj81S7dZBws3YQXptV_kw/s1600/photo+(2).JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="248" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiMZhiaZNvGGRo54cyXAlbfRoPWTSjyd2gGkvaU5fFmN2lKrnyoPXYFe5C3RxluiExdT1D7QQmGLq5IXiJJXkqBNaT28upbuZeFsOhdTRq0KoPdTPRv3KvF9hTj81S7dZBws3YQXptV_kw/s640/photo+(2).JPG" width="640" /></a></div>
<div>
<br /></div>
<br />
Today was my first day at <a href="http://www.oracle.com/javaone/index.html">Java One</a>, and my first international conference. It has been an immensely fun day with loads going on.<br />
<h3>
8.15 AM - First talk of the conference - ours!</h3>
<div>
The first session we attended was our talk titled "The bluffers guide to terminology". The talk walked through terminology that complicates our industry, and made observations on how business, technical and academic domains are complicated enough without additional terminology. We walked through the different sections explaining terms and simplifying them so everyone could understand. For 8.15am the audience were very engaged, and it was clear that this was something everyone could relate to. We concluded that you have to be very careful when picking terms to represent your domain model objects in software development. You need to think about having a suitable abstraction that is clear as to what it represents in the domain, but doesn't complicate the domain further.</div>
<div>
<iframe frameborder="0" height="400" marginheight="0" marginwidth="0" scrolling="no" src="http://www.slideshare.net/slideshow/embed_code/14533750?hostedIn=slideshare&page=upload" width="476"></iframe>
</div>
<div>
<br />
<h3>
Winning an award</h3>
</div>
<div>
For the last 18 months, myself and colleagues from the <a href="http://londonjavacommunity.wordpress.com/">London Java Community</a> have been working on two key initiatives - <a href="http://java.net/projects/ljc-london-jug/pages/AdoptAJSRProgram">Adopt a JSR</a> and <a href="http://java.net/projects/adoptopenjdk/pages/AdoptOpenJDK">Adopt Open JDK</a>. Today we were awarded with a <a href="http://www.java.net/dukeschoice">Duke's Choice Award</a> for the hard work we have put in inspire the community to be more involved in contributing to the future of Java. It was very exciting to see the LJC's name on the big screens at the <a href="http://www.oracle.com/javaone/index.html">Java One</a> keynotes. Although winning an award was not something we set out to achieve, it is an honor. It has inspired me to carry on pushing on the initiatives we started and to use <a href="http://www.oracle.com/javaone/index.html">Java One</a> as an opportunity to encourage global participation. It's also got me thinking about a future initiative, but for now that will remain top secret.</div>
<div>
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg2-3U0gfH1OxtbzewcfgRZJJWKBsorAoESnBPb9oxITAfEb6zfYdJC7skySsjZmvGI5D0n8nBli86kLaq-IAhZ8tfC19YgNHHr6LApdQ2nZVi9kwnSnQFRqzkgmqyqS0EVnQu8X_bCwQY/s1600/photo+(1).JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="240" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg2-3U0gfH1OxtbzewcfgRZJJWKBsorAoESnBPb9oxITAfEb6zfYdJC7skySsjZmvGI5D0n8nBli86kLaq-IAhZ8tfC19YgNHHr6LApdQ2nZVi9kwnSnQFRqzkgmqyqS0EVnQu8X_bCwQY/s320/photo+(1).JPG" width="320" /></a></div>
<div>
<br /></div>
<h3>
Technical Keynote</h3>
<div>
I'm still processing some of what was in the keynote, but my initial reaction is how excited I am about Java on the desktop. Having experienced the pain of Swing and context switching between .Net and Flex as alternatives, I can really see a future for Java on the desktop. That wasn't all however, we actually got to see <a href="http://www.oracle.com/technetwork/java/javafx/overview/index.html">Java FX</a> running on a <a href="http://www.raspberrypi.org/">Raspberry Pi</a> and other embedded devices. There's actually an embedded version of the <a href="http://www.oracle.com/javaone/index.html">Java One</a> conference scheduler deployed around the hotels! This has really steered my interest for the conference as I'll be looking to attend a large number of <a href="http://www.oracle.com/technetwork/java/javafx/overview/index.html">Java FX</a> talks this week at <a href="http://www.oracle.com/javaone/index.html">Java One</a>. We also have our talk on visualising the Java GC model on Tuesday, which will go into building an application from the beginning in <a href="http://www.oracle.com/technetwork/java/javafx/overview/index.html">Java FX</a> what we have learnt about the technology and how to use <a href="http://www.oracle.com/technetwork/java/javafx/overview/index.html">Java FX</a> as a teaching and visualising technology from a slightly different perpective to grids and graphs.</div>
<div>
<br /></div>
<h3>
Party</h3>
<div>
The day ended with collecting the <a href="http://www.java.net/dukeschoice">Duke's Choice Award</a> and a party in the street next to the hotel. Most of us have now returned to try and shake the jet lag before a packed day tomorrow.</div>
<div>
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiIaogMneQek1ytTsTVdRwnAfNeW37GdFSMeuXOSKBTwTXKhh2zdCvKYCZb26Q8sYjeHODhmovM4RnIaf3iCsCArujoolxqHGcdSPxc-oy4OhLGTifLvTpDZqehIYJy304lGtm9Sd8cxRw/s1600/photo+(3).JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiIaogMneQek1ytTsTVdRwnAfNeW37GdFSMeuXOSKBTwTXKhh2zdCvKYCZb26Q8sYjeHODhmovM4RnIaf3iCsCArujoolxqHGcdSPxc-oy4OhLGTifLvTpDZqehIYJy304lGtm9Sd8cxRw/s320/photo+(3).JPG" width="240" /></a></div>
Anonymoushttp://www.blogger.com/profile/07726019498269380968noreply@blogger.com0475 Arkansas St, San Francisco, CA 94107, USA37.7603366 -122.397945912.466265100000001 -162.8276334 63.0544081 -81.9682584tag:blogger.com,1999:blog-5072937951980092870.post-32406991225446135592012-09-12T13:24:00.000-07:002012-09-12T13:24:42.638-07:00JavaFX Help: Too much animation at the same time!I am currently working on building a <a href="http://www.cs.umd.edu/~pugh/java/memoryModel/">Java memory model</a> teaching tool in <a href="http://www.oracle.com/technetwork/java/javafx/overview/index.html">JavaFX</a>, the project is available on <a href="https://github.com/kittylyst/jfx-mem">GitHub</a>. Whilst building the user interface I ran into a performance issue, which is easily worked around using <a href="http://www.oracle.com/technetwork/java/javafx/overview/index.html">JavaFX</a>. This post gives the detail to the problem and how to easily resolve it.<br />
<br />
In the memory model we have several memory sections made of memory blocks. In our application we represent each memory block with a <a href="http://docs.oracle.com/javafx/2/api/javafx/scene/layout/StackPane.html">StackPane</a>. This has a <a href="http://docs.oracle.com/javafx/2/api/javafx/scene/shape/Rectangle.html">Rectangle</a> object at the bottom and a <a href="http://docs.oracle.com/javafx/2/api/javafx/scene/text/Text.html">Text</a> object on top of this to represent the current generation that block is in.<br />
<br />
A block has three states it can be in:<br />
<ul>
<li>Free - nothing has been allocated here yet.</li>
<li>Alive - the block holds some active memory.</li>
<li>Dead - the memory in the block has now died and is awaiting garbage collection.</li>
</ul>
<div>
<br />
We have potentially several threads that are running against the model allocating and killing memory. The challenge is animating each of the state transitions on the UI. A picture shows the animation in action:</div>
<div>
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiBQMyNwprpjtJYUPs414-BjQmPFTlYVcFKlWiZW94NETgkFhq1bBGEbMx53HtoUZPUhWmLmaP7QG6Bw9ik_wIiMwVvdMitjsGxnbtgAeBIlsx8Q6k-Y9Umcn57M_cnufv5OBkz0mJfIh0/s1600/MModel.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiBQMyNwprpjtJYUPs414-BjQmPFTlYVcFKlWiZW94NETgkFhq1bBGEbMx53HtoUZPUhWmLmaP7QG6Bw9ik_wIiMwVvdMitjsGxnbtgAeBIlsx8Q6k-Y9Umcn57M_cnufv5OBkz0mJfIh0/s1600/MModel.png" /></a></div>
<br />
The code segment that we used for the transition is as follows (there might be a better way to do this):<br />
<br />
<pre style="background: #f0f0f0; border: 1px dashed #CCCCCC; color: black; font-family: arial; font-size: 12px; height: auto; line-height: 20px; overflow: auto; padding: 0px; text-align: left; width: 99%;"><code style="color: black; word-wrap: normal;"> FadeTransition fadeOldBlockOut = new FadeTransition(Duration.millis(10), view);
fadeOldBlockOut.setFromValue(1.0);
fadeOldBlockOut.setToValue(0.0);
fadeOldBlockOut.setCycleCount(1);
fadeOldBlockOut.setAutoReverse(false);
fadeOldBlockOut.play();
FadeTransition fadeNewBlockIn = new FadeTransition(Duration.millis(1500), view);
fadeNewBlockIn.setFromValue(0.0);
fadeNewBlockIn.setToValue(1.0);
fadeNewBlockIn.setCycleCount(1);
fadeNewBlockIn.setAutoReverse(false);
fadeNewBlockIn.setDelay(Duration.millis(1));
fadeNewBlockIn.play();
</code></pre>
<br />
<div class="separator" style="clear: both; text-align: center;">
</div>
<div>
This code was added to the view object. However, once you get multiple of these firing the application will quickly start to hurt itself to keep up with the transitions required. Having read <a href="http://javajimlondon.blogspot.com/2012/09/book-review-pro-javafx-2.html">Java FX Pro 2</a> I quickly realised that I had taken the wrong approach. Large amounts of updating graphics, especially timeline style animation, does not belong on the main application thread. Thankfully <a href="http://www.oracle.com/technetwork/java/javafx/overview/index.html">JavaFX</a> has an easy paradigm to resolve the issue.<br />
<br />
I created an Object that implements <a href="http://docs.oracle.com/javase/1.5.0/docs/api/java/lang/Runnable.html">Runnable</a>, which would take the memory block I want to animate in the constructor and perform the logic above:<br />
<br />
<pre style="background: #f0f0f0; border: 1px dashed #CCCCCC; color: black; font-family: arial; font-size: 12px; height: auto; line-height: 20px; overflow: auto; padding: 0px; text-align: left; width: 99%;"><code style="color: black; word-wrap: normal;"> class CustomMemoryBlockViewTransition implements Runnable {
private final MemoryBlockView view;
public CustomMemoryBlockViewTransition(MemoryBlockView view_) {
view = view_;
}
@Override
public void run() {
//...
}
}
</code></pre>
<br /></div>
<div>
Once you have your Runnable defined (you can also do this as an anonymous inner class) you can simply call the <a href="http://docs.oracle.com/javafx/2/api/javafx/application/Platform.html">Platform</a> to run the animation at a later point. The <a href="http://docs.oracle.com/javafx/2/api/javafx/application/Platform.html">Platform</a> keeps a queue of activities submitted and will execute these in order.<br />
<br />
<pre style="background: #f0f0f0; border: 1px dashed #CCCCCC; color: black; font-family: arial; font-size: 12px; height: auto; line-height: 20px; overflow: auto; padding: 0px; text-align: left; width: 99%;"><code style="color: black; word-wrap: normal;"> Platform.runLater(new CustomMemoryBlockViewTransition(this));
</code></pre>
<br /></div>
<div>
<br /></div>
Anonymoushttp://www.blogger.com/profile/07726019498269380968noreply@blogger.com0tag:blogger.com,1999:blog-5072937951980092870.post-50498564321456398562012-09-12T03:56:00.000-07:002012-09-12T03:56:37.670-07:00Open Crete: Days 2 & 3Having broken out in to the lobby on day 3 I thought I'd summarise the last few days of the <a href="http://www.javaspecialists.eu/wiki/index.php/JavaSpecialistsSymposium2012">conference</a> and some of the ideas I have been developing based on the conference so far. First an image from down at the sea front, a great spot for thinking - and a surprisingly decent wifi connection :-).<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgE80vEaZZqlYP4vifDzkNnORXgCHtfBfEvjfmRcWfMIFZqwDrocdWmxds7FT3_GUo6N_N-Dz4XyOK8LNKOwzwCLULePtDvdXnfIc-oGy2_yZqZaRfS8vbSpg7sF3MvC-t7X3YTx4HTSqM/s1600/photo.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="240" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgE80vEaZZqlYP4vifDzkNnORXgCHtfBfEvjfmRcWfMIFZqwDrocdWmxds7FT3_GUo6N_N-Dz4XyOK8LNKOwzwCLULePtDvdXnfIc-oGy2_yZqZaRfS8vbSpg7sF3MvC-t7X3YTx4HTSqM/s320/photo.JPG" width="320" /></a></div>
<br />
<h3>
Day 2: Discussion of Mobile Platforms </h3>
<div>
Day 2 began with a talk run by Richard Pollock on Objective-C vs Java runtime. The discussion took one of a <a href="https://developer.apple.com/technologies/ios/">iOS</a> vs <a href="http://www.android.com/">Android</a> platform. One of the main points discussed was the background tasks and the implications of those on both operating systems. I found out about some fairly compelling points from the <a href="http://www.android.com/">Android</a> camp around running services that then multiple applications can subscribe to, along with writing code to expect to be terminated at any time. <a href="https://developer.apple.com/technologies/ios/">iOS</a> has limited support for background tasks, and you have around 7 options that are event based for a limited range of operations that can potentially run in the background. We got into some specifics surrounding <a href="http://developer.apple.com/library/mac/#documentation/Performance/Reference/GCD_libdispatch_Ref/Reference/reference.html">grand central dispatch</a> and how this is a lower level threading than the model presented in <a href="http://www.android.com/">Android</a>. All round it was a talk which lead to a great consideration about our own business that we run at <a href="http://stackthread.com/">StackThread Software</a>. </div>
<div>
<br /></div>
<div>
Richard and I took a breakout for the next two sessions to discuss our own business model. This was driven based on the sales of our recent iPhone application <a href="http://stackthread.com/diabetesplus/">Diabetes+</a>. We put the application on sale 2 weeks ago at the price of $3. In 2 weeks we sold 15 copies (with £75 of Google advertising) - a really disappointing amount given the effort that has gone into the application. We made the application free as an experiment for a few days, on the first day we sold 270 copies! Within days we now have 550 copies that users have downloaded and are using for free. This is the equivalent of the units we would usually ship over 2 months of our other paid applications. So what did we get from making this free, nothing except more users to support - one could argue that actually word of mouth might be a good thing. What were really hoping for would be more reviews - which also did not happen. In our breakout we discussed targeting the Android platform, we decided it would be a fun technical challenge - but again would be governed by the apparent race to zero price for applications. We concurred that the best way to distribute applications at the moment seems to be to make it free and have in application purchases. In the end we have decided to pursue a new application that we have had on the back burner which is a <a href="http://static.springsource.org/spring/docs/2.0.x/reference/mvc.html">Spring MVC</a> project hosted on <a href="http://aws.amazon.com/">Amazon Web Services</a> with a JavaScript and HTML 5 front end. Although we will support our current applications in the App Store, there isn't any motivation for us to build further applications unless on commission to do so. The rest of the day was spent unit testing and building out on the prototype we had shelved.</div>
<h3>
Day 3: Enterprise Git</h3>
<div>
A situation that is close to my heart within enterprise development is source control. In the last 5 years I have been responsible for migrating systems from CVS to Perforce and rescuing diverged branches of over 6 months (taking a few weeks to resolve). </div>
<div>
<br /></div>
<div>
The conversation opened with the following considerations, which we would discuss even if not answering completely:</div>
<div>
<ul>
<li>Does Git work in an environment with 80 developers, and a few million lines of code?</li>
<li>We have no collectively clue about Git in large enterprises.</li>
<li>How does having a workflow help with development using Git.</li>
<li>Does GitHub impose a desirable work flow?</li>
</ul>
<div>
Marc gave us an overview for those less familiar with git to note how the local repository or "my repository" works for developers. Pointing out the familiar concepts of local check ins and branching. The intro also covered the single point of truth and how this works with GitHub, how SHA takes into account the file meta data as well as the content.</div>
</div>
<div>
<br /></div>
<div>
It quickly became apparent that few of us use this in our enterprise jobs, with the exception of Kirk! </div>
<div>
<br /></div>
<div>
What was new for most of us was rebasing rather than merging, something that I heard of but wasn't sure what the difference was between this and a merge. If the original branch hasn't moved on a merge is effectively the same thing. However, when the main branch has moved on it was almost universally agreed this is a better pattern. </div>
<div>
<br /></div>
<div>
Git enables better collaboration, especially in teams that are distributed. It also works well for teams that focus on pairing and working together.<br /><br />We decided that Git is suitable for enterprise for the following reasons:<br />
<br />
<ul>
<li>Branching is free and easy. Developing features and merging over large teams is easier than in competitive tools. For teams that run the feature branch model this would significantly improve their development experience.</li>
<li>An <i>in house </i>git hub would also help to improve cataloging of systems and applications and encourage employing good standards for sharing code. Although this isn't a source control problem, it might be a step in the right direction for code reuse.</li>
<li>Integrate with Jenkins and Gerrit, define a workflow that is suitable for the team and enterprise.</li>
</ul>
<div>
We then put Marc on the spot and pair programmed an example of rebase on the command line. </div>
</div>
<h3>
Day 3: To OO or not to OO</h3>
<div>
Interesting debate on whether OO is the right abstraction for modelling today's problems. Conversation went to both extremes of what makes OO good and poor. Discussion was along the lines of where does the business logic best fit and is OO too theoretical to be applicable to modern day business problems. Where does functional programming fit into this?<br />
<br />My personal opinion on the outcome of this was that you need to have a balance on your team between practically biased and theoretically biased individuals. There is no correct answer to what is the best approach to take and it should be aligned with what best fits the businesses current problem. A lot went on in the conversation and I'm sure I'm still developing more ideas on this topic over the next few days.<br />
<br />
With most of the delegates heading out for excursions this afternoon, I am looking forward to spending the rest of the day working on our JavaFX talk for tomorrow and the DateTime talk.<br />
<div style="background-color: white; color: #222222; font-family: arial, sans-serif; font-size: 13px;">
<br /></div>
</div>
<div>
<br /></div>
<div>
<br /></div>
<div>
<br /></div>
<div>
<br /></div>
<div>
<br /></div>
<div>
<br /></div>
<div>
<br /></div>
<div>
<br /></div>
<div>
<br /></div>
Anonymoushttp://www.blogger.com/profile/07726019498269380968noreply@blogger.com0Kissamou, Chania 731 00, Greece35.5841657 24.07567239.6342472 -16.3540152 61.534084199999995 64.505359800000008tag:blogger.com,1999:blog-5072937951980092870.post-4849868255894018982012-09-10T13:31:00.000-07:002012-09-10T13:31:35.079-07:00Book Review: Pro JavaFX 2<div>
<br /></div>
I'm a server side Java developer with 10 years experience, and 2 years experience in <a href="http://www.adobe.com/products/flex.html">Adobe Flex</a>. With Flex taking a recent slating in the press, I decided it was time to broaden my UI experiences to <a href="http://docs.oracle.com/javafx/">JavaFX</a> and HTML 5 with Java Script. Because I know Java well, and having previous experiences with Swing, I chose <a href="http://docs.oracle.com/javafx/">JavaFX</a> and this was the book I chose to help me learn the basics.<br />
<br />
The first thing to note about this book is it's written by the key people behind the <a href="http://docs.oracle.com/javafx/">JavaFX</a> technology. The advantage of this is the reader is immediately learning how the platform was designed and intended for use.<br />
<br />
The book is split into 10 chapters, each with comprehensive code listings on how the examples and components are built. The chapters are outlined below, along with how I found them useful in the work we have been doing building a basic <a href="https://github.com/kittylyst/jfx-mem">Java Memory Visualizer</a> in <a href="http://docs.oracle.com/javafx/">JavaFX</a>.<br />
<h3>
Getting a Jump Start in JavaFX</h3>
The book begins with a brief history of JavaFX, and discusses the original version and the introduction of 2.0. The book goes immediately into an example, building an application using a Java Class extending Application. There's also enough to get started in this chapter with getting Netbeans set up and ready to go to build your applications. There's a lot of content here, so don't let this put you off. There's some important code segments that you will probably need to flick back to along the way. My only observation at this point would be remember that there is still the option of using FXML to simplify a lot of the code that is in this chapter - so this chapter should be viewed as a primer.<br />
<h3>
Creating a User Interface in JavaFX</h3>
We're back out of the deep end now and will be walked through the scene and layouts of creating a typical user interface. This chapter is critical to when you come to build your own UIs. If you want to grab a chapter to help you get started quickly this would be the one. One minor criticism would be this would be a good chapter one, but I can appreciate why leading with an example is good. It really depends on your learning style if you want to read this chapter first. After some theory there is a whole host of examples for you to try and figure out, all with both screenshots and code samples. This is a real codex of information, for me I found reading the first part and trying the second part with my own examples worked best.<br />
<h3>
Properties and Bindings</h3>
Binding is a simple concept, but there are some subtleties that need to be appreciated when building JavaFX applications. The first part of the chapter is split into titles of <i>Understanding X</i>, which makes it easy to refer back to later. Once again, everything is backed up with an appropriate example that demonstrates the power of bindings. This chapter is similar to the previous, the first part of the chapter is easy to read for theory but the latter is example heavy. I'd use the latter part of the chapter as a reference to come back to once you start writing your own code.<br />
<h3>
Building Dynamic UI Layouts in JavaFX</h3>
We used the concepts that are in the Reversi example for the foundations of our Java Memory Visualizer to manipulate memory cells that are on the screen. This example is again in the format of extending Application, but building out components on there. We built our application using FXML based on the information from this chapter. There is enough in this chapter to build your own board game, or if you are building any binding state UI I'd recommend reading this chapter.<br />
<h3>
Using the JavaFX UI Controls</h3>
I personally haven't read this chapter in great depth as I view it as a reference chapter. It looks like this is the codex for building your own controls.<br />
<h3>
Collections and Concurrency</h3>
In chapter 6 we're really going back to basics, so in my opinion this is not a chapter you can shelve for later. For the collections part, if you are familiar with Flex, ObservableList reminded me of ArrayCollection. The concurrency section introduces the threading model that is used in JavaFX, and that it is single threaded like most other UI frameworks. The JavaFX tasks are then explained for removing logic from the main application thread to avoid bloating your application re-render. Personally when we approached this, due to the nature of the simulation, we used plain old java.util.concurrent.<br />
<h3>
Creating Charts in JavaFX</h3>
Great overview into building charts in JavaFX and shows off the power of what is capable in the API. Examples and screenshots are available to get you started with what you are trying to build.<br />
<h3>
Using the Media Classes</h3>
Because of the type of work I do it's likely I'll never get to do any of the fun stuff in this chapter. I've saved this one for a rainy day, although on a quick parse it does look like a chapter I will genuinely come back to.<br />
<h3>
Accessing Web Services</h3>
<div>
An awesome chapter with practical examples of how you would integrate your JavaFX client with real world technologies. This sample walks you through creating a REST API call to twitter, using JAXB to create an appropriate response and display the information. If you are looking at using this for EE work this would be a good chapter to read. </div>
<h3>
JavaFX Languages Markup</h3>
<div>
In this chapter we see some other languages using JavaFX (Scala and Groovy). The finally we get to the section on FXML. The sample is fairly simple and somewhat limited, it would have been good to have seen more of this earlier. </div>
<h2>
Summary</h2>
<div>
This is an excellent book to have if you are trying to do anything with JavaFX. Although the online documentation is getting better, this book provides an awesome introduction to most components, tricks and tips that you would need to get started in this space. My only criticism of the book is a lack of FXML examples and that it only really appears at the end of the book. This shouldn't take away however from some of the excellent explanations and examples in this unfamiliar space. It's also worth noting that with a bit of playing around it's very simple to convert the samples over to using FXML. </div>
<div>
<br /></div>
<div>
5/5 - I bought this with my own money and don't want it back :-). </div>
<div>
<br /></div>
Anonymoushttp://www.blogger.com/profile/07726019498269380968noreply@blogger.com0Kissamou, Chania 731 00, Greece35.5847191 24.07608629.6348006000000019 -16.3536013 61.534637599999996 64.505773699999992tag:blogger.com,1999:blog-5072937951980092870.post-78081299345373181682012-09-10T05:30:00.000-07:002012-09-10T05:30:18.291-07:00Open Crete: Day 1A picture says a 1000 words!<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgQwhZoTluJLm7W7NYG7UG_uOzznPQ9SDIltUAIS_V509GEA8aAPTaMdJoM5hw1MO6Sa3montPZ3b0r1-rJ2qTA1OQgtCfPJPcDWhlHxac4FarK4TxwYRKasuTWz3RBikJV8Uryr9RUZ6Y/s1600/Chania.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="238" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgQwhZoTluJLm7W7NYG7UG_uOzznPQ9SDIltUAIS_V509GEA8aAPTaMdJoM5hw1MO6Sa3montPZ3b0r1-rJ2qTA1OQgtCfPJPcDWhlHxac4FarK4TxwYRKasuTWz3RBikJV8Uryr9RUZ6Y/s320/Chania.JPG" width="320" /></a></div>
<br />
Arriving on Saturday was definitely a great idea, as most of Sunday was spent sleeping or taking in these fantastic surroundings. The conference kicked off last night with a informal get to know each other at a local restaurant called Irene's Taverna.<br />
<br />
<a href="http://www.javaspecialists.eu/wiki/index.php/JavaSpecialistsSymposium2012">Open Crete</a> is run as an <a href="http://en.wikipedia.org/wiki/Unconference">unconference</a>, that is the participants very much direct the success and the output of the conference in the end. No sessions are planned up front, and the first part of this morning was grabbing some sticky notes and proposing sessions. I have proposed 3 sessions (which are pretty much inline with my talks coming up at JavaOne):<br />
<br />
<ul>
<li>Why is the community important to Java? <a href="https://blogs.oracle.com/java/entry/adopt_a_jsr">Adopt-a-JSR</a>, OpenJDK and JUGs.</li>
<li>JavaFX Memory Visualisation.</li>
<li>An overview of the new DateTime API (JSR-310) in Java 8. </li>
</ul>
<div>
<br /></div>
<div>
We kicked off with two sessions this morning, which covered the future of Java. The general feeling was that modules is going to be a massive section missing from the next release of Java. It was acknowledged however that most of us have not seen the proposed profiles solution. After modules we discussed the impact of Lambdas. Although people are in general excited about Lambdas and what they can do, there is a concern that they will be perhaps used for the sake of using them and in some cases ignored because they are not understood. After discussing some consumer trends, we chatted about the future of Java given that there is currently no substantial mobile presence. The big feel is that laptops will soon become a "developer only" style tool - because regular consumers can get away with carrying an iPad. What does this mean for Java's future? Who is really behind driving Java forwards? </div>
<div>
<br /></div>
<div>
The session definitely left food for thought as we break for afternoon of activities, and I am looking forward to considering the above in more detail as the week unfolds.</div>
Anonymoushttp://www.blogger.com/profile/07726019498269380968noreply@blogger.com0Kissamou, Chania 731 00, Greece35.5847191 24.07608629.6348006000000019 -16.3536013 61.534637599999996 64.505773699999992tag:blogger.com,1999:blog-5072937951980092870.post-16180700115353478712012-09-10T04:50:00.000-07:002012-09-10T04:50:26.258-07:00JavaFX Cleanly Closing an FXML Based ApplicationWhilst developing an FXML based <a href="http://www.oracle.com/technetwork/java/javafx/overview/index.html">JavaFX</a> application for <a href="http://www.oracle.com/javaone/">JavaOne</a> I had to overcome the problem of cleaning up Java background threads running in the controller on a <a href="http://docs.oracle.com/javase/6/docs/api/java/util/concurrent/ExecutorService.html">ExecutorService</a>.<br />
<br />
If you had chosen to use the builder patterns rather than FXML this is a fairly trivial task, as you are likely to have direct access to the controller from your main class which extends Application. However, when you use FXML you will more than likely be declaring your controller as follows:
<br />
<pre style="background-image: URL(https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhHA3nzfDG4M9f6bpxKQxp8JPMxBh3Ny_gEcJClrj1r8wBmR239OH-PGZOw8xM0KPjypD0Fic4Ksn6g0jsNs3c9QITZ_MfCWc20GOKq3YEX0U_dCaNE6vnbN8PXaA0mZhwMTdVRUqVFQCHJ/s320/codebg.gif); background: #f0f0f0; border: 1px dashed #CCCCCC; color: black; font-family: arial; font-size: 12px; height: auto; line-height: 20px; overflow: auto; padding: 0px; text-align: left; width: 99%;"><code style="color: black; word-wrap: normal;"> <VBox xmlns:fx="http://javafx.com/fxml" fx:controller="com.jclarity.anim.memory.MemoryController"> ...
</code></pre>
<br />
When you launch the FXML you are likely to do something along the lines of:<br />
<br />
<pre style="background-image: URL(https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhHA3nzfDG4M9f6bpxKQxp8JPMxBh3Ny_gEcJClrj1r8wBmR239OH-PGZOw8xM0KPjypD0Fic4Ksn6g0jsNs3c9QITZ_MfCWc20GOKq3YEX0U_dCaNE6vnbN8PXaA0mZhwMTdVRUqVFQCHJ/s320/codebg.gif); background: #f0f0f0; border: 1px dashed #CCCCCC; color: black; font-family: arial; font-size: 12px; height: auto; line-height: 20px; overflow: auto; padding: 0px; text-align: left; width: 99%;"><code style="color: black; word-wrap: normal;"> @Override
public void start(Stage stage) throws Exception {
Parent root = FXMLLoader.load(getClass().getResource("MemoryMainView.fxml"));
Scene scene = new Scene(root, 600, 500);
scene.getStylesheets().add(getClass().getResource("Memory.css").toExternalForm());
stage.setScene(scene);
stage.setTitle("JavaFX Memory Visualizer");
stage.show();
}
</code></pre>
<br />
At this stage you launch the FXML and never grabbed hold of your reference to the controller. This now means when you override stop() you can't delegate this to your controller. The solution I found to this was to separate out the code above to ensure that you keep access to the FXML loader. If you have access to the FXMLoader you easily do the following in the stop method:<br />
<pre style="background-image: URL(https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhHA3nzfDG4M9f6bpxKQxp8JPMxBh3Ny_gEcJClrj1r8wBmR239OH-PGZOw8xM0KPjypD0Fic4Ksn6g0jsNs3c9QITZ_MfCWc20GOKq3YEX0U_dCaNE6vnbN8PXaA0mZhwMTdVRUqVFQCHJ/s320/codebg.gif); background: #f0f0f0; border: 1px dashed #CCCCCC; color: black; font-family: arial; font-size: 12px; height: auto; line-height: 20px; overflow: auto; padding: 0px; text-align: left; width: 99%;"><code style="color: black; word-wrap: normal;"> @Override
public void stop() {
((MemoryController) fxmlLoader.getController()).haltSimulation();
}
</code></pre>
<br />
I separated the code as follows:<br />
<pre style="font-family:arial;font-size:12px;border:1px dashed #CCCCCC;width:99%;height:auto;overflow:auto;background:#f0f0f0;;background-image:URL(https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhHA3nzfDG4M9f6bpxKQxp8JPMxBh3Ny_gEcJClrj1r8wBmR239OH-PGZOw8xM0KPjypD0Fic4Ksn6g0jsNs3c9QITZ_MfCWc20GOKq3YEX0U_dCaNE6vnbN8PXaA0mZhwMTdVRUqVFQCHJ/s320/codebg.gif);padding:0px;color:#000000;text-align:left;line-height:20px;"><code style="color:#000000;word-wrap:normal;"> private FXMLLoader fxmlLoader;
@Override
public void start(Stage stage) throws Exception {
URL location = getClass().getResource("MemoryMainView.fxml");
fxmlLoader = new FXMLLoader();
fxmlLoader.setLocation(location);
fxmlLoader.setBuilderFactory(new JavaFXBuilderFactory());
Parent root = (Parent) fxmlLoader.load(location.openStream());
...
}
</code></pre>Anonymoushttp://www.blogger.com/profile/07726019498269380968noreply@blogger.com0Kissamou, Chania 731 00, Greece35.5847191 24.07608629.6348006000000019 -16.3536013 61.534637599999996 64.505773699999992tag:blogger.com,1999:blog-5072937951980092870.post-32704100598552004742012-09-07T04:07:00.001-07:002012-09-07T04:07:33.683-07:00Book Review: The Well Grounded Java Developer
<br />
<div class="p1">
I have been a Java developer for over 10 years, with 5 years of this in the financial software industry. In my opinion this book is one of the best Java books on the market currently. There is something in this book for everyone, if you are new graduate it helps to consolidate your skills in Java. If you're an old hat, this book has a refreshing approach to more complex topics, such as Understanding Performance Tuning which Dr Heinz Kabutz brands as: "<span class="s1">The first book since Jack Shirazi’s <i>Java Performance Tuning </i>that has captured the essence of how to make your system faster.</span>" in the foreword. I think the two chapters understanding performance tuning and modern concurrency are a must read for all developers, and are delivered superbly for all levels.</div>
<div class="p2">
<br /></div>
<div class="p1">
The book is split into 4 parts, starting with an introduction to Java 7. Anyone who has been asleep for the last year should definitely be reading this section. It presents all the major changes with examples, and is easy to follow and read. </div>
<div class="p2">
<br /></div>
<div class="p1">
Vital techniques then takes a deep dive into dependency injection - critical to writing testable and maintainable code. The section shows by example an introduction to the critical topic. It also introduces JSR-330 annotations, which as an early adopter of Spring I hadn't looked at in detail myself. The spin then goes into concurrency, and this chapter I finished! Having had Modern Concurrency in Practice on the bookshelf, 4 attempts at reading it and bottoming out around page 50 - I have to say this was refreshing. Modern Concurrency is a great book, but this chapter synthesises the complexity in simple and easy to understand diagrams and explanations. Class files and byte code is another section that many Java developers lack a detailed understanding of - this book adequately covers this topic. It also introduce the opcode detail of invoke dynamic and how that will be useful for developers. The final chapter in this section dives in to understanding performance tuning, which takes a very pragmatic and evidence based approach to finding out why your application might be running "badly". I like this section a lot because it's written from experience, some of the same problems I have run into in my career could have been avoided by reading this chapter first. It also goes into detail about garbage collection basics and structures, a topic which is usually a guaranteed interview question. Also if you thought that Objects were always allocated on the heap, check out page 181 for something you might have missed :-).</div>
<div class="p2">
<br /></div>
<div class="p1">
At this point your brain might be fried, if so another read of it will make everything clearer. There's hints and tips in the sections for stuff you can skip and that's really useful for the first parse. The next section is slightly easier going and introduces polygot programming on the JVM. If you haven't come across many functional languages this starts with introducing the key concepts and how the compare with traditional Java approaches. We then get the detail of how this all works and we're ready to go with trying out our first functional languages. We get a overview introduction to Groovy, Scala and Clojure. I didn't read these chapters in too much detail purely because of the work I'm doing at the moment. However, I did like the presentation format of is this right for my project, some of the higher level concepts (with solid examples) as well as interoperability with Java. To me this is going to be my holiday reading to see what is going on outside the core space, providing a primer that will be enough for me to go off and do my own research and experimentation.</div>
<div class="p2">
<br /></div>
<div class="p1">
The final part is about craft, craft is perhaps the one thing that is missing from day to day developers I come across. Craft makes you stand out, it makes you professional and caring about the product that you will deliver. This is one skill you can't get a qualification for, it grows from experience, learning from other and striving to deliver the best you can. The section introduces some key points and approaches you can apply starting today. The chapter on test driven development is another hidden gem in this book, having worked at establishment where testing is finding the problem in production this introduction brought about a new approach to the way me (and my team) now go about writing code. This approach gives you the building blocks of learning these valuable techniques and gives you some hints and tips into different tools you can use to support you with this. Writing good code is all well and good, but how do you ensure it works well with other people's changes and passes coding standards? The continuous integration chapter details how this works using Jenkins as the example. Of course no section of building would be complete without a mention of Maven, I'll let you decide if that's a good or a bad thing :-)!</div>
<div class="p2">
<br /></div>
<div class="p1">
The book wraps up with web development and looks at why Java is not necessarily the best tool in the box for this, followed by how to stay well grounded now you have been armed with a book!</div>
<div class="p2">
<br /></div>
<div class="p1">
I have bought and read many technical books in the past and there are only two technical books I've ever read cover to cover, Spring in Action was one of them this is the other. The book focuses on Java 7, which although out for a year is slowly creeping into production systems. The book serves as a good primer to the new changes. </div>
<div class="p2">
<br /></div>
<div class="p1">
Note:</div>
<div class="p1">
I wouldn't consider this a very beginner book, if you are looking to learn object oriented programming from the beginning I'd recommend reading another book first. It's not criticism of the book, but if that's what you're looking for I'd consider this book as the second book you buy.</div>
Anonymoushttp://www.blogger.com/profile/07726019498269380968noreply@blogger.com0tag:blogger.com,1999:blog-5072937951980092870.post-45421596033900070132012-06-21T13:34:00.000-07:002012-06-21T13:52:49.642-07:00FrAgile DevelopmentOn June 12th I gave a <a href="http://en.wikipedia.org/wiki/Lightning_talk">lightning talk</a> on FrAgile Development at <a href="http://skillsmatter.com/">Skills Matter</a> in London, you can watch the <a href="http://skillsmatter.com/podcast/java-jee/resource-oriented-computing">video here</a>. It was by far the most controversial talk I have given to date. Before I instantly get flamed by Agile fans the talk was not to criticise the methodology, but was a play on words and/or what can start to happen if things go wrong. The best part about the talk was the range of reactions that the audience took from the talk, which I will summarise at the end.<br />
<br />
<span>For the purpose of this post the FrAgile Developer writes in <span style="color: #cc0000;">red</span>, the voice of some reason will be in <span style="color: #3d85c6;">blue</span>. Imagine them as an angel and a devil sat on the developers shoulder.</span><br />
<br />
The <a href="http://www.slideshare.net/jpgough/fragile-developer">slides</a> went through some bad practices that I've seen (and participated in whilst learning and not knowing any better). During research it seems others have also thought of Fragile development as a concept and <a href="http://c2.com/cgi/wiki?FragileDevelopment">c2.com</a> was a great reference point.<br />
<br />
<h3>
Ctrl CV Design Pattern</h3>
<br />
<span style="color: #cc0000;">Refactoring is expensive, and copy paste is the quickest possible way to reuse code without impacting something thats working fine. You don't need to retest what was done before, and if there's a test why not copy and rename that too.</span> <span style="color: #3d85c6;">The junior developer might be tempted or even guided to do this, and I've seen things like this in front office and UI development. The point of this was to suggest that the laziest solution is generally not good for the product or maintenance in the long term. </span><br />
<br />
<h3>
Extend Everything</h3>
<br />
<span style="color: #cc0000;">At university you learn about these object things and extending them. Sounds good, so let's extend everything that means we will be able to use that useful method in this other class.</span> <span style="color: #3d85c6;">This often leads to Spaghetti like code, where everything becomes tightly coupled together. Changing one part of the system can have an adverse impact on a completely different part. Thinking about composition as well as inheritance is an important lesson to learn early, ensuring that a class only actions the intended behaviour and is kept as orthogonal as possible. </span><br />
<br />
<h3>
Ignorance Driven Development</h3>
<br />
<span style="color: #cc0000;">We don't have a product owner who is willing to be accountable for guiding the product, and they're never going to know what they want until they see it. Ok let's build something that we think they'll want and see how we go.</span> <span style="color: #3d85c6;">This is often a sign of an organisational issue and though this can be a successful approach you can end up spending a lot of iterations on prototyping complex systems to find that functionality at the heart of it is really wrong. Tying down the basic requirement, even if just the initial scope should be the goal otherwise you risk a never ending sprint or product iteration.</span><br />
<br />
<h3>
Rabid Prototyping</h3>
<br />
<span style="color: #cc0000;">Dude we've got this really complicated problem where we need to write a highly complicated algorithm to solve it. I've been working for the last 8 hours and I've come up with this sophisticated algorithm to return a single timestamp.</span> <span style="color: #3d85c6;">As developers we can often be tempted to dive down a single path rapidly throwing stuff together and over complicating problems. Often the key is taking a step back or considering the options in a pair. In this case where a huge algorithm is written, it could have been simpler and made more sense to refactor to a different data structure, for example.</span><br />
<br />
<h3>
The Burnout Chart</h3>
<br />
<span style="color: #cc0000;">How many hours have your worked this week? I'm up to 120 hours! </span><br />
<span style="color: #3d85c6;">At the end of the day that's not a sustainable.</span><br />
<span style="color: #cc0000;">My day never ends, so it doesn't count!</span><br />
<span style="color: #3d85c6;">This is a cultural issue that can be costly across a company. Things like this effectively bully developers into staying late and doing working longer or harder than they are comfortable with. In this kind of environment it's a race to who burns out or breaks down first.</span><br />
<br />
<h3>
Heart Break Pairing</h3>
<br />
This relates to either when a pair breaks up, or where someone is a lone wolf developer. In the break up case it makes more sense for the pair to take some cooling off time rather than arguing across the shop floor. In the imaginary friend case it's really difficult, as no one is actually available to pair or code review. <br />
<br />
<h3>
Potential Solution</h3>
<br />
After the above, without good guidance, there are many ruts developers both junior and seasoned can fall into. How can we avoid it? If you're based in London you can look to improve your skills by considering your career as a craft where you take pride in the solutions you build and deliver. The <a href="http://www.meetup.com/london-software-craftsmanship/">LSCC (London Software Craftsmanship Community)</a> and the <a href="http://londonjavacommunity.wordpress.com/">LJC (London Java Community)</a> provide excellent platforms for this.<br />
<br />
If you're not local to a large community group there are some excellent books that can get you started, for example <a href="http://www.manning.com/evans/">The Well Grounded Java Developer</a> is an excellent starting point. <span>Work with your team and more experienced developers to learn from them and improve. This is by far one of the best ways to learn and improve.</span><br />
<span><br /></span>
The feedback from the talk was really positive and a range of people took different things from it. Some thought that methodologies are too ideal, and not indicative of the real world. I fear this is probably true for many developers, and bad habits come as a given practice. Others had seen problems like this themselves in different teams over the years, and could look back on these experiences and have a good chuckle. Others were interested in how they could improve and went away looking for books and resources to do so. <br />
<br />Anonymoushttp://www.blogger.com/profile/07726019498269380968noreply@blogger.com0Greater London51.392886 -0.310496730.961080999999997 -40.7401842 71.824691 40.1191908