Upgrade to Pro — share decks privately, control downloads, hide ads and more …

The Node Trojan - how to inject fun into Java Web development

The Node Trojan - how to inject fun into Java Web development

Presentation given at the Trondheim Developer Conference in 2014 (http://trondheimdc.no/event/espen-dallokken-the-node-trojan-intro-of-how-to-inject-fun-into-java-web-programming/)

Web development in Enterprise stacks like Java is a pain. The tools are bad, outdated and not really geared towards professional front-end development. Being frustrated by this the developers at Finn.no started building a Trojan horse which contained all the goodies we’ve been using on personal projects into out daily work. This talk will show you some of the tricks and outline more motivation.

Espen Dalløkken

October 28, 2014
Tweet

More Decks by Espen Dalløkken

Other Decks in Technology

Transcript

  1. THE NODE TROJAN: – 'HOW TO INJECT FUN INTO JAVA

    WEB PROGRAMMING` by Espen Dallokken @TDC, Trondheim, 2014
  2. Espen Dalløkken (37,5) Work at Finn.no in Oslo, Norway Lead

    Developer of Front-end Core Team Web developer since 1998 Web Rebels Conference organizer
  3. Java Web Development is broken • The tools are old

    and outdated • The frameworks are bloated and outdated • No ecosystem or working community
  4. One Of Java's Many Weak Points: • Tooling for web

    developers are beyond broken • No innovation and little upkeep • The Java community can't keep up with developers working in Ruby, Python,PHP or Node
  5. *Easy Targets To Attack* • Build tools: minifying, compression, uglifying,

    etc • Automating JavaScript tests • Code quality tools: linting, ++ • Use module eco systems like NPM & Bower • New language features in ECMAScript 6 with Traceur • CSS Compilers: SASS, LESS, Compass, ++
  6. !Nashorn Won't Save You ( at least not yet )!

    • It will get better, but right now it's not quite there • Oracle have never cared about the Web or web developers (or anything besides the size of Larry's yacht ) • But, it is way better than Rhino
  7. • We can write any tool we want anywhere in

    the stack • We can fix / patch any tool we use • We can do all this without having to explain to Java dev's why it is important NodeJS Empowers Web Devs
  8. Applying structural changeS • Architectural changes to running software are

    similar to improving existing roads • Closing down the road is not always an option • Gradually making changes takes longer, but reduce risk & keeps traffic flowing
  9. No Revolution :( • We had to stay open for

    business • A revolution would impact 100+ developers over a longer period • Influence our system for Continuous Integration and our ability to deliver customer value
  10. ------- ConstraintS -------- • Our Continuous Integration tools were centered

    around Maven – Atlassian Bamboo – The FINN Pipeline • Our web applications were all Java modules built with Maven • All modules should install with 1 command: mvn install
  11. ?Our biggest pain pointS? • Java has no decent mechanism

    for front-end dependencies • Quality tools are a mess – Testing – Code quality • Assembling web application with existing Java tools were terrible
  12. * Karma - a good thing * • Introduced the

    Karma test runner with a Maven plug-in • Added Node awesomeness for front- end coders to utilize • A small win, but we had started the journey towards Productivity Nirvana!
  13. !Exec Just Won't Do! • Downside: people have to have

    Node installed • Downside: people had to maintain versions etc • Downside: CI and things need Node
  14. -The Trojan Horse- • Maven-frontend-plugin https://github.com/eirslett/frontend-maven-plugin • Enables using Node

    in existing Java modules without anyone knowing! • Created by Eirik Sletteberg
  15. ?In secret you saY? • Totally secret! ( kind of

    ) • Downloads & installs Node + NPM • Configures and looks likes any other Maven plug-in • Only thing people will see is a little bit more Maven log gibberish than usual
  16. *The Business Goal* • Our goal was frictionless sharing of

    front-end components throughout our company • We thought Node Packaged Modules (NPM) would enabled us to reach our goal “JavaScript libraries shouldn't have to be Java WAR artifacts” - everyone-who- has-done-this....
  17. *Guerrilla tacticS* • Leverage Node whenever possible for internal applications

    – Dashboards and visualizations – Internal admin tools, etc • Relentlessly attack existing pain points with Node powered solutions “Enable legacy Java application to tap into our local NPM ecosystem” - me, just now
  18. *The common cuckoo approacH* • Deploying NPM artifacts to Maven-

    repos • Maven-deploy module https://www.npmjs.org/package/maven-deploy • Created by Gregers G. Rygg
  19. Things we haven't made yeT • Node has awesome tools

    for live reload • Make these tools with Java IDE's such as IDEA without hassle • Watch tools that play nice with Tomcat/Jetty & friends
  20. Node All The Things! • Start creating internal apps using

    Node • Dashboards for internal stuff • Seeing is believing, so show people what you can do with Node!
  21. !Show, don't just tell! • We are in the process

    of rolling out our first Node apps to customers • Almost every new internal application is made with NodeJS • 40+ developers signed up for an internal NodeSchool.io event • FINN developers are engaged in NodeJSOslo, NodeSchool Oslo, etc
  22. PhantomJS powered Tests • Phantom gives you control of IO

    • Enables testing things like tracking beacons etc
  23. Oh, but I can't because... • Take responsibility for your

    own happiness • Nodejitsu, Joyent, Herkou, Azure, ++ all have free accounts where you can run Node
  24. resources • Demos used in presentation: https://github.com/leftieFriele/tdc2014d emo • Modules

    – maven-deploy https://www.npmjs.org/package/maven-deploy – gulp-maven-deploy https://www.npmjs.org/package/gulp-maven-deploy – Frontend-Maven-Plugin https://github.com/eirslett/frontend-maven-plugin
  25. You Should Not Remain Calm And Keep Going! Start Your

    Revolution, NOW! @leftieFriele http://animalnewyork.com/