Issue 36 - June - Today Software Magazine

Page 1

No. 36 • June 2015 • www.todaysoftmag.ro • www.todaysoftmag.com

TSM

T O D A Y S O F T WA R E MAG A Z I NE

Download from

Windows Store

strix

tflix Hy Fault-Tolerant Microservices with Ne Cone Architecture

IoT Applications using Java ME Embedded 8 Model Driven Design – theory to practice Shaking hands in software projects The key to succeed Techsylvania 2015 On the Product Managers in IT A smile won’t bring the spring the science of organizational happiness

Minimum Delightful Product Interview with Rohan Chandran Unconference review: ITAKE Review JS Camp What Is Really TDD? A retrospective of an alternative year at ACADEMY+PLUS Long distance relationships can really work!



6 Minimum Delightful Product - interview with Rohan Chandran Ovidiu Mățan

8 A retrospective of an alternative year at ACADEMY+PLUS Gloria Csiszer

10 Unconference: ITAKE Ovidiu Deac

12 JSCamp 2015 Alexandru Botez

14 Techsylvania 2015 On the Product Managers in IT Călin Biriș

17 Cone Architecture Adrian Bontea

19 Shaking hands in software projects - The key to succeed Raluca Radu

21 Model Driven Design – theory to practice Daniel Donea

26 What Is Really TDD? Alexandru Bolboacă

28 Fault-Tolerant Microservices with Netflix Hystrix Radu Butnaru

32 IoT Applications using Java ME Embedded 8 Dănuț Chindriș

35 Long distance relationships can really work! Florin Roman

37 A smile won’t bring the spring the science of organizational happiness Szilárd Kacsó


editorial

W

Ovidiu Măţan

ovidiu.matan@todaysoftmag.com Editor-in-chief Today Software Magazine

e are getting ready for our holidays and our thoughts are already flying towards the sunny beaches or the shadeful mountains. We are going to get away from the daily rush and maybe the moments of relaxation will also give us the opportunity of a fresher and newer perspective on the things that surround us. Maybe we will have the chance of some flashes of inspiration, when we may be surprised that in the game of imagination might also enter the most whimsical abstractions and ideas. That is because, no matter how hard we try, we cannot totally free ourselves from our professional side – even though we are on vacation – these ideas can materialize into original software or hardware projects. Most of the times, you don’t believe that these projects can be realized immediately or you have doubts that they can be put into practice. That is why I invite you to send them to the address idei@todaysoftmag. com, in order to discuss and analyze them. We will even try to lay the foundation of a mini-community, which will be formed by those who send such ideas and projects. Techsylvania 2015, which took place in Cluj, has reached its second edition. We hereby wish to congratulate the organizers on the progress made compared to the last year’s conference, by enhancing the quality of the speakers, extending the event on two days and attracting a much higher number of participants. As the end of May and the beginning of June were full of events, in this number you can find a series of reviews on them, under titles such as: Unconference:ITAKE, JSCamp 2015, Techsylvania 2015 – On the Product Managers in IT, The Retrospective of a Year in the Academy Plus. Taking advantage of the Techsylvania 2015 event, I carried out an interesting interview that you can find in the magazine under the title: Minimim Delightful Product – Interview with Rohan Chandran. In regard to the technical articles, we would like to mention Conic Architecture – an alternative to using the Layers pattern. Still in the area of software architecture, we propose Model Driven Design – from theory to practice. From the programming area, we have published in this issue Fault-Tolerant Microservices with Netflix Hystrix and a first article on IoT: IoT Applications with Java ME Embedded 8. We let you discover the rest of the articles of this issue and we hope you will enjoy reading them!

Ovidiu Măţan

Founder of Today Software Magazine

4

no. 36/2015, www.todaysoftmag.com


Editorial Staf

Editor-in-chief: Ovidiu Mățan ovidiu.matan@todaysoftmag.com Graphic designer: Dan Hădărău dan.hadarau@todaysoftmag.com Copyright/Proofreader: Emilia Toma emilia.toma@todaysoftmag.com Translator: Roxana Elena roxana.elena@todaysoftmag.com Reviewer: Tavi Bolog tavi.bolog@todaysoftmag.com Accountant : Delia Mircea delia.mircea@todaysoftmag.com Printed by Daisler Print House Made by

Authors list

Alexandru Bolboacă

Daniel Donea

Agile Coach and Trainer, with a focus on technical practices @Mozaic Works

Associate IT Consultant @ msg systems România

Adrian Bontea

Ovidiu Deac

Software Craftsman @ Yardi România

Independent Consultant & Functional Programming Advisor @ Ullink

Alexandru Botez

Raluca Radu

alex.bolboaca@mozaicworks.com

adrian.bontea@yardi.com

alexandru.botez@geminisols.ro Web Developer @ Gemini Solutions

Dănuț Chindriș

danut.chindris@elektrobit.com Java Developer @ Elektrobit Automotive

Today Software Solutions SRL str. Plopilor, nr. 75/77 Cluj-Napoca, Cluj, Romania contact@todaysoftmag.com www.todaysoftmag.com www.facebook.com/todaysoftmag twitter.com/todaysoftmag ISSN 2285 – 3502 ISSN-L 2284 – 8207

Gloria Csiszer

gloria.csiszer@pitechnologies.ro Marketing Specialist @ Pitech+Plus

Florin Roman

florin.roman@tss-yonder.com Delivery Manager @ Yonder

daniel.donea@msg-systems.com

ovidiu@agile-bit.com

raluca.radu@betfair.com Product Owner @ Betfair

Szilárd Kacsó

kacso.szilard@happy-employees.eu CEO & Trainer @ Azimut Happy Employees

Radu Butnaru

rbutnaru@sdl.com Senior Developer @ SDL

Călin Biriș

calin.biris@loopaa.ro Digital Director @ Loopaa

Ovidiu Măţan

ovidiu.matan@todaysoftmag.com

Copyright Today Software Magazine

Editor-in-chief Today Software Magazine

Any reproduction or total or partial reproduction of these trademarks or logos, alone or integrated with other elements without the express permission of the publisher is prohibited and engage the responsibility of the user as defined by Intellectual Property Code www.todaysoftmag.ro www.todaysoftmag.com

www.todaysoftmag.com | no. 36/june, 2015

5


interview

Minimum Delightful Product Interview with Rohan Chandran

I

had the pleasure of interviewing Rohan Chandran on the topic of product management, during the second edition of the event dedicated to entrepreneurship, Techsylvania. The concept described in his presentation within the event is the Minimum Delightful Product, a subtle modification of the well-known concept of Minimum Viable Product, but one which has a great impact.

Ovidiu Măţan

ovidiu.matan@todaysoftmag.com Editor-in-chief Today Software Magazine

6

no. 36/2015, www.todaysoftmag.com

[Ovidiu Mățan] Minimum Delightful product is a great idea for developing new applications. Please describe it in a few words for our readers who couldn’t attend Techsylvania. [ R o h a n C h a n d r a n ] M i n i mu m Delightful Experience is an evolution of the well-known concept of the Minimum Viable Product. In fact, the intentions are exactly the same. However, I believe that the change of two words causes a radical shift in how we approach it, because our thoughts and actions are shaped by the words that we use. The key concepts here are: a) The purpose of doing this at all is to find Product-Market fit. MySpace, Friendster, Orkut and other social networks all found problem-solution fit. Facebook found product-market fit. b) You are building an Experience, not a Product. A Product tends to be a set of features that you deliver. An experience engages and embraces a person. It tells a story, and evokes some emotion. When you connect on that level, people will respond to what you deliver, and actually

Rohan Chandran Vice President and GM, Mobile Business Unit at Telenav

become a part of the process of evolving it into the ultimate vision. c) You are aiming for Delight, not just Viability. When you do the latter, you check off a list of features, and ask your user to validate whether they have been checked off. When you aim for delight, you are creating wonder, awe, surprise, that feeling of “wow!” You want your user


TODAY SOFTWARE MAGAZINE to feel like a child does when they discover something new. d) The hardest, and most critical thing, is the Minimum. Your goal needs to be to create the smallest self-contained delightful experience that allows you to validate product-market fit by testing specific hypotheses that you set up. Anything extraneous should be left out, until you have product-market fit established.

What will be the minimum for a new online service that is selling something/ flowers? Should they try monetization from Day 1 ? [Rohan Chandran] If you’re selling s omet hing, t hen abs olutely, your Minimum Delightful Experience has to include the monetization component – after all, that is the cornerstone of your business. What you probably would want

Knowing your audience for a startup is an important thing. How should a startup consider target audience segmentation? [Rohan Chandran] I read something a couple of days ago – my French is not perfect, but it translated roughly to “You must reach the people who count, not count the people you reach.” These are simple but profound words when you’re starting out. We all tend to see the great success stories, but ignore how much went into getting there. Josh Elman, formerly of Twitter, does a good talk explaining how Twitter found its path to growth and success in the early days. Their key, and the key for everyone, was to understand the nature of the user base that was truly engaged, to understand their behavior and how they used the service, and figure out how to replicate that. When you’re starting out, the first challenge is to have a clear target in mind. You might segment by geography (as Uber did), or by demographics of some sort, but don’t try to please everybody. Note that this doesn’t always mean that people outside your segment cannot participate, but they are not what you are targeting explicitly. From then onwards, it’s about looking at the data and understanding the engagement. You may be surprised – you thought you were selling flowers to errant husbands who needed a last minute bouquet, but your best audience may be daughters sending flowers to their mothers.

How do you see Product Management in an Agile world? How does it work with development and design cycles ? [Rohan Chandran] The art and science of Product Management is evolving. The goal of a product manager in an agile world is similar to the goal of a startup founder/CEO. To define the context for the

team – what are we trying to achieve and how will we measure success; to ruthlessly prioritize – define what the MDE is and how we iterate from there; and to enable and facilitate however needed to help all members of the team deliver – which means being a jack of all trades as well as a master of a few. Any tips for designing a delightful product? [Rohan Chandran] There isn’t a magic formula, but I would above all countenance people to focus on the minimum, because if you can keep that constrained, you are already halfway towards a delightful experience. It is the hardest and therefore most critical thing to do, because there are always more little features and ideas that you imagine will make your product better. Beyond that, it is essential to be really open minded and unattached to your ideas, and then to get users – real people – looking at your experience very early on. Go out to coffee shops, bus/train stations and ask people for their feedback. Watch their body language, and learn to read between the lines, and you’ll know to do here is focus on a narrow geogra- very quickly if you’re delighting them or phy, with maybe just one type of flower not. and arrangement. You’re not trying to test whether people prefer roses or tulips – you are trying to validate that they actually want to use your service as you have set it up. Have you made it simple and delightful for them to order from you, and can you fulfil their order? If you get that right, adding different flowers, different geographies, and the like, is the easy part.

www.todaysoftmag.com | no. 36/june, 2015

7


education

A retrospective of an alternative year at ACADEMY+PLUS

A

CADEMY+PLUS is heading to a new generation of students. A year full of activities grew new talents and also grew the confidence of other stakeholders for the project.

Gloria Csiszer

gloria.csiszer@pitechnologies.ro Marketing Specialist @ Pitech+Plus

This revolutionary learning method for the IT industry, based on program aligned with the market needs, was launched last year in Cluj-Napoca by PITECH+PLUS, after signing a partnership with Ecole 42, from Paris. The main objective of this alternative learning method was to find clever minds that will create tomorrows IT products.

Besides the practice, students develop selfresponsibility After a rigorous selection, during the academic year students accessed a platform where in just a few months they learned different programming languages like: C, UNIX, PHP and JavaScript. They also learned how to work on real projects, having individual tasks or working in a team, which helped their decisional ability. The students developed different skills going to events and competing at contests like: 3 Day Start-Up, Start-up

8

no. 36/2015, www.todaysoftmag.com

Weekend, Techsylvania’s Hackathon and Open Data Hackathon, where 5 of them also won the Best Hack prize for the app I need medication. During this first year, the staff also focused on the next generations by engaging students and stimulating their interests for coding. At the head office of the academy, on a regular basis, junior kids participated at Coder Dojo, where they learned code related stuff by playing all sort of games on the computer. Highschool students from different cities participated at the Game of Codes championship, where they had to code for 12 hours battleship games following specific


programare

TODAY SOFTWARE MAGAZINE

rules. The second edition of this event will in France who applied for the courses at take place this autumn. Ecole 42. This stage of 28 days gathers the subjects covered during 4 years of Helping recruitment in the IT field high-school with maths and informatics One of the long-term objectives for specializations. After finishing last year’s ACADEMY+PLUS is to increase collabo- pool, a student with no background in IT, ration between the companies in search of passed the hiring tests in an IT firm and work-force, becoming a source of well-per- is a good example of how much this stage forming staff for the IT market and solving matters as knowledge and experience with this gap that keeps increasing. The summer hands-on projects. is dedicated to mandatory internships for all the academy students. PITECH+PLUS Next level: gamification and other IT companies in Cluj already The community of students has a very selected them for trainings or hired them mixed background, and starting with this on junior positions. year the new studying platform developed by Ecole 42 will support this differences. Dive into the pool It will be based on the idea of gamification. July, August and September are the Progress can be measured by complemonths when new candidates will be ting assignments and tests online where tested in order to be selected for this revo- machine grading and evaluation can be lutionary and free educational system. In used. All the modules will be customized, each of this months more than 120 stu- in order to increase flexibility and will be dents will experiment the pool, a selection personalized for the level of knowledge of period where they have to deliver daily each candidate. Those with a higher theoprojects or work with other candidates on retical level can pass some levels and access more complex projects. They will actually higher ones depending on their interests. solve the same requests as their colleagues Depending on how fast they learn and

work, they can unlock new challenges and bigger projects. For the pools that open in August and September, there are still some spots available, the one in July being already filled with candidates. Those interested can access the memory and logics tests on candidates.academyplus.ro.

www.todaysoftmag.com | no. 36/june, 2015

9


event

Unconference: ITAKE

A

few weeks ago, I received from Ovidiu Matan the invitation to participate, from TSM, in I.T.A.K.E. I had been waiting for this event since autumn, ever since I had a conversation during IT Days with Alex Bolboaca about the “unconference” concept, which I found very interesting. I admit having been a little reserved, given the fact that a “Software craftsmanship” conference had been announced, a movement I do not really resonate with. However, in the program, there were also a few presentations regarding functional programming, and I was hoping to meet more people interested in this subject. Therefore, I didn’t hesitate and I accepted immediately. The location was very good: uptown, for the highbrows. The conference was carried out on several threads, which helped me to shirk from the topics I didn’t find interesting. Of the “keynote speakers”, I liked only Andrea Mocci, who had a presentation on visualizing the code and on the manner in which programmers work. James Lewis and Simon Brown only tackled generalities. To my disappointment, James Lewis spoke about microservices as if it were a new idea, without making any reference to systems such as Erlang, where similar architectures have been developed for over thirty years now and which a

programmer writing microservices could get lots of wisdom from. As for the rest of presentations, I almost exclusively took part in those of the “hardcore programming” area, but I didn’t feel the trip was worth it. I repeat: I didn’t take part in the other threads of the conference. The fact that several presentations were held in parallel was a disadvantage. I might have not chosen the best presentations, but I was not impressed. With few exceptions, the “oh, yeah!” moments kind of lacked - those moments when I might have remarked a new idea that the speaker conveyed. This doesn’t mean I disregard

Young spirit Mature organization A shared vision Join our journey! www.fortech.ro

10

no. 36/june, 2015 | www.todaysoftmag.com

the work of the presenters or that I don’t appreciate their effort; it’s just that I had expected a different level. An exception was represented by the presentation called “Monoids. Monoids Everywhere!”, by Cyrille Martraire, who spoke to us about the way in which, in real applications, we could take advantage of the composability offered by the monoids. He described the monoid in a few slides, as it is defined in the theory of categories and then he showed us how it is applied to real code, which most of us are struggling with. The topic was at the crossroads between DDD and functional


programming. The level was introductory, with no great expectations from the audience. An interesting problem was raised: if we try to choose the models so that they are monoids, the result is more elegant, more composable and easier to use. More presentations of this type would be required in order to rid functional programming of the academic appearance it has in the present and to show us how we could benefit from its techniques in the situations encountered by “normal programmers”.

The most interesting part of the event was, by far, the open space component. In both of the days, the second half was reserved for “open space”. The recipe is quite simple: • The existing space is divided in N areas of discussions. • Time is divided into M periods of about 30 – 45 minutes. • A chart is drawn, showing N * M, “the marketplace” which contains the areas and the time when they are free. • The rules of the game are explained to the participants: anyone may join any discussion and they may leave a discussion whenever they want to. • The chart is filled in with the suggested topics. • Each of those who have come up with suggestions makes an introduction by which to attract participants in the

respective discussion. • Start. Within 15 minutes, two thirds of the 42 slots available for both afternoons were filled up. The rest was filled up later. The chart was full of colourful stickers with very varied topics such as DDD, microservices, Clojure, big data, vim, coaching, functional programming, testing, continuous delivery, Scala, etc. A great part of the merit belongs to the host, Mike Sutton, who was able to make the audience come up with the topics for discussion. The definition given by Alex Bolboaca to the open space, namely “a conference made only of coffee breaks” is very suggestive. This is exactly what happened: involved people, lively discussions, exchanges of contacts. There was no sleeping in the desk at the back of the classroom, no reading of the mails, nor playing on the phone while waiting for the break to smoke. When the information received did not justify the time spent, you simply got up and left towards another area of discussions. Those who were too tired would search for a sofa or a coffee where, of course, another discussion was started ad-hoc. In short: it was an excellent experience. Regarding the quality of the presentations within the open-space, some were better, others less good, but this is not very important. What matters is the fact that the discussions started around the given subjects were successful and that people were actively involved. My impression was that most of them did not come with prepared materials. They drew and improvised on the spot. Not all of the discussions were carried out in a professional manner, not

everybody knew how to speak in public. But again, this was not the point. What matters is the fact that they had the courage to get involved to such an extent, thing which made the event a successful one. In conclusion, I must congratulate those at Mozaic Works on the organization and, most of all, on the chosen format. No doubt, the event was one worth going to. I hope that, in the future editions, the openspace part will take up most of the time. I will definitely try to apply this format to the future meetings of the functional programming community. I also hope that the organizers of IT events in Cluj, and not only, understand the value of such a format so that we may also have a local unconference soon.

Ovidiu Deac

ovidiu@agile-bit.com Independent Consultant & Functional Programming Advisor @ Ullink

www.todaysoftmag.com | no. 36/june, 2015

11


event

JSCamp 2015

T

he 2nd edition of JSCamp, A JavaScript conference for Romania and Eastern-Europe, took place on the 2nd of June in Bucharest at Radisson Blu Hotel.

The event was organised for front-end developers, engineers and web designers who wanted to learn about more advanced aspects of the JavaScript language or hear about the experiences of great people in the web industry. It was split into four sessions (2 talks per session), about various topics including open-source projects, coding standards, testing, experiences, rendering graphics and even web audio. In-between the sessions there were coffee and launch breaks, where participants could meet with the speakers or other JavaScript enthusiasts. The day star ted with Kenneth Auchenberg, who is the tech lead on GoToMeeting Free at Citrix and also started the RemoteDebug project to unify remote debugging. His presentation was called “The future of DevTools with RemoteDebug”, and he talked about the power of remote debugging, cross-browser DevTools and why there’s need of a common interface to our browsers. He believes that in order for developers to be productive we need to first rethink our tooling. He was followed by Sebastiano Armeli, a software engineer at Spotify. He has developed and designed applications using JavaScript, Java, Ruby, but he is most

12

passionate about JavaScript and web development. He is the author of the ebook “MVC applies to JavaScript” and a jQuer y plug-in to lazy load images called JAIL. His talk “Enforcing coding standards” tried to convince the part i c i p a nt s o f t h e importance of coding standards and told them what kind of standards they use at Spotify to ease their lives. Some of the tools and standards used by Spotify are EditorConfig, JSCS, AngularJS style commits, Gulp, Plato, QuickStart, etc. After the short coffee break, the 2nd session started with Krasimir Tsonev, a front-end developer, blogger and speaker. He wrote “Node.js blueprints” and currently works for TrialReach, a London based health startup. His presentation was called “Crafting client-side testing” and he talked about the importance of having tests, because they allow us to extend and refactor our code with ease. He believes

no. 36/june, 2015 | www.todaysoftmag.com

that writing tests makes software development much more interesting and leads to better code. Felix Palmer followed him. He got into software by writing games in Flash, has a physics background and enjoys combining the visual with the technical. In his presentation “How to build PhotoShop - WebGL not just for 3D”, he explained the basics of WebGL and live-coded some image editing techniques like: scaling, translating, rotating, simple colour tricks, blending, warping and pixel effects. After the launch break, Sebastien Cevey, software engineer at the Guardian, opened the 3rd session. Currently he is


TODAY SOFTWARE MAGAZINE

lead developer of Composer, the new digital-first CMS. His presentation was called “The reactive loop” and he talked about Virtual DOMs, MVC, data-binding and the advantages of using React/Flux. The 3rd session was finished by Remy Sharp, the crowd favourite based on the applauses. He is the founder of Full Frontal, the UK based JavaScript conference. He runs his own development and training company called Left Logic and he also built: jsbin.com, html5demos.com, remote-tilt.com, and many others. In “The bits behind JS Bin” he told the story behind JS Bin: how it was originally built in 4 hours, why it moved to Node, and some of the challenges in running the app. After another short coffee break, the last session was started by Charlie Robbins, founder and CEO of Nodejitsu. He is an open source enthusiast, author of many popular Node.js modules such as forever, winston, nconf or node-http-proxy. In his presentation “Keeping important code

alive”, between the many Star Wars references and American memes, he talked about his experience in building opensource projects. Having 10+ millions downloads / month he shared that it’s terrifying getting so much attention and that he also gets a lot of “abuse” and negativity from the users. Another thing he pointed out is that, when a project gets this big, the author sort of becomes the manager, and needs to get a team. The day was ended by Jan Krutisch, a freelancing web developer and author of liv3c0der. His talk was called “Javascript patterns for contemporary dance music” and, playing some neat beats using Web Audio API, he demonstrated that music can be coded live in a browser using JavaScript. Personally, I found the conference very interesting and informative. The speakers and participants were very friendly and talkative and the location was also nice, the conference room, although it was full,

didn’t feel crowded and the beverages and food were also good. I can’t wait for the next edition, which I’ll definitely attend again!

Alexandru Botez

alexandru.botez@geminisols.ro Web Developer @ Gemini Solutions

Our core competencies include:

Product Strategy

Product Development

Product Support

3Pillar Global, a product development partner creating software that accelerates speed to market in a content rich world, increasingly connected world. Our offerings are business focused, they drive real, tangible value.

www.3pillarglobal.com

www.todaysoftmag.com | no. 36/june, 2015

13


event

Techsylvania 2015 On the Product Managers in IT

W

hen I arrived to Techsylvania, at the Students’ Arts Center, everybody was still in the break between the panels, though I was a little late. I met some of my online colleagues and we exchanged a few words on the event. They appreciated a lot the quality of the content they had received in the two days and told me that their expectations had been exceeded. Călin Biriș

calin.biris@loopaa.ro Digital Director @ Loopaa

I hurried up in order not to miss the panel. The following people entered the stage: • Christopher Osborne (Booking. com) – Moderator, • Felix Petersen (Amen), • Edin Memisevic (FoodPanda / Rocket Internet), • Gabriel Radic (EatFirst / Rocket Internet), • Rohan Chandran (Telenav).

when to develop (a new feature); • within a bigger organization, a Product Manager has to build inertia and gravitational force around the idea that he wishes to develop. They can do this thing by testing the hypothesis and projects in an incipient phase, trying to get a good feedback among the potential clients; • a product manager is a “translator” between the CEO and the members of the team. Basically, he has to communicate the desires of both parties on each other’s language, giving them a shape to motivate both parties to get involved.

The speakers began to talk about the role and the qualities of a successful Product Manager in an IT company. I will reproduce below some of their interesting answers: What are the qualities of a Product

What is a Product Manager and what does he actually do? • he needs to figure out the rules of the game and he has to be aware of the importance of winning; • he is a salesperson who has to sell his projects both internally, to the members of the team, and to the other interested parties; • the Product Managers establish a hierarchy of priorities and have to make decisions regarding what to develop and

14

no. 36/2015, www.todaysoftmag.com

Manager?

What should we look for when hiring a Product Manager? • he/ she is a resourceful person • he/ she has strong beliefs in order to sustain the things he/she believes in, but in the same time, to the contrary, he/she lacks ego and does not wish for recognition. I would have put it differently. I believe a Product Manager needs to be a good salesperson, he/she has to know how to convincingly communicate an idea, but


he/she has to be willing to negotiate and personal feedback. He is not the boss, accept different opinions; nor does he make annual assessments • he/she is a good psychologist, capable of the staff. His role is to evaluate situto understand the human behavior of his/ ations, specifying what functions and her team mates as well as that of his/her what doesn’t, providing the conditions clients; for solution within the team; • he/she is not afraid to make mistakes. • it is important for a Product Manager A good Product Manager takes this risk, to generate an environment that is favolearns from mistakes and is always ready urable to making decisions in the team to start all over again; and to the collaboration between the • he/she has technical skills, or at least members. he/she understands them; • he/she is a person you like to have a 2. How do you work with a remote team? conversation with; • a team having its members at a dis• he/she has had successful projects tance from one another can function before; well on the execution level, provided • he/she does not forget about the clithat everyone is clearly told what to do; ents’ power in validating the new ideas and • this work method does not funcprojects. He/She always tests hypothesis; tion / is not recommended for startups • he/she always relates to data. or wherever there is a need for quick decisions; Questions from the audience • the good way to build remote teams which can work well together is to give How should a Project Manager provide them the opportunity to get to know feedback? each other from the beginning and in • a Product Manager never gives person, face to face;

• finally, the solution can be found in the book entitled ReWork1. Time flew away. I couldn’t believe how fast. I enjoyed the panel. The speakers talked from their experience and this could be felt. I wished I could have remained at this event, but I wasn’t able to do that. I am glad we have more and more important names on the scene of the events in Cluj. I wonder who is going to come to the next edition of Techsylvania?

1

http : / / w w w. e m ag . ro / re work - j a s on - f r i e d -

d av id-heinemeier-hanss on-pub978-973-1931-77-7/p d/ EYB260BBM/?ref=ps&emag_click_id=d7e084bdad01994d97e0b1 0cc7d62e3a

www.todaysoftmag.com | no. 36/june, 2015

15


communities

IT Communities

T

he main events of the following months are in the Meetup area. Though restricted, they create the premises of a better communication with the representatives of the local community. We notice a welcome increase in the number of events that have JavaScript as a main theme. We invite you to take part in the events and join the local community.

Transylvania Java User Group Community dedicated to Java technology Website: www.transylvania-jug.org Since: 15.05.2008 / Members: 598 / Events: 47 TSM Community Community built around Today Software Magazine Websites: www.facebook.com/todaysoftmag www.meetup.com/todaysoftmag www.youtube.com/todaysoftmag Since: 06.02.2012 /Members: 2270/ Events: 31 Cluj Business Analysts Comunity dedicated to business analysts Website: www.meetup.com/Business-Analysts-Cluj Since: 10.07.2013 / Members: 91 / Events: 8 Cluj Mobile Developers Community dedicated to mobile developers Website: www.meetup.com/Cluj-Mobile-Developers Since: 05.08.2011 / Members: 264 / Events: 17 The Cluj Napoca Agile Software Meetup Group Community dedicated to Agile methodology Website: www.agileworks.ro Since: 04.10.2010 / Members: 437 / Events: 93 Cluj Semantic WEB Meetup Community dedicated to semantic technology. Website: www.meetup.com/Cluj-Semantic-WEB Since: 08.05.2010 / Members: 192/ Events: 29 Romanian Association for Better Software Community dedicated to experienced developers Website: www.rabs.ro Since: 10.02.2011 / Members: 251/ Events: 14 Tabăra de testare Testers community from IT industry with monthly meetings Website: www.tabaradetestare.ro Since: 15.01.2012/Members: 1243/ Events: 107

Calendar Iunie 18 (Cluj) Launch of issue 36 al Today Software Magazine www.todaysoftmag.ro Iunie 22 (Cluj) JavaScript Cluj Meetup #3 – Typescript for the programmers who like Javascript meetup.com/JavaScript-Cluj/events/222153313/ Iunie 23 (Cluj) Security Cluj Community Launch meetup.com/Security-Cluj-Meetup/events/222809785/ Iunie 24 (București) June BucharestJS Meetup meetup.com/BucharestJS/events/222955233/ Iunie 25 (Timișoara) TdT #33 - Risk Based Testing with Ladislau Szilagyi m e e t u p . c o m / Ta b a r a - d e - Te s t a r e - T i m i s o a r a / events/222661575/ Iunie 27 (Cluj) Youth Innovation Week in Cluj-Napoca eventbrite.com/e/youth-innovation-week-in-cluj-napocatickets-17350442641 Iunie 30 (Cluj) Digital Romania ccifer.ro/ro/ Iulie 7 (Cluj) Top Notch Server-side Javascript meetup.com/Cluj-JS/events/222611466/ Iulie 16 (București) Bucharest Mobile Development Group meetup.com/Bucharest-Mobile-Development-Meetup/ events/222785583/ Iulie 21 (Brașov) F.7 - The memorable experience - experience design and gamification meetup.com/bv-tech/events/219375720/

16

no. 36/june, 2015 | www.todaysoftmag.com


arhitecture

Cone Architecture

T

he universe is built on a plan the profound symmetry of which is somehow present in the inner structure of our intellect.” – Paul Valery. Clean Architecture is great! Let’s try that again…Clean Architecture is beautiful! Clean Architecture is symmetric! Clean Architecture is natural! Clean Architecture should really be common sense! Adrian Bontea

adrian.bontea@yardi.com Software Craftsman @ Yardi România

Clean Architecture is the structure that naturally emerges when truly applying DIP: “High level modules should not depend on low level modules. Both should depend on abstractions” “High level modules” is about the most important part of an application implementation. It’s about the policies of the application, the general abstractions that govern the entire application; it’s about the truths that do not vary when the details are changed. By contrast, “low level modules” is about the details. These are generic technical mechanisms that support the high level modules: logging, OOM, ORM, email, sms…

For decades, we have been structuring applications using Layers. For decades, Layers have been synonym with good application architecture – you either had layers or you had the BBOM (Big Ball of Mud anti-pattern) For decades, we have claimed to fully apply SOLID but the truth is we did not. At most, we have been applying SOLI. At least in the .NET world, Layers violates DIP by imposing a reference from the high level assemblies to the low level assemblies which are part of the Infrastructure layer:

How is Clean Architecture different?

What’s wrong with Layers?

Simply put, Clean Architecture conforms to DIP, Layers does not. Clean basically concentrates The traditional Layers pattern violates the most important part of an application DIP and by doing so it involves some unfor- implementation in the core, while it externatunate consequences. lizes all the details. www.todaysoftmag.com | no. 36/june, 2015

17


arhitecture Cone Architecture The powerful principle that makes this pattern work is called concentric circles that makes you see the forest for the trees. the dependency rule: “Source code dependencies can only point inwards”. This is in fact a more pragmatic definition of DIP. OK now what’s with the weird title?! In my view, Cone Architecture is just a better metaphor for Is it just about the dependency rule? this type of software structure. And yes, I came up with that term If you imagine an asymmetric model derived from classical and no, it’s not popular. Layers but conforming to DIP it would look something like the It involves two different perspectives: if you look at it from following: above, you see some concentric circles governed by the dependency rule that source code dependencies can only point inwards. That’s a pure technical view. But if you look at it from aside, you can clearly see what DIP means by “high level modules” and “low level modules”. You can now clearly infer the layers hierarchy by their level of abstraction. The inner circles are higher level than the outer circles. The longer version of this article including more details and examples is available here.

The arrows represent source code dependencies, not call chains. The fact that Clean Architecture representation is symmetric using the concentric circles is not a coincidence. It may not be so obvious, but it hides a very powerful principle: all the details are just details! Clean Architecture focuses on the most important part of an application implementation. This is the application core and this is what DIP has been referring to as “high level modules” for over a decade. And from the point of view of the application core, the delivery framework is nothing more special than the database or the logging framework. This is why Clean Architecture drives development towards a “domain - out” approach and feels like a more comfortable house for Domain Driven Design in general. This is why delaying the decisions on technologies feels more natural when using the Clean Architecture. It’s the very mental model imposed by the

18

c


management

Shaking hands in software projects The key to succeed

I

n a dynamic world, in which business objectives change along the domain trends and based on the ever varying consumer’s interest, the mutual understanding of the requirements by those that formulate them and by those who implement them represents the key to succeed in software development projects.

Raluca Radu

raluca.radu@betfair.com Product Owner @ Betfair

Especially when developing products on multiple sites, condition which becomes more and more common amongst business companies, along with the globalization, not just regarding the customer base but also concerning the development of the product and the teams that deal with these activities, which also spread on different continents and cultures, it is of most importance to correctly understand and quantify the product requirements and product solution based upon the first. Misunderstanding, misinterpreting product requirements causing erroneous implementations and forcing projects to derail, exceeding costs and discovering defects too late in the process, leads too many times to unnecessary and pricy functionalities that too few use for those to justify their cost. As a solution to misunderstood or badly communicated requirements stands the shaking hands method which brings not a definitive answer but a way towards improving the formulation and communication of the product requirements and the offering of viable solutions to fulfill them. The method can also be described as a sign of, hand over or validation of the requirements/solution. Many of us do this all the time, at each meeting with our stakeholders or clients, but it

becomes obvious in bigger projects with higher business priority that those methods are imperative for being able to benefit from effective solutions, for increasing the customer base and for proactivity on the market. In short, it becomes essential to shake hands upon the solutions proposed for fulfilling the product requirements between those who formulate the requirements and those that accomplish them. There are artefacts that facilitate the shaking hands method like the proof of concept (POC), prototyping and design, descriptive documents of APIs (Application Programing Interface), UML models, architectural diagrams, etc. I will describe below a few of those that I have used in the projects I have worked on, along with the benefits they bring in the communication between the clients, stakeholders, product managers, product owners, business analysts and architects, tech leads, delivery managers, implementation team, SCRUM teams. The POC or Proof of Concept represents a demonstration having the scope to verify that certain concepts or theories are applicable in the real world. Another terminology used is that of a “proof of principle�. A POC in developing software products describes distinct processes with different objectives and different participants, may also

www.todaysoftmag.com | no. 36/june, 2015

19


management Shaking hands in software projects - The key to succeed offer partial solutions based on a smaller number of users acting in business roles for establishing if a system satisfies specific product requirements. Therefore, the main objective of a POC is to find solutions to technical challenges, like the way in which systems can be integrated or like obtaining data (which result from determined processes) by using certain configurations. A few years ago, I was working for an outsourcing software business; a pretty big client of this company was in need of a complex piece of functionality which required more development teams and many months of work. To ensure the fact that we had correctly understood the requirements, we decided to start a POC with the client’s agreement. It was a success, the client saw a prototype of the solution which would accomplish their goals; we discovered gaps in the requirements, that would have been exposed otherwise too late in the development process, we even changed the client’s opinion on certain requirements and gave up altogether others. The proof of concept helped with the communication between us and our client, us being the ones implementing the solution. We felt owners of the proposed Solution having the client’s full agreement. “Prototyping and design” symbolizes the creation of interactive interfaces which present functionalities in a visual way. This is an artefact often used in the online world but also in representing any physical or virtual product without actually needing to build it. Axure, for example, is a software application used to prototype and Adobe Photoshop is one used for design. There are

20

c

many similar apps available on the market, but regardless of the tools used, the importance of creating prototypes and designs sits within their visual impact. People perceive better what they can see with their own eyes, they seem to better understand when they have in front of them a model with which they can interact. It is the same with clients or stakeholders, they react much better to an interactive interface which allows them to understand and visualize what will become the product in which they are investing. For the projects I currently work on and where there is an actual need of a visual representation, it is common practice to use prototyping to exemplify and ask the stakeholder’s opinion in regards to product decisions. As a Product Owner, I use this artefact as often as I can to obtain a better understanding of the solution that will be implemented, so as for the stakeholders of those projects to benefit from what they really need and for them to always keep track of the product improvement proposals (in this case I refer to the Betfair site as a product).

Fig. 1 Prototyping

Many other methods can be selected

to facilitate the shaking of hands upon solutions that will implement the product as per requirements. By using them, we can ensure a healthier and smoother transition from requirements to the end product, passing through all refinement processes, from transmitting those and finally implementing and testing the product. When requirements are uniformly understood and the implementing solution is universally accepted amongst the parties involved, only then there can be assurance in a product that accomplishes all real needs and satisfies them by a spot on implementation.


programming

Model Driven Design – theory to practice

T

his article offers a minimal theoretical approach to Model Driven Design through Model Driven Architecture. It describes what a Conceptual Model is and how it is linked with the Domain Model/Problem Model. Afterwards, it offers a simple example of how a Model is created and manipulated in Model-driven Software Development.

Daniel Donea

daniel.donea@msg-systems.com Associate IT Consultant @ msg systems România

First order of business: What is a Model? Presently, there is still a large debate on what a “model” is and how it is linked with a solution. There are several descriptions for models and several types of models (conceptual model, domain model, business model, etc.). In this sense, we should clarify some aspects regarding the terminology surrounding the concept of “Model”.

Based on this Domain Model, we design a Conceptual Model (henceforth called simply “model”) which proposes a possible solution to the Problem. This is an abstraction based on concepts and relationships from the Domain Model. The Model becomes an abstraction to a physical system, in which the developer describes various entities, their attributes, relationships and constraints. This also creConcepts ates a structural view of the Solution, but the Any software solves a customer problem. focus is on what is important rather than on This problem can be divided into several detail. areas of concerns. Based on these areas, we extract topics (themes) that are relevant for What is Model driven design/model driven the software. architecture? A Domain is an area of concern from the There are many views on what Model problem. If the area of concern is a business, Driven Design (henceforth MDD) is and this would be a Business Domain. The term what a Model Driven Architecture (henProblem Domain is a more general term and ceforth MDA) should look like. However, reflects one or all possible area of concerns. the leading opinion comes from the Object In computer science, Domain Models Management Group (OMG) – a consortium consist of representations of all the topics of software organizations that develops and related to a specific problem/area of concern. supports specifications to improve the pracTo put it simply, the Domain Model describes tice of enterprise software development and the problem by splitting it into sub-problems, deployment. depending on the concerns. This is done by This group has created the conceptual fraextracting all the key concepts of the sub pro- mework, called “Model Driven Architecture” blems and linking them together. At the end that separates the business decisions (what of this process, we see a more comprehensive the application does) from the software oriview of the Problem and its possible solution. ented decisions (how does it do it), by using www.todaysoftmag.com | no. 36/june, 2015

21


programming Model Driven Design – theory to practice “an approach to system specification and interoperability based on the use of formal models”.[1] Basically, MDA uses models to describe the business (functionality) of the solution, independent of any system constraints (software oriented decisions). In MDA, “platform-independent models are initially expressed in a platform-independent modeling language”. In short, the model is described according to specification, independent from the programming language in which it will be transformed. The result source code will be described at the time with the model or after the model is finished, but the model will always have priority. The solution proposed in this article is influenced by the Object Management Group’s vision about MDA, so, each model proposal will be based on this Architecture.

Model driven software development

Thomas Stahl describes Model-driven software development (MDSD) as: “an alternative to round-trip engineering. Round-trip engineering is the concept of being able to make any kind of change to a model as well as to the code generated from that model. The changes always propagate bidirectional and both artifacts are always consistent. The transition from code to model (the reverse engineering) is especially interesting in this context. Model Driven Engineering provides the tools used for domain specific constraints and performs model checking.”[2] To put it simply, Model-driven Software Development is the means used to develop applications described by a Model Driven Architecture. Model-driven Software Development is made of: • Domain-specific modeling language (DSML) – models and meta models- in which the relationship among concepts in a domain, constraints and semantics are defined (here we describe the models) • Transformation engine and generators – prepares artifacts (source code) in an automated (or semi-automated) transformation process. (here we generate the code from the models) The end product will be platform specific code that will reflect the described model. This assures not only conceptual consistency, but also helps the functional development of the application. “The ability to synthesize artifacts from models helps ensure the consistency between application implementations and analysis information associated with functional and QoS requirements captured by models.”[3] There are also other advantages of using this type of software development. An example consists of reuse of earlier efforts. The Conceptual model may be Domain specific, but the present solution may be inspired from other projects, or can be used, as a reference for future projects. That results in a reuse of platform dependent solutions, by transforming the model into another Domain specific conceptual model. This approach is supported by the OMG, as it reflects one of the four principles of MDA [1] These are the building blocks for a Model Driven Application. Now it’s time to see it in action. To do this, we must describe a Problem and its potential Modelling Solution.

version, called ‚myRCP‘, he intends to use a variety of applications, with different scopes. Our new application will run in this custom version of RCP as a new perspective. Business transactions will be handled by an Application server. To provide a common framework between these applications, the myRCP Client has defined a data structure that should complement any possible needs. This data structure extends EObject from Eclipse RCP. Eg. - all objects extent MyRCPObject. Domain Model: The application will run in proprietary software. This software contains its own set of contracts (interfaces) for the Objects, and its own custom framework for displaying the visual elements. This software is under continuous change, and our Application must change with it. We separate the business concern (object handling and business functions) from the display concern (page display). By this, Problem we create two separate components: the RCP component and the We assume the following scenario of a Technical Domain: business Component. The RCP component handles all the topics Our client uses as a Graphical User Interface a custom version regarding the page display, action management and any other of the Eclipse Rich Client Platform (Eclipse RCP). In this custom user interaction, while the Business Component will handle the

22

c


TODAY SOFTWARE MAGAZINE business Object management and business functions. These two components will communicate through their common contract – the MyRCPObject. Conceptual Model: Each of the two components will receive their own Conceptual Model. This Model will handle all the possible topics regarding the Technical Domain and, in the same time, the Business Domain of the application. This way, our model can offer a technical view and a functional view of the application.

Motivation

languages and domain specific languages. It covers all aspects of a complete language infrastructure, from parsers, over linker, compiler or interpreter to fully-blown top-notch Eclipse IDE integration. It comes with great defaults for all these aspects which at the same time can be easily tailored to your individual needs.”[4] Xtext provides a simple way to design any domain-specific language. After the architect describes the grammar used by the domain specific language, xtext will generate a working parser and linker. This parser will be used in the development of the Conceptual model description. The developer will simply describe the conceptual model in the DSML using the generated xtext parser, focusing only on what is essential to the business aspect of the solution, and not the implementation. Xtext also offers Eclipse support and many other tools used in the grammar development and in the model development like: content assist, validation and quick fixes, advanced Java integration, Integration with other eclipse tools, etc. By defining the model with the parser, we assure the compliance with the four principles of MDA, example from [1]: a. The model is in a well-defined notation b. The system is organized around a set of models that support transformations c. The meta-model component consists of the xtext grammar d. Xtext is a open source framework.

The RCP component is developed within a custom proprietary framework - myRCP. This framework defines how the graphical elements will be displayed and the actions within the Client container. This raises a concern regarding the implementation cycle. Every developer must learn this proprietary framework and (possibly) the RCP framework. We circumvent this, by modeling the GUI elements. The Conceptual Model will be described using a DomainSpecific Modeling Language (DSML) in which the developer will describe the visual components and the expected behavior. The visual elements will be linked with Business Objects and the behaviors will be linked with Business Services. This DSML will be called “GuiDSML”. The data exchange between the application server and RCP is done by Data Transfer Objects (DTO). These DTOs will comply Conceptual Model for the RCP component - GuiDSML with the MyRCPObject contract (as requested by the myRCP fraIn this Conceptual Model, the developer will describe an mework) and will represent Business Objects. abstract depiction of the visual components and the expected behavior. This is done by fragmenting the perspective into editors and views. These Editors will contain sub-editors and/or graphical control elements. Let’s take the following example from LDAP Studio (c):

To reduce the development workload, we generate all DTOs, Business Services Interfaces, Business Objects and the Relationships between them by using a Domain-Specific Modeling Language (DSML) – “BusinessDSML”. The Business Services Interfaces (used by RCP and the Application Server) will be generated, but the business functionality will hand written.

https://directory.apache.org/studio/users-guide/ ldap_browser/tools_ldap_perspective.html

The two Domain-Specific Modeling Languages – GuiDSML and BusinessDSML will be used to describe all the models of the applications. These Models will provide an accurate overview of all the application.

Describing models using Xtext “Xtext is a framework for development of programming

The main area of the application will be the perspective itself – 1. Every perspective contains one or more editors and/or one more views. Every editor contains paragraphs and/or graphical control elements. Every paragraph contains different graphical control elements. The model should be able to describe all these elements and their interaction. With Xtext we will describe the components and the Business Objects they work with. To do this, we take the following GuiDSML example – Entry editor – 2: www.todaysoftmag.com | no. 36/june, 2015

23


programming Model Driven Design – theory to practice {“Description for possible transformation.”} editor EntryEditor opensIn MainEditor { title Titles.EntryEditor behavior EntryEditorBehaviours businessObject EntryDTO paragraphs{ submenu DN … table EntryDescriptionTable } } {“Description for possible transformation.”} Table EntryDescriptionTable { Title Titles.EntryDescriptionTable businessObject EntryDTO.descriptionDTO columns { column AttributeDescription { value descriptionDTO.attributeDescription } column Value { value descriptionDTO.value } } }

attributeDescription). Business Objects: {“Description for possible transformation.”} entity Entry { description : listof DescriptionEntity; } {“Description for possible transformation.”} entity DescriptionEntity { attributeDescription : String; value : String; } {“Description for possible transformation.”} dto EntryDTO link Entry { link descriptionDTO : listof DescriptionDTO; }

Business Services: service EntryService { {“Description for possible transformation.”} operation deleteField ( {“Information anout inout.”}attributeDescription: String) : void; }

Meta-model

Now that we have our Domain-Specific Modeling Language, This is a description of the graphical control elements and the next step is defining the meta-model and the code generation their Business Object values. The interaction between com- framework. ponents is described in a behavior element, where, the functionality/business is developed. Behavior EntryEditorBehaviours { businessObject EntryDTO Load Save customAction changeColorField customServerAction EntryService. deleteField(descriptionDTO.attributeDescription) }

The Conceptual model describes a behavior, but lets the implementation details to the generated code. The Load and Save actions are default behaviors, and their target code will contain a default implementation. This is done using generics that receive a certain DTO type. The customAction describes a custom RCP action. Here the Conceptual Model presents the behavior, but lets a part of the implementation details to the developer. The final source code will be generated partially and the developer will receive a method definition, where he must implement the action particularities. Practically, the model offers some common behaviors, and if these are not enough, it gives the developer the option to describe its own custom actions. The deleteField is a server call to a specific server functionality. To use this functionality, the developer will bind the action to a specific button. The call will be made, and the answer will be displayed in a specific area. {„Description for possible transformation.”} Table EntryDescriptionTable { . . . columns { . . . } button buttonName action EntryService. deleteField(descriptionDTO.attribute) }

Underlying these model representations (DSML) is a set of meta-models. “The ability to analyze, automate, and transform models requires a clear, unambiguous way to describe the semantics of the models. Hence, the models intrinsic to a modeling approach must themselves be described in a model, which we call a meta-model.“[1] Our meta-models (one for GUI and one for Business) will describe the grammar (semantics) used for constructing the models. So, every time a developer describes a business object, or a service, or any element specific to the Domain-Specific Modeling Language, the model is analyzed and compiled for possible problems. An example of an editor in GuiDSML: Editor EntryEditor opensIn MainEditor { Title Titles.EntryEditor Behavior EntryEditorBehaviours businessObject EntryDTO paragraphs{ submenu DN … table EntryDescriptionTable } }

The user can also extend this functionality with the custom The Editor in the meta-model (grammar): tag at the end of the button description. Editor :

Conceptual Model for the Business component - BusinessDSML This Conceptual model should describe all the Business Objects (such as Entry and Description) and the Business Services such as deleteField(descriptionsDTO.

24

c

‘editor’name=GUI_ID’opensIn’EditorComponent=E DITOR_ID’{‘ ‘title’ title=[Titles::TitleElement] (‘behavior’service=[dm::BusinessService])? (‘readOnly’service=[dm::ReadOnly])? ‘businessObject ‘object=[dm::BusinessObject] ‚paragraphs‘‘{‚ (paragraph+=Paragraph)+ ‚}‘


TODAY SOFTWARE MAGAZINE ‘}’;

In Xtext we describe the grammar specific to all Domain Model concerns, implicitly Conceptual Model concerns. In the previous example, we can see that an ‘editor’ element must have a name and a EditorComponent. After the bracket opens it expects a ‘title’. The behavior and readOnly tags are optional. Using the resulting grammar, Xtext generates its parser. This parser verifies that the GuiDSML model is correctly constructed, by comparing it with the input grammar. One meta-model will be used for all the Client models, and one meta-model will be used for all the Server Models.

This plugin will provide all the necessary tools for describing the model in GuiDSML and BusinessDSML. After the developer finishes the description of the Conceptual model (GuiDSML and BusinessDSML ) a code generator tool will create the final source code.

Code generation framework

The editor is defined in the order specified by the DEFINE/ EXPAND tags. In the previous example, the class definition is generated Import staticorg.junit.Assert.*; Import java.io.IOException; Import java.util.HashMap; Import java.util.Map; Import java.util.Set; … public static class EntryEditor { private String editorName = EntryEditor; // template components }

After the generation process is finished, the generated classes are packed into jars and sent from the model to the projects that use these jars. The classes that are partially generated are generated only once - a new generation process will not overwrite the old implementation. As these classes are partially hand written, the source generation process should not override any existing changes. Xpand is a good solution for generating EMF objects, but for a more general approach, and a better overall solution, I would recommend using Xtend. It is more flexible and easier to read/ use. In practice, every element of the Conceptual Model is analyzed at great detail. After a close and thorough study of the Domain Model, the conceptual model is described (at an abstract level), and, afterwards the meta-modeling creation begins. After the meta-model is finished, it will be passed to the developers for usage. From this point onward, the meta-model will suffer changes if necessary and according to the change in the Problem Domain. This is only an overview of how an Application, designed using Model-driven Software Development, would look like. Every Domain Problem is different, so every Conceptual Model will be different. For further information, I recommend reading the articles from the reference area, and try some of the tools used in MDD [8].

Up to this point, everything is software platform independent. Here is where the modeling ends and the code results. In this example we use one of the code generator tools provided by Eclipse Modeling Framework – Xpand. This statically-typed template language generates result code from predefined templates. We use this code generating tool as it specializes on EMF Models (RCP Objects). Example for an editor: References «DEFINE editorTemplate FOR Editor-» «EXPAND DefaultEditor(editorTemplate.name)-» «EXPAND editorTemplate_Vars(editorTemplate. name)-» «EXPAND editorTemplate_Components_ BusinessObject(editorTemplate.businessObject)-» «EXPAND editorTemplate_Components_ Behaviour(editorTemplate)-» «ENDDEFINE» «DEFINE editorTemplate_Vars(String name) FOR editorTemplate -» «IF ‘readOnly’ == true-» private booleanreadOnly = true; «ENDIF-» private String editorName = « name »; «ENDDEFINE» «DEFINE DefaultEditor(String name)-» Import staticorg.junit.Assert.*;

[1] An introduction to Model-Driven Architecture (MDA) – Alan W. Brown, Jim Conallen [2] Model-Driven Software Development, (Technology, Engineering, Management) Thomas Stahl, Markus Volter [3] Towards the Automatic derivation of Malaca Agents using MDE – Inmaculada Ayala, Nercedes Amor and Lidia Fuentes – E.T.S.I. Informatica, Universidad de Malaga [4] Xtext website - http://www.eclipse.org/Xtext/ [5] http://www.omg.org/mda/mda_files/Model-Driven_Architecture.pdf [6] http://ftp.icm.edu.pl/packages/ace/ACE/PDF/GEI.pdf [7] https://eclipse.org/community/images/apacheldap.png [ 8 ] ht t p : / / m d w h at e v e r. f r e e . f r / i n d e x . p hp / 2 0 1 0 / 0 6 / model-driven-tools-the-big-list/

Import java.io.IOException; Import java.util.HashMap; Import java.util.Map; Import java.util.Set; … public static class « name » { … «ENDDEFINE»

www.todaysoftmag.com | no. 36/june, 2015

25


programming

What Is Really TDD?

E

very once in a while, I have conversations with people about what really is TDD. Since I built a certain knowledge on the topic in time not only by using it but also by explaining it to others, I decided to write this article that details my definite view on what TDD is. I hope you’ll find it useful.

Alexandru Bolboacă

alex.bolboaca@mozaicworks.com Agile Coach and Trainer, with a focus on technical practices @Mozaic Works

This is continuing the article on this topic from the previous Today Software Magazine issue:

TDD Is A Method To Design

If we look at the definition of design Is this enough to call the result of TDD above, it’s obvious that TDD is a method “good design”? Most likely, the answer is to design. We write code to solve a pro- no. It makes complete sense to say that: blem and we use tests to define the • The quality of the design depends on expected behavior of the solution. When the designer’s skills the tests pass, another bit of the problem • TDD by itself will not produce good gets solved. We’ve just created intentiodesign. It does produce design with cernally a piece of code that solves a problem. tain qualities, but it’s up to the developer This is design. to take it further. But is it good design? This is an interesting discussion. To answer it, we should look at the design qualities that TDD forces us to build. There are two: • Testability – obviously, since the code is tested • Mistake-proofing – there’s a lower probability of introducing mistakes

26

no. 36/2015, www.todaysoftmag.com

when changing code that’s already tested. The developer can still introduce mistakes if the problem was incorrectly understood or if the tests are incorrect.

But…

When Do We Design While Doing TDD? It’s now time to introduce yet another aspect of software design. Writing the code is not enough; what’s important is to structure the code in a certain way. The least structuring we can do is to write all


programare the code in one huge method. The computer won’t care, but it will affect the qualities of design. When doing TDD, a programmer has to make a lot of decisions regarding the code structuring: • use a class, a method, a variable, a member etc. • how to name things • how the classes collaborate • what data types to use • etc. These are all design decisions that contribute to its qualities. Naming a variable ‘a’ will make it less readable than naming it ‘amountOfMoney’. Adding 10 layers will make the code more difficult to understand than using just two layers. A class with 10 collaborators is more difficult to understand than a class with 3 collaborators. When do we make these decisions? Always! More concretely: • Upfront. For example, using an MVC web framework means already following constraints for the code structure. • When writing the test: the name of the class under test • When writing the code: the names of private methods, instance members or local variables • When refactoring: extracting a method, extracting a class or just renaming something. • Improving the qualities of design is a continuous process. It is not limited to the refactoring step or to the TDD cycle. And that’s ok, because actually…

TDD Is a Method For Incremental Design Incremental means that we are designing software one bit at a time. We design a little before starting the cycles, a little while writing the test and a little when refactoring. The act of designing is intentional: we try to improve the qualities of design that are relevant in our context (typically changeability). Incremental also means that the solution grows step by step by slicing the problem into smaller problems. For example, to solve a problem that has as input a list of many numbers, we start from an empty list, then a list with one number and so on.

TODAY SOFTWARE MAGAZINE is incorrect, but it leads to misunderstandings. I favor the term “incremental” as a better description of the process. And There’s More … This article focused on the most common use of TDD. Things are a bit more complicated because there is a surprising number of ways of using tests and TDD. Here are some advanced examples, by no means a complete list. I have used TDD in the past to explore design alternatives: I solve the same problem using different constraints and compare the resulted designs. This is a more complex design method, since exploring alternatives is part of the general design process. TDD can be used to learn new things. I have successfully used TDD in the past to teach programming languages to people without a programming background. TDD can be used to explore the problem space as well. I do this by solving a part of the problem and then think how the problem could evolve. For example, if we take Conway’s Game of Life I asked myself: what if the universe changes? What if the time changes? What if the rules change? etc. I often do the same exercise with the business applications I’m building. I sometimes use TDD to explore the potential changes to the features. In a different category, TDD As If You Meant It is an exercise based on TDD but with additional constraints that delay all the code structuring decisions for as long as possible. It is probably the most incremental approach possible, but it can also lead to code that doesn’t do much even after 1-2 hours. I find it an intriguing exercise but never use it in production. Your questions and comments are welcome, please don’t hesitate to write at alex.bolboaca@mozaicworks.com.

This process is very similar to another one: general problem solving. The circle just closed: since design means solving problems, and solving problems is best done incrementally, then what better way to call TDD than a way to incrementally design software? The more knowledgeable readers will probably remember that TDD was often discussed in the context of “emergent design”. I think the name “emergent” has a problem: many developers I met tend to think that “emergent design” means design that appears out of nowhere because of a process. Of course, this

www.todaysoftmag.com | no. 36/june, 2015

27


programming

Fault-Tolerant Microservices with Netflix Hystrix

T

his is our second article on patterns for Microservices based systems. See also our previous article on (Micro)service Discovery using Netflix Eureka. This article introduces Hystrix, an open-source Java library from Netflix. Hystrix is a production-ready implementation of the Circuit Breaker - http://martinfowler.com/ bliki/CircuitBreaker.html - pattern for reducing the impact of failure and latency in distributed systems. Radu Butnaru

rbutnaru@sdl.com Senior Developer @ SDL

Problem

Solution

A particular characteristic of systems built using microservices is that they feature a great amount of distributed components. As the number of synchronous interactions over the network increases, the impact of one service dependency misbehaving can potentially become more severe. The following are typical cases of abnormal service behaviour: • service is down • service call is taking too long • service call is throwing errors

A Circuit Breaker is used to wrap network operations which may fail. It monitors and detects when the downstream service dependency is misbehaving, and temporarily rejects calls to it until it becomes healthy again. By returning an exception immediately, it prevents resource exhaustion in the calling client process. At the same time, it reduces the load on the downstream service, thus increasing the chances for it to recover from the error condition it is experiencing.

Without proper mechanisms in place, errors and, in particular, latencies will trickle up to the calling clients where they will potentially exhaust limited resources (e.g., web server thread pools). When cascading failures occur, the overall system availability is significantly affected: the entire system can grind to a halt from a single unhealthy dependency even if all other service dependencies are healthy.

28

no. 36/2015, www.todaysoftmag.com


TODAY SOFTWARE MAGAZINE In the following sections, we will describe the Hystrix impleTo wrap a service call into a Circuit Breaker, one needs to mentation of the Circuit Breaker pattern. extend from the `HystrixCommand` class. The example below uses a fictitious products service:

Hystrix Circuit Breaker Overview

public class FindAllProductsCommand extends

Let’s assume a client invokes a service. The client isolates HystrixCommand<List<Product>> { points of access to the service by wrapping all network call invoprivate RestTemplate restTemplate; cations within a Hystrix Circuit Breaker (this is achieved at the public FindAllProductsCommand( code level via commands or annotations, more details below). RestTemplate restTemplate) { The Circuit Breaker continuously intercepts and monitors all super(HystrixCommandGroupKey.Factory invocations and acts upon certain erroneous conditions. .asKey(„ProductGroup”));

Closed State

}

When the service dependency is healthy and no issues are detected, the Circuit Breaker is in state closed. All invocations are passed through to the service.

this.restTemplate = restTemplate;

@Override protected List<Product> run() throws Exception { // Apel serviciu HTTP ResponseEntity<Product[]> responseEntity = restTemplate.getForEntity( “http://host/products”, Product[].class);

Open State

The Circuit Breaker considers the following invocations as Product[] products = responseEntity.getBody(); failed and factors them in when deciding whether to trip the cirreturn Arrays.asList(products); } cuit open: } • An exception thrown (e.g., cannot connect, or service returns HTTP error 500) To invoke the command, construct it and call `execute()`: • The call takes longer than the configured timeout (by defanew FindAllProductsCommand(productService).execute(); ult 1 second) • The internal thread pool (or semaphore) used by Hystrix for the command rejects execution (Hystrix uses thread pools To return a default result instead of throwing an exception to limit resources used by a dependency) when the Circuit Breaker is open, implement the `getFallback()` method in the command. The circuit opens as soon as Hystrix determines that the error public class FindAllProductsCommand extends threshold over a statistical time window has been reached (by HystrixCommand<List<Product>> { ... default 50% errors over a 10 seconds window). In the open state, @Override the Circuit Breaker will reject invocations by either: protected List<Product> getFallback() { return Collections.emptyList(); • Throwing an exception (also termed “fail fast”, this is the } default behavior) } • Returning a fallback result (e.g., returning a null, empty, or stubbed result) In the case when a certain exception is considered as expected behavior (e.g., business logic validation), and not a symptom of Half-Open State the service dependency misbehaving, it should be wrapped in a To be able to recover from the error condition, when the `HystrixBadRequestException`. Circuit Breaker is in the open state, it periodically leaves through public class FindAllProductsCommand extends one invocation at a configurable interval (by default 5 seconds) - HystrixCommand<List<Product>> { this is the half-open state. If the invocation succeeds, the circuit ... @Override is closed again. protected List<Product> run() throws Exception { try { // Apel serviciu HTTP ... } catch (IllegalArgumentException e) { // Dacă se întoarce HystrixBadRequestException, // Circuit Breaker-ul nu se va deschide

Usage We present two main options for using the library: 1. Directly using the Hystrix API - this requires wrapping each service call in Hystrix API commands. 2. Using Spring Cloud Netflix and the Javanica library - this is a less-intrusive way of introducing Hystrix to a codebase via annotations on the methods which need to be protected by circuit breakers.

}

}

throw new HystrixBadRequestException( “Bad request.”, e); }

To configure specific properties (timeouts, thread pool sizes, error thresholds, etc.), one can set them programmatically at the To use the Hystrix library directly, one needs to add the time the command is instantiated. dependency to the Maven project:

Direct Hystrix API

<dependency> <groupId>com.netflix.hystrix</groupId> <artifactId>hystrix-core</artifactId> <version>1.3.20</version> </dependency>

new FindAllProductsCommand(HystrixCommand.Setter. withGroupKey(HystrixCommandGroupKey.Factory .asKey(“ProductGroup”)). andCommandPropertiesDefaults( HystrixCommandProperties.Setter() .withCircuitBreakerRequestVolumeThreshold(20) www.todaysoftmag.com | no. 36/june, 2015

29


programming Fault-Tolerant Microservices with Netflix Hystrix .withCircuitBreakerErrorThresholdPercentage(50) .withExecutionIsolationThreadTimeoutInMilliseconds(1000) .withMetricsRollingStatisticalWindow InMilliseconds(10000) .withMetricsRollingStatistical WindowBuckets(10)) .andThreadPoolPropertiesDefaults( HystrixThreadPoolProperties.Setter() .withCoreSize(10)), restTemplate) .execute();

Alternatively, one can use the Netflix [Archaius](https:// github.com/Netflix/archaius) configuration support.

Spring Cloud Netflix / Javanica

To configure specific properties (timeouts, thread pool sizes, error thresholds, etc.), one can use the standard Spring Boot application.yml configuration mechanism: hystrix: command: findAllProducts: execution: isolation: thread: timeoutInMilliseconds: 1000 circuitBreaker: requestVolumeThreshold: 20 errorThresholdPercentage: 50 metrics: rollingStats: timeInMilliseconds: 10000 numBuckets: 10 threadpool: ProductService: coreSize: 10

We have already introduced the Spring Cloud library in our [previous article](link here). Spring Cloud is built on top of Spring Boot and provides abstractions for Netflix OSS technologies. Support for Hystrix is provided via the third-party library [Javanica](https://github.com/Netflix/Hystrix/tree/master/ Monitoring with Hystrix Dashboard / Turbine hystrix-contrib/hystrix-javanica). Hystrix provides out-of-the-box support for visualizing and monitoring the current state of the Circuit Breakers by streaTo use the Spring Cloud Netflix / Javanica support, one needs ming metrics data to a dashboard web application: [Hystrix to add the following dependency to the Maven project: Dashboard](https://github.com/Netflix/Hystrix/tree/master/ hystrix-dashboard). In a multiple server (cluster) scenario <dependency> <groupId>org.springframework.cloud</groupId> Hystrix is able to stream metrics to an intermediary aggregator: <artifactId>spring-cloud-starter-hystrix</artifactId> [Turbine](https://github.com/Netflix/Turbine) which sits in front <version>1.0.0.RELEASE</version> </dependency> of the dashboard. Additionally, one needs to add the `EnableCircuitBreaker` annotation to the main Spring Boot application configuration class.

The screenshots below show the Hystrix Dashboard in action:

@EnableCircuitBreaker public class HystrixClientDemoApp { ... }

To wrap a service call into a Circuit Breaker, annotate the corresponding method with the `HystrixCommand` annotation: @HystrixCommand public List<Product> findAllProducts() { // Apel serviciu HTTP ResponseEntity<Product[]> responseEntity = restTemplate.getForEntity(“http://host/products”, Product[].class); Product[] products = responseEntity.getBody(); return Arrays.asList(products); }

Circuit Breaker Closed

To return a default result instead of throwing an exception when the Circuit Breaker is open, add a reference to the fallback method in the annotation: @HystrixCommand(fallbackMethod = “defaultProducts”) public List<Product> findAllProducts() { // Invoke the downstream HTTP service ... } public List<Product> defaultProducts() { return Collections.emptyList(); }

If a certain exception class should not be counted as an error by the Circuit Breaker, it should be listed in the annotation: @HystrixCommand(ignoreExceptions = {IllegalArgumentException.class}) public List<Product> findAllProducts() { // Invoke the downstream HTTP service ... }

30

c

Circuit Breaker Open


TODAY SOFTWARE MAGAZINE The following metrics are shown and updated in real-time on References the web dashboard: 1. Pattern-ul Circuit Breaker1 - by Martin Fowler • Health and traffic volume • Request rate (at server and cluster levels) • Error percentage and counters (successes, rejected, thread timeouts, thread-pool rejections, failures/exceptions) for the current rolling time window (in the example screenshots above, for the last 20 seconds) • Circuit Breaker status • Latency percentiles for the last minute • Thread-pool statistics For complete documentation on how to read the diagrams and counters, please refer to the documentation on the [Hystrix Dashboard wiki](https://github.com/Netflix/Hystrix/wiki/ Dashboard).

2. 3. 4. 5. 6. 7. 8. 9. 10.

Hystrix project2 Hystrix Wiki3 Spring Cloud Netflix4 Javanica Library5 Hystrix Dashboard Project6 Hystrix Dashboard Wiki7 Turbine8 Archaius9 JavaOne Presentation on Hystrix by Ben Christensen10

1 http://martinfowler.com/bliki/CircuitBreaker.html 2 https://github.com/Netflix/Hystrix 3 https://github.com/Netflix/Hystrix/wiki 4 http://cloud.spring.io/spring-cloud-netflix 5 https://github.com/Netflix/Hystrix/tree/master/hystrix-contrib/hystrix-javanica

Conclusion Hystrix is a mature implementation of the Circuit Breaker pattern, with finely-tunable configuration and great visualization and monitoring support. The Spring Cloud Netflix / Javanica libraries offer an annotation-driven alternative to the direct Hystrix API which is less intrusive on the codebase.

6 https://github.com/Netflix/Hystrix/tree/master/hystrix-dashboard 7 https://github.com/Netflix/Hystrix/wiki/Dashboard 8 https://github.com/Netflix/Turbine 9 https://github.com/Netflix/archaius 10 https://speakerdeck.com/benjchristensen/application-resilience-engineering -and-operations-at-netflix-with-hystrix-javaone-2013

www.todaysoftmag.com | no. 36/june, 2015

31


programming

IoT Applications using Java ME Embedded 8

O

n the 31st issue of the magazine, we introduced the topic of the Internet of Things from the point of view of the Java platform. As we promised, we will continue this discussion presenting the details of creating a Java ME Embedded 8 project. This version represents an important step further, with the adoption of CLDC 8 - which is a subset of Java Standard Edition - and MEEP 8 - a specification which defines a powerful and flexible environment for small embedded systems. Along with these, we have to notice the alignment of the platform we’re talking about to Java SE 8. Dănuț Chindriș

danut.chindris@elektrobit.com Java Developer @ Elektrobit Automotive

Tooling for ME Applications - Oracle Java ME Once we installed the SDK and Java SDK 8.1 ME, we can start developing embedded The Micro Edition applications can be developed both manually and with the help of a dedicated SDK, known as the Oracle Java ME SDK 8.1. The SDK, the Java ME distribution, the documentation and any other necessary resources for developing embedded applications can be found at Oracle’s dedicated page1. Before starting to develop embedded applications, Oracle recommends first and foremost the installation of the Oracle Java ME SDK 8.1 - a software package which is only available for Windows at the moment of writing this article. The next step is downloading the Java ME Embedded 8 distribution targeted to the device we want to run the applications on. It comes as a ZIP archive and it has to be transferred to the device - using a tool such as PuTTY - where it is about to be installed. Also, it is recommended to keep a copy of this distribution on the desktop system as well, where we will develop the applications. This step is not mandatory, but it is recommended for the case when the developer would like to execute commands on the device using the AMS CLI (Application Management System Command Line) through the Developer Agent.

Our First Java ME Application 1 http://www.oracle.com/technetwork/java/embedded/javame/embed-me/overview/index.html

32

no. 36/2015, www.todaysoftmag.com

applications. In its simplest form, such an application has to contain a class which extends the `javax.microedition.midlet. MIDlet` abstract class, a manifest file and a JAD (Java Application Descriptor) file. We could write such an application manually, without the help of an IDE that would automate certain steps. This is a good exercise for the developer who makes contact for the first time with Java ME Embedded 8. Thus we intend to create a simple application which displays at the console one message at start-up and one at shut-down time. First we create a class which extends javax.microedition.midlet. M I D l e t , implementing the s t a r tApp() and destroyApp(boolean unconditional) methods: public class Hello extends javax. microedition.midlet.MIDlet { public void startApp() { System.out.println(„Hello MIDlet”); } public void destroyApp(boolean unconditional) { System.out.println( „Goodbye MIDlet”); } }

To continue on the same note, we compile the class we just wrote manually using a command similar to the one listed here: javac -cp %JAVA_ME_SDK%\lib\ meep_8.0.jar -d classes src\ro\ leje\Hello.java


We notice that we need the `meep_8.0.jar` library at compile time, because it defines the `MIDlet` abstract class. This library can be found inside the `%JAVA_ME_SDK%\lib` directory, where `%JAVA_ME_SDK%` represents the path where the SDK was installed. The next step is to create the manifest file, which has to contain at least the following information:

The Hello MIDlet message is displayed when the MIDlet is started and the Goodbye MIDlet message is displayed when it is destroyed, using the `Ctrl + C` key combination.

Running the Application using a Device

Another way to run the application is by installing it on the target device. For this article, we used a Raspberry PI Model B+ development board equipped with a Wi-Fi dongle. Also, we have MIDlet-Name: Hello MIDlet-Version: 1.0 to note that the platform has a Linux operating system already MIDlet-Vendor: Today Software Magazine installed, which facilitates our work with this piece of hardware. MIDlet-1: Hello,,ro.leje.Hello MicroEdition-Configuration: CLDC-1.8 Having this configuration at our disposal, we can remotely access MicroEdition-Profile: MEEP-8.0 the Raspberry PI system with the help of a program such as Supposing we saved the manifest file using the `MANIFEST. PuTTY. MF` name, we can move forward to the next step, which is creating the JAR archive. This archive has to contain the compiled We access the board by knowing its IP and a user with root class and the manifest file. We do that launching the following rights. Once we are authenticated, we change the current direccommand: tory so that we are located inside the `bin` directory of the Java ME Embedded 8 installed distribution. This is illustrated in the jar cfm build\Hello.jar MANIFEST.MF -C classes . following screen shot: Once we created the `Hello.jar` file, for this application we only need one more thing, and that is the application’s descriptor, also known as a JAD (Java Application Descriptor) file. This one resembles the manifest file, containing the following mandatory lines:

MIDlet-Name: Hello MIDlet-Version: 1.0 MIDlet-Vendor: Today Software Magazine MIDlet-1: Hello,,ro.leje.Hello MIDlet-Jar-Size: 1076 MIDlet-Jar-URL: Hello.jar MicroEdition-Profile: MEEP-8.0

Accessing the development board with PuTTY

We notice that one of the mandatory attributes of the JAD file is the size in bytes of the archive. We save this file with the `Hello. The figure shows us the fact that the next step was to run the jad` name within the same directory as the JAR file. `usertest.sh` script using the `sudo ./usertest.sh` command. This script has launched the Java runtime which grants access to the Running the Application using an Emulator AMS. The platform listens on the 2201 port and allows us to conAt this moment, we have a completed Java ME Embedded 8 nect remotely to perform the management of ME applications. application that we can launch. The simplest method for doing this is using the emulator provided by the SDK. Supposing that Before moving on, we have to register the device using the we added the `%JAVA_ME_SDK%\bin` path to the `PATH` envi- Device Connections Manager application. Since the SDK is instalronment variable and that the current directory is the `build` led, we should be able to find an icon called Oracle Java(TM) directory of our project, we can issue the following command: ME SDK 8.1 Device Manager within the SysTray. Clicking on it, we open the connections manager where we can add our board emulator -Xdevice:EmbeddedDevice1 -Xdescriptor:Hello.jad which is identified by IP. Once we registered the device, we should see within the active window something similar to the following Using the `-Xdevice` option we specify the name of the device figure: where we want to run the application. `EmbeddedDevice1` is an emulated device, automatically configured during the installation of the SDK. The second option present in the command we just issued is `-Xdescriptor`. By it we specify the location and the name of our application’s descriptor. We can notice the result of running the application in the next figure:

Registering a device

www.todaysoftmag.com | no. 36/june, 2015

33


programming IoT Applications using Java ME Embedded 8

Now we can install on the Raspberry PI the application we created in a previous section. We can choose from a few methods for doing that. One of these methods is using the Device Selector utility which is available for us, of course, due to the fact that we previously installed the SDK. Starting this application, we can notice a list with all the devices installed at the current moment. By default, there are three emulated devices available: EmbeddedDevice1, EmbeddedDevice2 and Qualcomm_IoE_ Device. Along with these, we can also see the Raspberry PI board that we just registered under the EmbeddedExternalDevice1 The output of the application within the console name. We want to run the Hello application on this device so we right-click on it and we choose Run JAR or JAD..., as it is depicted We notice that in the screen shot the message that should be in the next figure: displayed when the application is destroyed is also shown. That happened because, before taking the screen shot, we clicked the Remove button, which is available on the application manager’s user interface. Thus, whichever the chosen method for running Java ME Embedded 8 applications is, whether it is on devices or on an emulator, this is a fairly easy process. There is one more way of running embedded applications on devices, using the AMS command line, by the means of the Developer Agent utility. However, this method is still a concept in this version of the platform. Throughout this article, we followed the steps of creating, installing and running a minimal application, performing each task manually. However, the platform offers us a multitude of tools that are meant to meet the needs of the developers and aim at increasing their productivity. In a future article we intend to present the process from a different angle, automated using these tools.

Conclusions The development of Java ME Embedded 8 applications can be an interesting and fun process, but sometimes difficult and By choosing the `Hello.jad` file from the disk with the help of frustrating. Unfortunately, the study materials targeted for Java the Open dialog that appeared, the platform launches the appli- ME Embedded 8 are few. As of this writing, there is one published cation manager which installs our software package on the board. book that approaches the topic of developing Java ME Embedded This can be seen in the next screen shot: 8 applications. Also, the majority of the existing articles on this subject take a general approach, presenting the features of this new platform in a general sense. For now, the forum threads are relatively few but we can notice an increasing interest from the users’ side, eager to learn how to use this new version. The richest in information resources available for us are the official guides compiled by Oracle and they can be downloaded from the official site of the platform. Running the application on the device

The application manager

The fact that our Java ME Embedded 8 application is truly running on the device is proved by the PuTTY console where we can see the output of starting and destroying the application:

34

c


management

Long distance relationships can really work!

L

ong distance relationships can be very successful. Especially in our line of business where companies from two different regions join and each brings a specific quality to the partnership. A relationship, whether personal or business, in-house or nearshore, takes a bit of effort. In order to create good long-lasting partnerships, we apply simple common sense to make sure that everybody is aligned and expectations are clear. Yet these common rules are quite often overlooked. Florin Roman

florin.roman@tss-yonder.com Delivery Manager @ Yonder

C ommunic ate. One of the most important aspects in a long lasting relationship wit h your c ustomer is communication. The better and more frequent the communication is between you and your client, the more honest and open the relationship will become. And it will be easier to keep your client happy and solve issues in a reasonable amount of time. No hidden agendas. Hidden agendas will lead to misunderstanding and ultimately to mistrust and neither partner will benefit. Discuss each idea, no matter if it is good or bad. If it is good, it will be appreciated, otherwise it will help you to understand the aspects that you have not been aware of. Be proactive. Keep your clients proactively informed on any updates. Avoid the situation where they have to ask for information. It assures all involved on the openness and collaborative nature of both parties. Email etiquette. When you receive an email, it is a good practice to respond in a timely manner. And if you can’t answer the request the same day, then acknowledge the receipt of the email and let the sender

know when he or she can expect a full reply. Furthermore, email communication can be misconstrued especially during stressful periods if the sender and receiver do not know each other well. So pick up the phone from time to time and talk person to person. Summarize and recap. No matter how trivial a meeting or a call seems, once you get out of a meeting there will be next steps. Summarize these so that you align with the other person. Even if there are no next steps, but just a recap of the discussion, it is good to email this so that everybody stays on the same page. Be your client. Get to know the client’s business, understand how their business works, the dynamics of their market, and the challenges they face. You do not need to be an expert, but you do need to speak the same language and have an understanding of what keeps your client awake at night. Be patient. Building relationships takes time. Listen to your client. Do not try to push all the ideas at once in the beginning, take small steps, discuss point by point and adapt your language and discussion according to the reactions and behavior of

www.todaysoftmag.com | no. 36/june, 2015

35


management Long distance relationships can really work! your respondent. Have integrity. If you do what you say you will do, each and every time, then you will be top of the mind when the client is looking for new services. Do not be afraid to admit when you make a mistake, but instead apologize, learn, share how you plan to fix it and make sure that you do not repeat the same mistake twice. Not keeping commitments will lead to a lack of integrity and you will never develop a trusted relationship with your client. Instead, you might end up in losing that specific customer. Focus on quality. To be good at what you do, you need to have the right people in the right place, proper processes and never settle for second best or ‘just good enough’. Constantly aim to improve and bring your expertise to the next level. If you provide quality services, then your clients will come back to you. And, more importantly, they will recommend you in their own network, thus providing you with a good opportunity for business growth. Partnership. Develop a partnership relation. This goes beyond the individual project development. If a client sees that you are in it for the long-haul and that you are truly motivated to help then they will start to see you as more than just a simple supplier. Of course becoming partners implies more than what is mentioned here, however, I w i l l l e av e

36

c

this subject for another time. Be human. Meet face to face. Having long distance communication might not always prove that you indeed understand your client and can help him in his challenges. That is why it is important, especially at the beginning of the relationship, to meet each other face to face, lock yourself in a room and align the expectations. This is a good opportunity to better understand the client›s business, his challenges and goals for the coming period by which you can better serve his/ her needs. However, business discussions will not always help in knowing what is on another person›s mind - we can admit that there are always things that not outspoken, especially in the beginning - and if you want to better understand your ‹audience› then have a coffee or a beer together in an informal setting, like a restaurant or a pub . Long distance relationships can really be the best. Each partner brings their own skill set to the equation and the combination makes for a powerful partnership. And as there is a distance, in our case, nearshoring distance, people are very aware that these common principles are important. The nature of a type of relationship may vary, from personal to business, yet the same rules apply: never take the other for granted and communication is essential.


HR

A smile won’t bring the spring the science of organizational happiness

W

e are more and more preoccupied with happiness. And from an organizational point of view, we have become more aware of the importance of having happy employees: these are more productive, more satisfied, and more attached to the organization. Along these lines, we are also seeing an increased effort to satisfy our employees. But how can we make the big leap from a smile to all out organizational happiness?

Szilárd Kacsó

kacso.szilard@happy-employees.eu CEO & Trainer @ Azimut Happy Employees

Even if we have become more and more emotional commitment can predict aware about the importance of having happy employee performance, while continuous employees, we are still somewhat reluctant commitment and normative commitwhen it comes to evaluating the potential ment can predict the probability that an impact of an abstract concept such as happiemployee will leave the company or not ness. There is however some good news: there are a multitude of studies, instruments, and Because we were mentioning the imporscales which have been validated and which tance of quantifying the level of happiness in can help quantify our progress towards orga- organizations, we are going to present sevenizational happiness. ral scientific tools which we can use to help evaluate the degree of happiness. We also From smile to happiness have the ability to use specific tools in order Happiness in the workspace is more to determine each of the three components than just giggle and fun. We need to evaluate mentioned above: Utrecht Work Engagement employee happiness as a meter made up of Scale, Job Satisfaction Survey, Organizational three components: Commitment Questionnaire, The Work and • Involvement - a concept which focu- Meaning Inventory Scale etc. ses on developing employee potential, in order to protect them from the effects of Smiling does not really help. But happy potential stress factors, and to increase employees do productivity. A happy employee is not defined by the • Satisfaction - a positive state which is amount of smiling he or she does, but by the a direct result of the employee’s attitude in optimum levels of involvement, commitment the workspace and satisfaction. Why do we need happy • Commitment - we are talking about employees in our organizations? Perhaps three types of organizational commitment: the most relevant answer can be provided by www.todaysoftmag.com | no. 36/june, 2015

37


HR A smile won’t bring the spring - the science of organizational happiness

• Team diagnosis - we use scientific instruments and several observation methods in order to evaluate and measure various organizational indicators, in order to determine the strong and weak points of a team. • The seconds stage in the process is implementation - where we propose and deliver training programs, team building activities, and coaching sessions based on the findings from diagnosis stage. • Evaluation and program sustainability - we evaluate the impact and progress resulting from our actions, after which we follow up on maintaining the desired behaviors within the organization.

the Return of Investment that an employee happiness development program offers. First and foremost, this is felt at the level of costs involving the hiring and training of a new employee. That is why it is preferable to invest in the retention and commitment of employees. Furthermore, research has indicated the presence of a link between employee happiness, productivity and commitment, and, eventually, the degree of satisfaction and loyalty of a company’s clients. This, in addition to the fact that employees have proven to be 10-12% more productive than those with a lesser level of happiness in their workplace. As such, the direct benefits received by the company are a higher retention rate and a better profit margin.

From happiness to organizational happiness More and more effort goes into increasing employee satisfaction by using various means: theme parties, team activities, trainings, office benefits, etc. However, these do not suffice. They can bring a smile at most... On the other hand, a strategy and a complex program are needed in order to make a real difference. We recommend the following three step program which focuses on long term impact:

38

no. 36/june, 2015 | www.todaysoftmag.com

In conclusion, happiness must not be treated superficially (as a simple smile), or seen as an abstract and useless concept. Quite the opposite. It is a science, which, with the help of the right instruments and scales, can be measured. A few activities meant to amuse/ involve temporarily an employee will not grant organizational happiness. The right scientific instruments, along with the implementation of a complex program can bring immense benefits both in quantity and in quality to a company and its employees. Do not forget: Just a smile won’t fix everything!



sponsors

powered by


Issuu converts static files into: digital portfolios, online yearbooks, online catalogs, digital photo albums and more. Sign up and create your flipbook.