Issue 43 - January 2016 - Today Software Magazine

Page 1

Nr. 43 2016 • www.todaysoftmag.ro • www.todaysoftmag.com No. 36••January 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

s.

Zero to RESTful in 4 easy step API Design.

IT Forecast for 2016

Marketing through the digital “window”. An enlarged view for 2016 Strategic flexibility during uncertainty Fuzzy Logic and its Specific Mechanisms. A Theoretical Introduction Collaboration done easy with TFS (I) Roku

Frontend Mashup Searching for (potential) talent 10 fiscal novelties in force from 2016 with an impact on entrepreneurs



6 IT Forecast for 2016 Ovidiu Măţan

12 Collaboration done easy with TFS (I) Dorin Cazan

15 Marketing through the digital “window”. An enlarged view for 2016 Sorina Mone

17 Strategic flexibility during uncertainty Paul Alexandru Tofan

19 Fuzzy Logic and its Specific Mechanisms. A Theoretical Introduction. Dorin Cazan

22 Roku Thomas Morris

24 Zero to RESTful in 4 easy steps. API Design. Georgiana Gligor

29 Frontend Mashup Raluca Oanca-Boca

31 Searching for (potential) talent Mădălina Nastasa

33 10 fiscal novelties in force from 2016 with an impact on entrepreneurs Delia Mircea


editorial

H Ovidiu Măţan

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

appy New Year ! As it usually happens, the beginning of the year brings future plans for each of us. Before updating you with this year’s projects, we wish to highlight that our desire is to maintain the development of the magazine on the same growing trend of quality, online visibility, as well as that of organizing the monthly events of releasing every new issue. Moreover, we are concerned with developing better communication with the collaborators of the magazine. The first steps in this line are the creation of a private online place for discussions and the organization of some workshops which can offer the collaborators of the magazine the opportunity of some real learning experiences. We informed you about the programez.ro service, in the previous issue of the magazine. We hope to launch it soon and offer, to those who are interested, the possibility of solving the certification tests for companies for certain positions. For anyone who wants a preview, it is available on beta.programez.ro. The addition of some new columns to the content of the magazine, such as the News one and that of Start-ups, is a goal we are trying to achieve starting with this number. Another change refers to the communities page, namely that we will mention only the most active ones, as we will let you know about the events organized by them. We are opening this issue by a series of opinions on the evolution of year 2016, seen from the business, management, UX and machine learning perspectives. Strategic flexibility during uncertainty proves that the state of insecurity can offer advantages if it is conditioned by a pertinent analysis of business volatility. The technical domain specific to IT is represented by a series of interesting subjects: a short introduction in the Fuzzy logic and specific mechanisms, a theoretical approach, followed by a programming guide for the Roku device; Collaboration done easy with TFS for developers and non-developers alike, which proposes a solution for collaboration within the team. We continue the series of articles on developing a web application using the latest frameworks, in the article From Zero to RESTful in four steps. API Design. Still in this area, we also include Frontend Mashup. Looking for (potential) talent in the perspective of the year 2020 is an article that draws in realistic lines the evolution of human resources and its implications in the employee / employer relationship. Another very useful article for entrepreneurs and not only for them is 10 fiscal novelties in force from 2016 with an impact on entrepreneurs.

Ovidiu Măţan

Founder Today Software Magazine

4

nr. 43/2016, 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 Junior developer: Alexandru Diniș alexandru.dinis@todaysoftmag.com Marketing and Desktop publisher: Ana-Maria Bivol anamaria.bivol@todaysoftmag.com

Authors list Ovidiu Măţan ovidiu.matan@todaysoftmag.com

Sorina Mone sorina.mone@fortech.ro

Editor-in-chief Today Software Magazine

Marketing manager @Fortech

Mădălina Nastasa madalina.nastasa@happyemployees.eu

Paul Alexandru Tofan Paul.Tofan@isdc.eu

Sales Development Representative @ Azimut Happy Employees Dorin Cazan dorin.cazan@siemens.com

Bogdan Mursa mursa.bogdan@yardi.com

Service specialist @Siemens

Software Developer @ Yardi

Delia Mircea delia@contzilla.ro @ Contzilla.ro

Thomas Morris thomas.morris@3pillarglobal.com Roku & Python Software Developer @3Pillar Global

Raluca Oanca-Boca ralucaonaca@gmail.com Full Stack Developer @Self-Employed

Printed by Daisler Print House

Project Manager @ISDC

Georgiana Gligor gb@tekkie.ro Owner @Tekkie Consulting

Made by

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

Copyright 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 | nr. 43/january ,2016

5


opinions

IT Forecast for 2016

A

t the beginning of the year, we all make new plans and set new goals, hoping that the new year will be favorable to their achievement. If some people take into account what the horoscope says, we have decided to give more credit to some important representatives of the IT community in Cluj. Therefore, we asked them to share with us their previsions regarding the year 2016. Based on their answers, we cannot but draw a very optimistic conclusion: year 2016 is going to be beneficial for the IT industry.

Ovidiu Măţan

ovidiu.matan@todaysoftmag.com

What is your perspective on the evolution of Microsoft technologies in 2016?

Editor-in-chief @ Today Software Magazine Organizator @ Cluj IT Days

Radu Stefan – Microsoft In 2016, Microsoft technologies will evolve around productivity and business processes, the smart cloud platform and more personal computers, in order to enhance the power of the new society, with more and more young people starting their first job in a virtual environment rather than in a physical place and shifting from the technology itself to the values and potential of human experiences.

6

nr. 43/2016, www.todaysoftmag.com

Personal assistants such as Cortana will become truly useful through understanding some important aspects of people’s lives, such as the tasks they are working on and the commitments they are making to others. The Big Data systems will collect information through IoT devices and will influence the decisions related to health, home and employment, by predictive analysis. Video sharing on the web will take over, in spite of TV shows, with a smarter video processing in the cloud, through the Oxford Project. Finally, we will have richer experiences on our mobile phones, through a more advanced technology of the photo camera.


TODAY SOFTWARE MAGAZINE What is your perspective on the evolution of the project that have a wider perspective specialized people in this field will keep on the impact the projects will have on growing. Open source platforms used for project management in 2016?

Simona Bonghez – Colors in projects Project management is heading towards new areas and its direction can be explained in the conditions imposed by the economy. The business perspective gains ground in front of the debates carried out by professionals in relation to the most efficient methodologies. After a certain involvement in sustaining the Agile methodologies (which are becoming more attractive also to other industries, not only those related to IT&C), business representatives (the management of organizations, in general) are beginning to lose their interest in supporting one methodology or another, whether we are talking about Agile or traditional approaches, their interest concentrating now in the area of obtaining benefits. On a volatile market, we are interested in obtaining quick results following the projects launched, but these results are not enough; they have to bring profit, an increase of the market share, recognition, competitive advantage. It is a kind of coming back to the basic concern of business, only that this time it is much more intense, the result being the imposing of this orientation also on the project managers. The discussions will no longer be carried out on methodologies, but on the manner in which the initially estimated benefits can be achieved and ensured. This means that project managers will have to pass from the professional slang to the business language and shift their attention from the process to ensuring the fruition of benefits. This means that their responsibility goes beyond the boundaries of the project and extends to obtaining gaining subsequent to the delivery of the results. The connection between the management of organizations and the project managers passes to another dimension. Pay attention, however, to the terms we are using. We are not talking here about Scrum Master or Team Lead, whose responsibilities remain the same, but we are discussing the positions within

the business: Project Manager, Product Owner. It will be interesting to see how the project managers will accept this further responsibility on – attention! – not the results, but on the benefits derived from the delivered results. At the end of January, I will take part in the annual strategic meeting of Project Management Institute, from where I expect to return also with a set direction for this organization. The development directions of PMI are based on an annual research called “PMI’s Pulse of Profession”, whose report will be presented to us on this occasion and which will be released for the public on February. Let’s see if my perspective will be confirmed globally. I expect to hear a lot about Benefits Realization… I will keep you posted.

big scale data-processing, such as Apache Spark and Apache Hadoop, will be used more and more by the companies in Cluj. The interest for Machine Learning and Big Data has increased exponentially in the last two years. As organizers of the BigData/ DataScience meet-up, we have encountered difficulties in finding bigger and bigger spaces to host such events. In regard to the Machine Learning workshops, it was necessary for us to limit the number of participants in order to have efficient workshops. Beyond any doubt, the BigData and Machine Learning domain is to be kept an eye on in 2016, and so is the success degree of the projects in this field.

How do you see the evolution of IT in 2016 and, in particular, the evolution of the IT ecosystem in Cluj?

How do you see the evolution of machine learning projects in 2016?

Daniel Sarbe – SDL Year 2016 promises to be a very interesting one for the machine learning projects, since numerous companies have invested important financial and human resources in this domain during the last few years. Machine learning has become more and more accessible, without being limited only to the research domain or that of very big companies. During 2015, companies such as Google or Facebook made their own machine learning frameworks public (TensorFlow – Google, Torch – Facebook) and in the cloud there are more and more possibilities of beginning proofof-concepts at very low costs and using state-of-the-art algorithms on continuously developing platforms such as Amazon Machine Learning, Microsoft Azure Machine Learning, Google Prediction API or IBM Watson Analytics. Locally, more and more companies in Cluj will move on from the phase of experiments and proof-of-concepts to the integration of machine learning algorithms in the pre-production part or even production, and the demand of

Philipp Kandal In 2016 we will notice a change of paradigm from the traditional logical programming towards deep learning, but also a continuation of the BigData projects. This thing will give engineers the opportunity to carry out some innovatory work. Cluj is well positioned due to its powerful engineering culture and it will continue to grow a lot in 2016. I particularly hope that 2016 will provide opportunities for the Product Startups from Cluj to get an international exposure and I would be very glad to see the first unicorn leaving Cluj.

How do you appreciate the evolution of web design and mobile applications in 2016?

Vlad Derdeicea The new year comes with many changes and different trends in web as well as in mobiles. Websites are beginning to have as many videos and hero (big) images as possible in the intro, while their mobile

www.todaysoftmag.com | nr. 43/january 2016

7


opinions IT Forecast for 2016 versions are quicker and quicker. Just like in the previous years, are beginning to have cleaner and cleaner fonts, conveying the the focus in on the easiness of using the interface, flat graphics information in a very easy manner. and organic animations which bring life to any digital product. Taking into consideration the rapid evolution of mobile devices, it is expected that in 2016 the mobile traffic be equal to that on the desktop, meaning more responsive sites and applications based on verticality and on the well-known scroll of the social applications. Moreover, the fact that last year Google decided that the responsive sites be positioned higher in research than those that are only for desktop is another reason why more and more companies are trying to make responsive versions or even custom applications. Illustrations and drawings are an entertaining way of highlighting the elements of the site or those of the application. They have grown in popularity through the introduction of icons, with the purpose of making the user understand easier and quicker what the respective steps are or what benefits that service brings. Furthermore, they can create a personal connection with the users, which can bring many advantages. The more powerful and lighter colors, resembling those used during the 1980s, are among the elements that have the most chances of being used this year. We can see them everywhere, from Dribble to Google Material Design. Interfaces based on cards are among the biggest elements launched by Material Design and can be found in applications, websites and even prints. They are easy to create, they can adapt to any resolution, keep the information organized and are very readable.

The websites containing a slider were used at the beginning in a frame, and now they are used in full screen. Each slide is controlled by a button or has a timer which can dictate the period of display. Users can thus navigate much more easily through information, having an almost physical experience.

Animations have been one of the biggest trends of 2015, whether they were full screen or small elements that one could hardly notice. In 2016, their popularity will surely grow, even though chances are that their size will decrease. They are an entertaining way of keeping the user focused or even surprise him while the content is uploading.

Beautiful and readable fonts are easier to find with the emergence of the Typekit from Adobe and that of Google Fonts, and sites

8

nr. 43/january 2016 | www.todaysoftmag.com

Analyzing the examples mentioned above, we notice that there won’t be a single trend this year, but rather a multitude of possible trends for web and applications, which designers will be able to use according to each project. But we should not see these trends as more than mere tools or orientations in the creation of a product. They shouldn’t be used excessively only because they are hip, but we should look beyond them and use only those that are suitable to the project.


TODAY SOFTWARE MAGAZINE What is your perspective on the IT environment in Cluj in 2016 regarding the evolution of products, outsourcing, but also that of local programmers?

How will the gaming market evolve on a global level in 2016?

Calin Vaduva The evolution of the IT environment in Cluj has been and will continue to be determined by the global market dynamics. Cluj has taken shape as a regional pole of economic growth based on the demands of the mature markets. At this point, the perspectives of growth for 2016 remain modest, reflecting the deceleration of growth of the global trade and the geo-political tensions. These will bring about pressure on the optimization of costs and that of increasing the productivity, triggering the clients’ orientation towards more cautious investments, including in technology. In this scenario, Cluj will go through a period of re-positioning. The focus will be directed towards the improvement of quality of the services provided and of the relations with the current partners. Obviously, this thing has an impact on the work force dynamics, both from the quantitative and the qualitative points of view. On the long term, we can expect to come back to a significant growth of the outsourcing as well as of investments in the product area.

Robert Muresan 2016 will be the Virtual Reality year. All the producers of VR equipment (HTC&Valve, Oculus, Sony) will launch their equipment this year. It will be the year when we shall witness some radical changes on the gaming market: the traditional screens will be replaced by virtual reality equipment. The experience will be considerably better.

www.todaysoftmag.com | nr. 43/january 2016

9


start-ups

Start-ups – January 2016 Moqups

The Moqups.com startup from Cluj for the creation of online drafts has recently launched the second edition, much improved. The projects carried out can be published online or downloaded in the form of PDF or SVG. There is also the possibility of inviting collaborators and working together on a draft.

Symme3D

The first 3D Romanian printer on Delta system. The advantages of this system are the low vibrations and a speed up to 4-5 times higher than the classical 3D printers on a Cartesian system. The printer is a mini-factory for any small hardware producer, since, besides the 3D capacities, it also offers a CNC cutter for engraving the copper on the integrated circuits and a laser head which can cut mylar plates. • Neura http://techcrunch.com/2016/01/18/neura/

10

nr. 43/january, 2016 | www.todaysoftmag.com

Pine A64

The first computer on 64 bytes on a single plate. It will contain an ARM Cortex A53 processor, quad core, 1.2 MHz, 2 x USB 2.0, HDMI 4K and up to 2GB RAM. It will be able to run any operating system and the recommendations of the producers are Android, Ubuntu or openHAB IoT. The project is in progress on Kickstarter, where it has collected 1,266,000 USD, 40 times more than the initial demand.


communities

TODAY SOFTWARE MAGAZINE

Communities and Events Launch of the issue 43 of Today Software Magazine January 27 (Cluj) - 6:00 PM Siemens Cluj Office Cluj-Napoca.

Today Software Magazine Community built around Today Software Magazine www.facebook.com/todaysoftmag www.meetup.com/todaysoftmag www.youtube.com/todaysoftmag Since: 06.02.2012 Members: 2424

StartupBlinkers Networking

January 28 (Bucharest), 7:00 PM Barka Saffron meetup.com/Cluj-JS/events/227014061/

Ionic 2.0 and AngularJS 2.0

February 4 (Cluj) - 6:30 PM Str. Pitești, nr. 18, Cluj-Napoca. meetup.com/Cluj-JS/events/227014061/ Cluj.JS Cluj.JS is an outlet for developers to engage and learn about all things JavaScript. Since: 21.04.2015 Members: 261

Bucharest Microservices UG ... Begins

February 8 (Bucharest), 2016 - 7 PM Bucuresti Nord Street 10, Global City -building O2, 6th floor, Voluntari 077190, Ilfov meetup.com/Bucharest-MicroservicesUs e r- Group / e ve nt s / 2 2 8 1 3 6 4 4 6 /

StartupBlink StartupBlink is an interactive global startup ecosystem map with tens of thousands of entities listed including Startups, Coworking spaces and Accelerators. www.startupblink.com

Bucharest μServices (Microservices) Community built around Microservices

Since: 28.10.2015 Members: 12711

Openstack Workloads with Windows Server 2016

Startup Europe Week - Cluj

February 2 (Cluj) - 6:00 PM Impact Hub Cluj-Napoca Candidate Str. Gării nr. 21, 400267 Cluj-Napoca facebook.com/startupeuropeweek/; http:// www.startupeuropeweek.eu Startup Europe Week Startup Europe Week has been created to include all the european regions in a startup focused program.

Since: 16.01.2016 Members 89

February 10 (Iași) - 7:00 PM The grape, Str. Vasile Lupu, nr. 55, etaj 2, Iasi meetup.com/IS-DevOps-Meetup/ events/228224839/

DevOps This is a group for anyone interested in becoming a better DevOps engineer. Since: 28.08.2015 Members: 83

February BucharestJS Meetup

February 24 (Bucharest), 2016 - 7 PM TechHub Bucharest 39-41 Nicolae Filipescu, Bucharest facebook.com/groups/1544555832466208/; http://www.meetup.com/BucharestJS/ events/228209512/ BucharestJS BucharestJS is a developer group for anyone interested in Javascript. Since: 11.02.2015 Members: 629

OpenStack January Meetup Open for Presenters

February 25 (Cluj) - 6:30 PM 4th floor, Maestro Business Center, 21 Decembrie 1989, 104, Cluj-Napoca m e e t u p. c o m / O p e n S t a c k R o m a n i a / events/226052637/ OpenStack OpenStack users and developers from Cluj-Napoca and around. Since: 31.08.2014 Members: 134

VOXXED Days BUCHAREST

March 11 (Bucharest), 2016 Bulevardul Poligrafiei, nr 1, Bucharest voxxeddays.com/bucharest/ VOXXED Days VOXXED Days is a community conference by developers, for developers Since: 2015 Members: 1060

Since: 01.07.2015 Members: 1087

www.todaysoftmag.com | nr. 43/january, 2016

11


programming

Collaboration done easy with TFS (I)

T

eam Foundation Server (abbr. TFS) has the promise of being an out of the box, all in one box solution to ALM within an organization. You can use it to manage your project and track your team’s work, to manage your code, to build and test your software. You can do so either with Team Foundation Server installed on your own server, or by using Visual Studio Online in the cloud. According to Microsoft these are some of the major features which are included in

Dorin Cazan dorin.cazan@siemens.com Service specialist @Siemens

12

nr. 43/2016, www.todaysoftmag.com

Team Foundation Server: • Version control, for managing source code and other deliverables that require product versioning. • Work item tracking, for keeping track of your work in form of user stories, requirements and tasks etc. (collectively referred to as “work items”) • Project management functions, which enable planning and tracking using Microsoft Excel and Microsoft Project. • Team build, for enabling a common process for building your products. The build process can be configured for various build types including continuous integration, scheduled builds, gated check-in, shelveset and rolling builds. • Data collection and reporting, which aid in the assessment of a team project’s development and health • The Team Web Portal, which provides a central point of communication for a team project and which doesn’t depend on a Visual Studio installation on the client pc • Team Foundation Shared Services, which provide a number of common infrastructure services that are invisible to end users but that can be used to extend TFS functionality. You can best describe TFS by looking

at its two main sides: On one hand, simply put, TFS is a collaboration platform… or, one can say, it is but a collection of features that are shared by the members of a project team and by their customers and partners of that project team. This collection of features enables them to work together more effectively – they can share project plans and notebooks, progress assessments, requests and requirements, code and much more by either relying just on TFS as it comes ‘out of the box’ or by enhancing its features, capabilities and usage scenarios. On the other hand, by looking beyond what TFS has to offer ‘out of the box’, one can say TFS is a collaboration platform specifically architected for integration and extensibility. Over the API one can customize elements of Team Foundation Server and complement it with new functionality. Extension can range from renaming a field in a work item, to integrating an entirely new tool for added functionality.

TFS extensibility options The extensibility of TFS is given by its multi-tiered structure and by the different models a user can interact with in order to adapt or add functionality. You can extend Team Foundation by using: 1. Its client object model (as the


TODAY SOFTWARE MAGAZINE name suggests, it applies to the client computers) in order to influence the TF behavior when it comes to version control, work item tracking, and builds 2. The server object model (on the application tier) in order to integrate additional tools into Visual Studio, create reports and even create event triggered actions like build deployment to a share used by the customer once you have changed the build quality appropriately 3. The build process object model in order to customize the build process on the build machine – you can customize the build process template, the build activities and also edit the build workflow directly. At Siemens, one of the divisions using TFS has developed a tool that adds advanced functionality to the work item tracking aspect of TFS – especially when it comes to request tracking. Among the extra features that are available after installing these ‘custom controls’ one could enumerate the following: extra fields and tabs, functionality to refresh the structure cache of the work items, check users permissions for request tracking, create work item templates without having to install the Power Tools for Visual Studio and the possibility to associate and sync work items belonging to different team collections or even TFS servers. Among other enhancements that have been brought to our TFS installation in order to facilitate and enhance its usage scenarios not only for our Siemens developers but also for our stakeholders and customers include an event triggered release mechanism which deploys the build from the drop location to external shares, build definition export/import tools, integration with translation tools, integration with PLM products such as Team Center, custom check-in policies, enhanced version control security by employing IP secured folders directly in TFS Source control and many more.

experience a power cut or the network goes down for 1 hour, development pretty much stops. The reason here is that TFS will mark all files as read-only on the filesystem until you have asked the server to check them out for you. If you cannot communicate to the server, you cannot checkout the files and hence you cannot edit them. If on the other hand you have checked out files, you cannot check them in while the server is down; in some cases you can’t check them in even after the server is available again because your solution file goes offline and sometimes fails to reconnect to the server automatically. You would then get a similar error message and wonder what else could go wrong on such a beautiful day: This solution is offline. [Team Foundation Server: https://tfsURI:443/tfs/collection/project] The solution was offline during its previous session and will remain offline.

In the past, some tweaking of the Windows registry or the rebinding of your *.csproj was required in order to get you solution up and running again, but it seems Microsoft has been addressing this issues in the newer VS versions as I haven’t encountered this error in quite some time. For those who think that TFS is a “close solution”, we know that it can be integrated with other 3rd party source control and issue tracking systems. Some of the features that enhance the extensibility and flexibility of TFS is its capability to integrate and work hand in hand with other software packages, including but not necessarily limited to other MS Products such as Microsoft Project Server, SharePoint, Excel and Outlook but also ClearCase (IBM), GIT and Eclipse. You can further enhance its functionality by installing Microsoft Test Manager, a separate Team Foundation client that lets you manage and execute test cases and create and manage physical or virtual test environments. If you don’t know if you would benefit from TFS and don’t really want to invest money in order to find out whether it suits your needs or not, do not despair, Microsoft has introduced Team Foundation Server Express and VisualStudioOnline (also known as Team Foundation Service, the hosted version of TFS.). TFS Express is perfect for students, individual developers and small teams of maximum five developers. It’s free and you can easily install it on your personal station without the need of having a dedicated server. If you assess that you would like to upgrade to a paid version of TFS, you can do it without losing all your work as you can take your full history with you.

TFS benefits for non-developers? It should be noted that Microsoft has a so called Visual studio User Voice site [https://visualstudio.uservoice.com]. This site is for suggestions and ideas for the IDE of Visual Studio – not all the ideas one writes there will be implemented, but it is a nice feeling being able convey your thoughts to Microsoft and potentially getting a new feature developed and implemented directly in TFS without going through the hustle of learning how TF works and how you can use the TFS API in order to develop an extra extension. As with all collaboration platforms, there are also some flaws which one needs to consider – my main complaints and grievances are related to TFS being developed as a centralized-server model that requires constant and active communication between a client machine and the application server. If, for example, you

As the title of this article has hinted, I would like to share my opinion on usage scenarios that are not necessarily implying the usage of TFS just for the software development process. I mean sure, among other things, Siemens develops software, it employs TFS and other platforms in doing so… but that doesn’t change the fact that the colleagues developing the software and the colleagues testing and using the software are not the same. In addition to the aforementioned users, one has to consider the other teams which interact on a daily basis with either the development teams or the end users: the trainers, project manager, configuration managers and the support teams. Why would one think about using TFS features for teams of non-developers? The answer is simple: Starting with TFS 2015 Microsoft has introduced a major change to the licensing of Visual Studio Online and TFS by adding the Stakeholder license. www.todaysoftmag.com | nr. 43/january 2016

13


programming

Collaboration done easy with TFS (I)

This licensing method allows any number of users to be assigned a stakeholder license at no charge. These colleagues will have the ability to create and edit work items, view dashboards and will have read-only access to the Task and Kanban boards. Moreover, 5 free Basic licenses are available to both Visual Studio Online and on-premises TFS deployments. According to MS, the goal of this license is to facilitate communication in the project lifecycle by enabling the entire organization to participate in projects. This is a nice start, which shows Microsoft is redirecting its focus on developing the usability and usage scenarios of TFS. A stakeholder license might not seem like much now, but at this moment it seems a solid foundation, one which it can be built upon.

Corporate Technology Romania

14

nr. 43/january 2016 | www.todaysoftmag.com


programming

Marketing through the digital “window”. An enlarged view for 2016 „Life is much more successfully looked at from a single window, after all.” (F. Scott Fitzgerald, The Great Gatsby)

T

he beginning of the year found me diving into some marketing issues that kept puzzling me for some time. Among others, the fact that digital marketing is probably the hottest concept in the world of marketing these days: digital marketing courses, jobs, strategies, agencies; are all in high demand, including in our local community.

Sorina Mone sorina.mone@fortech.ro Marketing manager @Fortech

It is one piece of a comprehensive and It may not be as sexy as growth hacking or storytelling, but still, generating a genuine marketing approach. It is not rather controversial hype of the so-called “the” marketing. digital versus traditional marketing. Marketing should be neither toolWould this be where marketing is driven nor channel first. It should be heading to? I went on to ask Google. A customer first: intimately know your cusquick review in Google Trends indicates tomers (the problems they have, things a dwindling interest in the term “market- they care about, habits they have), tailor ing” on the web. At the same time, “online your marketing to that (messaging, chanmarketing” ranks first in its top related nels, timing etc.), measure and seek to queries, surpassing even “marketing jobs”. constantly improve. This is something we tend to ignore And the rising stars are “facebook marketing”, “social media marketing” and “google or to forget. Not once I have seen (and personally experienced, the hard way marketing”. of learning), products being built, but Though I am not a fan of deep spe- having no clear customer segment and cialization, I do believe in the power of no clear value proposition, which immideveloping profound know-how into an nently results in something that has no area to fully and correctly leverage its commercial relevance. They do, however, potential, if suited for the situation. So promote a Facebook page counting likes digital / online / social media or any such from friends and other people we don’t specialty or segment in the marketing know much about. Such efforts are like throwing the rod into the river and hoping spectrum is fine, as long as: www.todaysoftmag.com | nr. 43/january, 2016

15


marketing Marketing through the digital “window”. An enlarged view for 2016 some fish will bite. It may (arguably) be less costly, more measurable, it may even work, but it surely will not bring the most of what you can get out there. For a real-life proof, I recommend this presentation1 from branding expert Mark Ritson. He compares the impact of the notorious Oreo tweet that took the advertising spotlight in the 2013 edition of the Super Bowl to the Budweiser TV commercial. Acclaimed as even the best ad in the Super Bowl, the tweet’s reach was calculated at a merely 64,300, which would generously account for about 0.02% of Oreo’s market share in the US. Of course, what Ritson ignores is the PR-generated impact, which should be added to that, but, at the end of the day, the overall comparison is more than pertinent. We cannot ignore the growing adoption of mobile devices, the improved access to the Internet and the consumer shifts associated to these trends. Nor can we ignore the tremendous value of technology in marketing, fully-fledged into what is Adobe Marketing Cloud, for example. After all, “nobody ever got famous by predicting that things would stay pretty much the same”, to quote Ad Contrarian Bob Hoffman2. But some things change at a faster pace (i.e. technology), whereas with some we just have the illusion of change (i.e. changes in us, as humans). Genevieve Bell, Intel’s leading anthropologist, argues that technology responds to human nature without changing it. This is an interesting point to note, as „good ads appeal to us 1 https://www.youtube.com/watch?v=MCAEbirIByc& feature=youtu.be&t=207 2 http://adcontrarian.blogspot.ro

as consumers”, whereas “great ads appeal Take the time to ask if the “window” you to us as humans”, the same Bob Hoffman are looking through is the most suited for concludes. your marketing, your business, your career or whatever context you may be in. We are humans as consumers and we’ve got humans behind products and So Nick, the world may just need some businesses. And there always are customer well-rounded men, those who are the most scenarios that transcend a well-defined limited of all specialists. They too are sinadvertising, purchase or consumption gle-windowed, just that their window is one interaction and these are made of nume- with... a larger view. rous online and offline points of contact. It is marketing’s role to design the customer experience with the product, service or brand all throughout these touch points. If Slack, a completely internet B2B business has taken over several US cities with its rainbows, kittens, ponies and balloons in its “Euphoria”3 outdoor campaign and just released its “Animals”4 TV commercial, then online and all-things digital may just not be enough for winning Share of Mind, Heart and Wallet. So, as Ritson predicts, let 2016 be the year of integration. And the year when we return to the basics of segmentation - targeting - positioning, buyer personas, the marketing mix and the rest of the marketing strategy and tactics, traditional or digital. Let’s see them as marketing “buzzwords” that don’t get unfashionable ever since the American Marketing Association started popularizing them in the 1950s. Is the big picture in your foundations? 3 h t t p : / / w w w . a d w e e k . c o m / n e w s / advertising-branding/slack-just-took-over-4-cities-its-first-bigextremely-bubbly-ad-campaign-168349 4 https://www.youtube.com/watch?v=x6sSa5NpqUI

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

16

nr. 43/january 2016 | www.todaysoftmag.com


TODAY SOFTWARE MAGAZINE

management

Strategic flexibility during uncertainty

G

iven the economic and business volatility, uncertainty of outcomes and the high risk of investments, is it possible that the huge upside potential of uncertainty is left on the table? In these conditions, how can we value that potential and overcome the difficulty of presenting a compelling business case based solely on traditional standard methods that rely heavily on information available at the moment of the appraisal (e.g. ROI, NPV)?

Static standards

much would you place on the final bet high flexibility to change the course of the Uncertainty is a central fact of IT even before the first card has been dealt? project, and is willing to pay to setup and exercise options to contain the risk given world. This uncertainty arises from many by the uncertainty. It comes handy when sources -the immaturity, complexity and Introducing Options Thinking unpredictable nature of technologies Options thinking is a mechanism the static valuation methods are not sufthemselves; increasing integration of whose specific purpose is to enable ficient to justify the decision because the technologies within and across organi- delaying decisions up to the point where NPV value has a small positive value or zations; increasing emphasis on IT to you are better informed about them. It even a small close to zero negative value. support innovative products and custo- borrows heavily from financial world, It must be said that if a project has a very mer facing services with hard-to-predict just like Net-Present-Value (NPV) and negative NPV, trying to justify its exismarket appeal. Despite that reality, static Discounted-Cash-Flow (DCF), and is tence by using real options is not a good valuation techniques discourage invest- based on the options pricing theory and use of options thinking. ROA complements the traditional ments done under uncertainty as they real options analysis (ROA) technique. tools by offering means to the capture only account for information considered upside potential of uncertainty and manaat the moment of the appraisal. gement flexibility to respond to it. Faced with small projected cash-flows or big discount rates decision makers feel A real option is a right - not an obligathe market pressure to make investments tion - to take an action (e.g. defer, growth, and compensate the unpalatable NPV abandon) on an underlying non-financial analysis by appealing to arguments like asset at a predetermined cost or before a „strategic importance” or „table stakes”. predetermined date. The date when the They are asked to make an all-or-nothing option expires or matures is called expidecision with the information available at ration date. The option cost is the price the time when they would prefer to exerpaid to acquire or create the option, keep cise their decision making flexibility and it alive and clear the uncertainty. decide on the go. An appropriate metaThe value of the option is given by the phor can be found in poker: assuming the Real options analysis is most valuable ante is 1$, and you can bet between $1 and when there is high uncertainty within the flexibility to decide whether to exercise the $10 for every open card, can you tell how underlying asset value, management has option depending on future conditions.

www.todaysoftmag.com | nr. 43/january, 2016

17


management

Strategic flexibility during uncertainty Managing options

This flexibility means that the option holders can participate in the upside of the investment (in case results are good) but limit their losses to the cost of acquiring the option (in case results are bad). Since uncertainty increases the potential upside outcomes but not the downside (which is capped at zero), greater uncertainty increases value of flexibility and thus the overall value of the option. Suppose a firm is tasked with a large project to implement a state of the art trading system. The firm chooses to proceed with a prototype implementation and proceed with the full project if the prototype turns successfully. The cost of the prototype is similar to the cost of purchasing a buy option on the full project. Managers can influence the value creation process by adopting a systematic approach that focuses on appropriately shifting project elements from “must do” to “may do” and structuring the last as growth options. Being effective in options thinking requires: • recognizing opportunities and structuring them as options • assessing proper value of the options • managing the project so that options are honored Option types: • stage = divides the project into distinct milestones where pursuit of each stage is contingent on a reassessment of costs and benefits at the time the preceding stage is completed, thus allowing the pursuit of positive ones. • abandon = as a project unfolds actual costs and benefits become more clear, and losses can be controlled by terminating the project • defer = the decision to invest can be deferred for some period without imperiling the potential benefits • g r o w t h = a n i n i t i a l

18

While having a numerical value per option is desirable, the essential value of the new way of thinking is managing the project in a way that allows for the value created through the options building process to be extracted. This means that for the chosen option, at a given date in time (not later than expiration date), we will compare the revised estimated value of proceeding further with revised estimated cost and proceed if this value exceeds cost. In reality it seems that some types of options are perceived as more favorable than others, even though in principle they should be equal. The growth and switch options are mostly used while abandon is valued least. One possible explanation may be that managers perceive the positive options easier to exercise in practice then then negative ones.

baseline investment opens the door to pursue a variety of potential follow-on opportunities • change = resources allocated to a project can be contracted or expanded, or the operational system enabled by a project can be scaled up or down more easily • switch = a key foundation technology/resource supporting a project can When approaching a high risk / high be swapped out for another reward project: • look for ways to contain the risk How to value options within options There are numerous ways to calculate • focus on shifting the balance from the value of the options, one of the most “must do” to “may do”, where the later frequent being the Black-Scholes concept. will be reevaluated at a later date accorA simple explanation can be given by ding to a predefined set of criteria. taking the scenario of an option (right to • identify the factors that generate decide) that supposedly expires in 1 year uncertainty and put in place measures from now. Let`s assume you have already to track their evolution. determined the range of possible outcomes • structure implementation in stages and there are 3 results: return of nothing so that each stage creates value even if (A), return of 26$ (B), return of $100 (C). further stages are not funded. We assess what is the probability for each • build in explicit options checkpoint outcome to occur and we multiply it with • nominate an exit champion to watch the expected result. By summing up the for the quality of decisions and avoid the values for each scenario we arrive to the project running along by default. future value of the option (in 1 year time) - $33. Applicability Real options analysis is not applicable when there is no flexibility, everything is a must do. Similarly, where there is little uncertainty or the consequences of that uncertainty can be ignored, then static Assuming an interest rate of 10%, valuation methods are sufficient. which means that for $100 in the bank you Complex, strategic or highly innowill get back in 1 year time $110, you can vative projects that tend to have higher work out the value that you would need to uncertainty and time frames, magnify the put in the bank today to get $33 in 1 year. value of options thinking and make it a Doing the calculation you arrive at today`s powerful tool for project management - it option value of $30. won`t be easy but it can make a difference. The outcome of the option valuation is as good as the accuracy of the probability calculation and assumes a risk neutral Paul Alexandru Tofan Paul.Tofan@isdc.eu stance, making no distinction between guaranteed income and risky income. Project manager

nr. 43/january 2016 | www.todaysoftmag.com

@ISDC


programming

programare

Fuzzy Logic and its Specific Mechanisms. A Theoretical Introduction.

“As complexity rises, precise statements lose meaning and meaningful statements lose precision.” - Lotfi A. Zadeh

D

esigning technical mechanisms that are able to reproduce the functioning of the human body has been one of the most attractive topics, ever since we can remember. If you are wondering why, the answer is a very simple one: people have always attempted to simplify or to improve the activities they need to perform on a day to day basis.

Bogdan Mursa mursa.bogdan@yardi.com Software Developer @ Yardi

Starting with the invention of the wheel, which was brought about by people’s necessity to carry heavy or extremely heavy loads, or the optical system that was created in order to develop the binoculars that help us see at great distances, these inventions have sped up development in numerous domains. Slowly, we started looking for technical solutions for devices that can perform operations like the human brain. This development was triggered by all the past inventions and previous evolution in all the fields. Human intellectual capacity was becoming too costly, or too slow, to be used at such a scale. Therefore, we could state that the appearance of the computer marks the beginning of a new era, where high performance processing becomes possible. The way in which a computer interprets the data it receives is a traditional one, meaning the binary logic. In the end, any decision made by this man-made device

will be either 0 or 1 or, in a more natural language, true or false. Up until recently, this way of making decisions managed to cover the needs from all the fields that were using computers; however, the rapid growth and development in quality and precision, needed when making decisions, made this traditional logic obsolete. Prof. Lotfi A. Zadeh (1965) has been talking for a long time about the need to use a logic that is closer to the human way of reasoning. However, just like Einstein’s theories were rejected by his contemporaries (only to become the norm in modern physics some years later), Zadeh’s theory, which he called Fuzzy Logic, was rejected by most of the people who saw it. It took many years for the scientific community to actually understand its importance and power. At present, this theory represents one of the basis of modern Artificial Intelligence and it is used in fuzzy systems from: cars, security devices, medical equipment, decision-making

www.todaysoftmag.com | nr. 43/january, 2016

19


programming Fuzzy Logic and its Specific Mechanisms. A Theoretical Introduction. mechanisms (marketing, business etc.), photo cameras etc. We use the fuzzy logic every day, without even realizing it, because the human mind is made in such a way that this is the type of logic it prefers. To give you an example, if you consider the question ”How satisfied are you with the Babes-Bolyai University?”, the answers might be ”pretty satisfied”, ”not satisfied”, ”extremely satisfied”, which are all ambiguous, or fuzzy, answers. Because the human mind is built like that, it is easy for us to interpret these answers, using our experience or different objective metrics. But when it comes to a computer that uses binary logic, those answers won’t be so easily understandable; these computers only understand values like 0 and 1, ”satisfied” or ”unsatisfied”. In fuzzy logic terms, this type of data which can be interpreted by any machine in a binary system is called crisp data. To give some practical examples, we will use an interesting situation to analyze how traditional logic and fuzzy logic behave. In this situation, we will try to create, at a conceptual level, a self-driving car system that allows our car to make the best decisions when another car approaches it. According to the traditional method, our system will only be able to make 2 decisions: near and far. With the help of Figure 1, we can imagine the distance between the 2 cars as being divided into 2 halves, each half with its corresponding decision. The traditional analysis of the distance between the 2 cars means that we can make only 2 decisions, which can be formulated in an ”if-then” structure: if condition then consequence.

re-start and continue until it suddenly brakes again because it reached the “Near” interval. The approach that the fuzzy logic brings is that the answer will always be between 0 and 1, including these two. Therefore, the representation of the distance between the two cars will look more like a gradient, as shown in figure 2.

This way we can obtain sets of rules like the ones above, asking more natural questions: Is car B close? Answer: 0.2 (not very close) If car B is as close as 0.2, then brake 0.2 (not so suddenly and strong). Answer: 0.8 (pretty close) If car B is 0.8 close, then brake 0.8 (pretty suddenly and strong). The example above offers a more ambiguous answer to our question, an answer that can be found in the interval [0,1]. A fuzzy number has a fuzzy set as a correspondent and they can be associated (in this case, it’s the set „not very close”). If car B is near, then brake. In a real situation, a self-driving car mechanism that If car B is far, then don’t brake. would implement the fuzzy logic would be much better at imitating the human behavior, with the car being able to adapt its speed according to the distance between cars without suddenly braking. This definitely made you curious about the algorithm that can be implemented in a fuzzy system. This implementation is a very natural one although it has some specific notions (they If we assume that our car will always be faster than car B and are suggestive though). we also take into consideration the rules above, then the system A fuzzy controller or a fuzzy mechanism is nothing but will always brake if car B gets anywhere close to our “Near” area, no matter how close, or far, the cars actually are. Once the dis- a car that uses the fuzzy logic. This controller can be a hardware tance between the cars is again in the Far interval, our car will or a software system or both, its purpose being to apply the fuzzy

20

nr. 43/january 2016 | www.todaysoftmag.com


programare

TODAY SOFTWARE MAGAZINE

logic in such a way that it interprets the data like a human being would, but much faster. The flow of such a mechanism is represented by the following steps: 1. Receiving measurement information from another system (in our case that would be a sensor that measures the distance between the 2 cars). E.g: 4 m, 5 m etc. 2. Let’s not forget that our system can only process fuzzy data sets. Therefore, we need to transform the data we receive from crisp data into fuzzy data. These transformations are done according to some metrics established by an expert in applicability. E.g: 4 m represents a value of 0.3 of “Near”. 3. The resulting set of fuzzy data is used as input in the fuzzy rules of the type if-then, which result in another set of fuzzy data. E.g: If car B is 0.3 m close, then brake 0.3 (not very strong) 4. The last step means transforming the fuzzy data into crisp data, so that the systems that read the output from the fuzzy controller can take the right decisions. E.g: 0.3 brake can mean lowering the speed by 30%. However, the architectural details of a system that uses this type of flow makes for another discussion. I hope that the theoretical aspects I presented in this article have been clear and have offered you a detailed picture of the concept behind the fuzzy logic and the systems that implement it. I recommend you continue to try and discover, on your own, the practical applications of the systems that use prof. Zadeh’s line of thought. The benefits it brings can be incredible and can bring quality and precisions to any project you are developing.

www.todaysoftmag.com | nr. 43/january 2016

21


programming

Roku

R

Thomas Morris thomas.morris@3pillarglobal.com Roku & Python Software Developer @3Pillar Global

oku has been erupting these past few years. Beginning as a lowly startup in 2002 and now boasting over 10 million users, Roku is the biggest player in the home media streaming device market, having sold 37% of all streaming devices last year. The next closest competitor is Chromecast at 19%. So even though this startup has been duking it out with goliaths like Apple and Google for the home media market, it’s been doing so quite successfully.

Roku In case you’ve never heard of Roku before, it’s a small, inexpensive (usually < $100) box you can connect to your TV and stream videos from different channels, or apps. The job of a Roku developer is to program a channel which the user can open and stream videos to their TV through. So if one develops, say, a Youtube channel, he or she would be making an app through which users can search for and watch Youtube content on their Roku. Upon starting to program, you’ll rapidly realize that Roku, in fact, has no simulator to speak of -- any code you write and want to test must be uploaded to an actual Roku device and then run on the machine to do the debugging. If you’ve had a busy day at work and need to work on some at home, be prepared to take the device home with you and hook it up to a spare TV that you hopefully have lying around. Debugging is done through the use of placing „stop” commands through the code to set breakpoints, then creating

22

nr. 43/2016, www.todaysoftmag.com

a telnet session to your Roku device and stepping through with text commands in the terminal. It’s painful if you’re used to a GUI debugging interface, but it’s definitely doable. One of the more interesting things is that, instead of adopting an existing language in the way Android did with Java, the Roku team decided to do the counterintuitive and make the box run on its own proprietary scripting language - Brightscript. Now, at first glance this sounds like the typical mistake all entrepreneurial engineers make when they create a product - rather than use something that’s already out and proven to work, they re-invent the wheel because, well, that’s what engineers love to do. Meanwhile, this has a tendency to cause all kinds of minor problems. And believe me, Brightscript has plenty of them. From forgetting about quirks when performing boolean operations to introducing a slew of other idiosyncrasies,


TODAY SOFTWARE MAGAZINE making a brand new programming language is actually much And you’ve got a decent looking page with two elements more complex than it first seems. on it ready to go. All the styling will be done according to the “roPosterScreen” template’s presets. But once we get past all the exasperated sighing and eye rolling and „ugh, typical”s we all feel at a company making yet At the same time, this is one of the worst things about Roku. another proprietary language, we can see there’s actually a lot of If you have clients who ask questions that start with „Is it possible sense to Roku doing this. For one, they don’t have to worry about for us to change that one little...?” -- get used to saying no. Get a new version of the language coming out and having to upgrade used to saying it a lot because one thing Roku does not much their libraries constantly to keep up. They have complete and allow for is customizability. Usually about the only thing that utter control over how the language interacts with their software; Brightscript lets you change is the background color and some they are beholden to positively nobody. Brightscript lives and minor positioning of elements in the banner at the top of the dies at Roku’s desire. screen. Other than that, you’ve got nothing.

Working with Brightscript In terms of actually working with the language, one of Brightscript’s greatest features is its size. This language is tiny. The entirety of the codebase only consists of about 90 class types or so. That means if you’re a new Rokuist/ista, it’s simple to learn the ropes and slap together some easy code that more or less works. The most interesting thing is that Brightscript doesn’t allow you to format the layout of your views (or screens) in your app. Yep, that’s right. Roku allows you almost no control over where your screen elements go or how your UI looks. You choose one of the 10 or so templates Brightscript offers you and pass your information to it. From there, the program lays out everything according to its own ways whether you like it or not.

Anything more custom than having your own background color requires you to build an interface using the „roImageCanvas” class wherein you have to specify every box, text object, and image’s coordinate, width, and height. Then if you want to add any form of animation, you have to render everything manually. Needless to say, it requires painstaking effort to build your own custom interface and it is not really something you want to do unless you’ve got a lot of time to crank it out.

Conclusion

Despite this, the promising thing about Roku is that the streaming device industry has been booming lately. A Parks Associates study shows that the number of U.S. households owning a streaming device has increased by 63% since last year, from the 13% to 21%. The same report also predicts that companies will sell up to 86 million streaming devices in 2019. Seeing as how Roku owns a In a sense, there’s something liberating about this. Writing an big share of that, there’s a strong possibility that demand for Roku app becomes super simple as all you have to do is write something programmers will surge in the next two years or so. like: poster = CreateObject(„roPosterScreen”) Given how fast the streaming device market has been contents = [ escalating, learning to program for one of them is becoming { Title: „Show 1” increasingly viable. If one can tolerate the platform’s shortcoDescription: „The hottest thing on TV” mings, Roku’s popularity makes learning it an obvious choice. } { It’s still in its infancy, but Roku’s already meteoric rise promises Title: „Show 2” a lot for the future. Description: „The next hottest thing on TV” } ] poster.SetContentList(contents) poster.Show()

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 | nr. 43/january 2016

23


programming

Zero to RESTful in 4 easy steps. API Design.

T

his article is part 2 of a series showing how to prepare, design, and implement a RESTful API. After setting up the grounds in the first part, this time we are going to look at how an API is designed, what concerns we should have in mind when doing that. But first, we will have a look at what REST is, and what are the architectural constraints it imposes on a system.

Georgiana Gligor gb@tekkie.ro Owner @Tekkie Consulting

What is REST? Representational State Transfer is an application architectural style that, instead of imposing specific technology choices, defines a set of constraints for the software system to follow. This way, the actual implementation details can change, while still taking advantage from the overall benefits of the RESTful approach.

Key REST Concepts

A resource represents any information that can be named. Usually resources are concepts within the application domain, no matter if they refer to concrete concepts such as persons, or to virtual ones like files. A starting point of visualizing it for those familiar with OOP is to use a 1-to–1 mapping with the domain model classes. Since we are going to build an application tracking vehicle data, we can say that one resource is vehicle, another one is its insurance. The difficulty of explaining this term comes from the fact that aspects particular to the business can dictate deviations from the most intuitive way of representation, without this breaking the validity.

24

nr. 43/2016, www.todaysoftmag.com

REST has been formally described by Roy J. Fielding in his PhD thesis1. He started from a system with no distinguished boundaries between its components, and incrementally applying five mandatory constraints and an optional one to elements within the architecture: 1. client-server: separates UI concerns from data storage 2. stateless: keep session details entirely on the client, and free the server from dealing with it, in order to allow scalability, reliability, and visibility; the downside is that each request needs to contain enough context in order to get processed 3. cache: data within a response must be labeled as cacheable or non-cacheable 4. uniform interface between components, as defined by the following four interface sub-constraints: identification of resources; manipulation of resources through representations; self-descriptive messages; and hypermedia as the engine of application state (aka HATEOAS) 5 . l a y e r e d 1 http://www.ics.uci.edu/~fielding/pubs/dissertation/ top.htm


testare

TODAY SOFTWARE MAGAZINE

system: component can only “see” and interact with layers immediate to it; for example, clients cannot assume they interact directly with the data source, as they can be talking to a cache layer 6. [optional] code-on-demand: client functionality may be extended by downloading and executing code; this means that the client doesn’t need to start with all the code, as they can grab it on demand; just imagine how functionality is added by injecting Javascript code to the browser.

ezone”: { „id”: „Europe/Bucharest” }, „events”: [{ „id”: „123456789@example.dev”, „start”: „2015-03-11T12:34:56.000Z”, „end”: „2015-03-11T12:59:59.000Z” }] }

Representation is a part of the resource state that is transferred between the client and the server. It usually refers to the current state of the resource, but it can also indicate its desired state, you can think of this as the client performing an action dryrun when making the request. While not a constraint itself, the communication mechanisms offered by HTTP are the choice of most people implementing REST. We are going to use HTTP as well, and use its powerful verbs to define operations on our resources. Let’s use the common calendar paradigm to quickly illustrate the difference between resources and their representations, by showing an .ics representation first:

In order to specify how our API will behave, we want to use Behaviour Driven Development. In this section we are going to introduce some concepts and tools to help with that. Setting this up will be very helpful when we will need to write down the requirements as user scenarios. There are two main keywords that arise in discussions about doing BDD in PHP. The most popular is Behat2, which uses Gherkin3 to specify the requirements in a business-like language. The other one is Codeception4, which uses PHP code that is human readable to do the same, but in addition offers a group of tools to write all your tests in (acceptance, functional, as well as unit tests). I have used Behat quite a lot in my Symfony projects, so I naturally tried to take the simple route and install it first, using $ composer install behat/behat. I noticed packaging conflicts because Behat wanted to use symfony/event-dispatcher ~2.1 but I was already using 3.0.1. So, instead of even attempting to fix that by imposing more strict requirements on my existing packages, I just decided I long wanted to give Codeception a try anyway, as others told me they absolutely love it in their day to day flow. No more nice text Gherkin spec files to share with the business people, back to 100% PHP! So I went on and installed it using the Composer method, which worked perfectly, no digging required:

GET /calendar/123sample Host example.dev Accept: text/calendar

could return something similar to BEGIN:VCALENDAR VERSION:2.0 PRODID:-//Tekkie Consulting//123sample//EN CALSCALE:GREGORIAN BEGIN:VTIMEZONE TZID:Europe/Bucharest END:VTIMEZONE BEGIN:VEVENT UID:123456789@example.dev DTSTART;TZID=Z:20150311T123456 DTEND;TZID=Z:20150311T125959 END:VEVENT END:VCALENDAR

If we ask for a JSON representation of the same resource GET /calendar/123sample Host example.dev Accept: application/json

it might look like this: { „version”: „2.0”, „creator”: {„company”: „Tekkie Consulting”, „product”: „123sample”}, „type”: „Gregorian”, „language”: „English”, „tim-

For the remaining of this article series we will choose JSON as the representation default of our resources.

BDD in PHP

$ composer install codeception/codeception

and then bootstrap it 2 http://docs.behat.org/en/v3.0/ 3 http://docs.behat.org/en/v2.5/guides/1.gherkin.html 4 http://codeception.com

www.todaysoftmag.com | nr. 43/january 2016

25


programming Zero to RESTful in 4 easy steps. API Design. $ vendor/bin/codecept bootstrap

We notice a new folder called /tests/ in our root directory has been populated with a lot of goodness. As we are in development mode, we start our application locally using the built-in PHP server: $ php -S localhost:12345 -t web

of our application • road tax - has a start and end date of validity, and is associated to a vehicle • insurance - similar properties to road tax, but is a distinct concept • technical check - cannot exist without being attached to a vehicle; has a start and end date of validity

so we will make sure this URL is properly configured under Now that we know what our application resources are, what tests/acceptance.suite.yml. are the operations we define on each? We are certainly interesNext we will generate a basic acceptance test by running: $ vendor/bin/codecept generate:cept acceptance ted to be able to create, update, and retrieve vehicle information. Then we need to add and retrieve road tax details, add and Welcome Our tests/acceptance/WelcomeCept.php will contain a very retrieve technical checks, as well as add and retrieve insurance information. simplistic test, that only checks the status route: $I = new AcceptanceTester($scenario); $I>wantTo(‚check the status route’); $I->amOnPage(‚/’); $I->see(‚Up and running.’);

And the results are indeed what we expect:

$ vendor/bin/codecept run Codeception PHP Testing Framework v2.1.5 Powered by PHPUnit 4.8.21 by Sebastian Bergmann and contributors. Acceptance Tests (1) -------------------------------------------- Check the status route (WelcomeCept) Ok ----------------------------------------------------------------- Functional Tests (0) ------------------------ -------------------------------------------- Unit Tests (0) ----------------------------- -------------------------------------------Time: 214 ms, Memory: 11.25Mb OK (1 test, 1 assertion)

The acceptance tests of Codeception are usually much slower than functional ones, as they require a web server to run tests. Fortunately, functional tests are going to be very good at describing our intended functionality, so we are going to use those instead. Let’s enable the Silex module first, by adding it to tests/ functional.suite.yml: class_name: FunctionalTester modules: enabled: - Silex: app: ‚app/bootstrap.php’ - \ Helper\Functional

How do we design an API? As we have seen in the REST introductory section, a key concept in this architecture style is resources, as everything else gravitates around them. Therefore I recommend going through the list of domain concepts first, and identify what our resources would be: • vehicle - the main concept describing the central resource

26

nr. 43/january 2016 | www.todaysoftmag.com

All the above operations look strikingly similar to CRUD operations (part of them are missing in our list for domain reasons). So let’s go ahead and define the full list of CRUD operations on a vehicle resource: • Read information about all vehicles • GET /vehicles • If there are no vehicles, we will receive 200 OK status and a body of [] • If there are items in the storage, we will receive 200 OK status and a body containing all of them, like [{ „name”: „family car”, „make”: „Mazda”, „model”: „3”, „registration”: „AB10TKK”, „VIN”: „JMZBLA2F701213123”, „engine”: „1999”, „emissions”: „175”, „registered”: „2010-10-01T12:23:45Z” }]

• If the server had issues fulfilling the request, a 500 Internal Server Error will be issued. It is the catch-all error for unrecoverable errors, when “it’s the server’s fault” and we can’t offer recovery options to the client. This will be the case for all operations, so we will not repeat the information further. • Create a vehicle • POST /vehicles/ • Request body will contain all the data about our car, for example { „name”: „family car”, „make”: „Mazda”, „model”: „3”, „registration”: „AB10TKK”, „VIN”: „JMZBLA2F701213123”, „engine”: „1999”, „emissions”: „175”, „registered”: „2010-10-01T12:23:45Z” }

• On successful creation of the resource, we expect a


TODAY SOFTWARE MAGAZINE 200 OK status code (some recommend using 201 Created instead) and the body to contain the same data we sent, plus the ID this resource has received in the backend. • If there was a problem with the request (let’s say we will have a requirement for VIN to be mandatory and the request does not include it) that the client can fix, we signal that by issuing a 400 Bad Request status code and a body describing the problem: { „VIN”: „mandatory” } • Read information about a specific vehicle • GET /vehicles/{id} • If the vehicle with the given ID exists, we expect a 200 OK status code and the body to contain relevant data about it. • If there’s no information about a vehicle with that ID, we expect a 404 Not Found and an empty response body. • Update • PUT /vehicles/{id} • If the vehicle with the given ID exists, we expect a 200 OK status code and the body to contain relevant data about it. • If there was a problem with the request that the client can fix, we signal that by issuing a 400 Bad Request status code and a body describing the problem: { „VIN”: „mandatory” } • Delete • DELETE /vehicles/{id} • If there is a vehicle with that ID, it will be removed from the system and a 200 OK status code with an empty body will be returned. • If there’s no information about a vehicle with that ID, we expect a 404 Not Found and an empty response body. The dates are present here in [ISO 8601 standard][iso-8601], to maintain dates in a timezone-aware format. Facebook had to switch in 2012 entire events API5 to account for timezone issues. We will not go into further detail on operations about road tax, technical check and insurance, as they are very similar to those described above.

this approach is to be able to have a drastically different API in the next version. However, the important question to ask yourself is: “Will the API itself change drastically over time? Or will the resources and their representation change?” Strategies to change a non-versioned resource structure or operations on it are a bit more complex, and they usually involve offering a new URI to handle the new data, and deprecating the current one. As Stefan Tilkov points out10, REST is so much more than just some URI patterns and GET, PUT, POST, DELETE. Choosing the best strategy is highly dependent on the problem at hand, and we all know stories of under- or over-engineered APIs. When constructing our URIs, we should take care to not mix singular and plurals. So we will not expose /vehicles/{id} and / tax/{id} in the same application, we will prefer taxes in the second case. It is generally recommended to use plural forms instead of singulars. As the URIs identify resources, it is considered good practice to keep only nouns in defining them, and avoid verbs. To describe the actions that are performed on the resource, the HTTP verbs should be used. For example, usage of /vehicles/create should in fact be a POST on /vehicles. For more hands-on examples, I recommend the well-written White House API standards11, which contain also handy examples to show what is considered “bad” and what is “good”. There are also some good hints on REST API Tutorial12, but I recommend caution when navigating the site because not all information there is adhering strictly to the RESTful we met at the beginning of this article. Even more granular advices concern the naming conventions and case usage13, both for URIs and for JSON structures. Just make sure you pick one type and adhere to it everywhere.

Define application behaviour

Let’s setup the vehicle behaviour we want by defining functional tests for them. We are going to use Cest classes14 as they will later help us set up the tests better. They are simple classes that group the cept functionality in a more OOP manner, help us use Keep the API consistent It is important to offer a consistent API, first of all for our methods to group certain things together. So we are going to generate our cest first, using sanity, and then for the benefits of any 3rd party consuming it. vendor/bin/codecept generate:cest functional VehiThis is very easy to explain with the public-published distinction $ cles Test was created in /Users/g/Sites/learn/silexthat Martin Fowler makes6. Once something is published, making tutorial/tests/functional/VehiclesCept.php changes to it requires a complex process of deprecating existing functionality, offering new one on a different URI, which takes Let’s go ahead and define how creation of a new vehicle record more time and effort than a normal code update. should look like. We are basically saying “if a POST request is executed against the /vehicles endpoint, with a name for the new An important aspect to consider upfront is the API versio- item, we are going to create it and retrieve the full record, incluning. Some API designers prefer to define the version in the base ding its ID”. This will enable us to perform later operations on the URL, like GitHub7 which uses the version number, or like Twilio item by accessing /vehicles/ID. class VehiclesCest { public func8 who uses https://api.twilio.com/2010-04-01 as their starting <?php tion createItem(FunctionalTester $I, $scenario) point. WePay also uses release timestamps in the URL9 to diffe- { $I->wantTo(‚create a new vehicle’); $I[ ‚name’ => ‚Panrentiate between versions. Almost everyone does versioning one >sendPOST(‚/vehicles’, sy’ ]); // we mark scenario as not way or another, and if you want to play safe you just start with / implemented $scenario->incomplete(‚work in $I->seeResponseCodeIs(200); v1/ yourself and go from there. The biggest advantage of choosing progress’); 5 https://developers.facebook.com/docs/apps/migrations/completed-changes#jul_2012

10 http://www.infoq.com/presentations/rest-misconceptions

6 http://martinfowler.com/ieeeSoftware/published.pdf

11 https://github.com/WhiteHouse/api-standards

7 https://developer.github.com/v3/

12 http://www.restapitutorial.com/lessons/restquicktips.html

8 https://www.twilio.com/docs/api/rest

13 http://blog.octo.com/en/design-a-rest-api/#case

9 https://www.wepay.com/developer/version

14 http://codeception.com/docs/07-AdvancedUsage

www.todaysoftmag.com | nr. 43/january 2016

27


programming Zero to RESTful in 4 easy steps. API Design.

$I->seeResponseIsJson(); $I>seeResponseJsonMatchesXpath(‚//id’); $I>seeResponseJsonMatchesXpath(‚//name’); $I->see ResponseMatchesJsonType([ ‚id’ => ‚integer’, ‚name’ => ‚string’ ]); $I->seeResponseCo ntainsJson([ ‚id’ => 123, ‚name’ => ‚Pansy’ ]); } }

Please note that, for now, we mark the scenario as incomplete, to prevent execution of our assertions. We will remove this in the next part of our tutorial, where we will get to implement the actual functionality. A commit containing more information about the other operations defined for vehicles and the assertions we make can be consulted on GitHub.15 Running the functional tests indicates that we have indeed defined several tests which are skipped for now, here are the relevant bits for you to check: $ vendor/bin/codecept run Functional Tests (4) --------------------------------------------------- Check the status route (StatusRouteCest::checkT heStatusRoute) Ok Create a new vehicle (Vehic lesCest::createItem) Incomplete Retrieve current vehicles (VehiclesCest::retrieveIte ms) Incomplete Modify an existing item (Ve hiclesCest::updateItem) Incomplete ------------------------------------------------------------------------ Time: 372 ms, Memory: 12.00Mb OK, but incomplete, skipped, or risky tests! Tests: 4, Assertions: 1, Incomplete: 3.

The remaining definition of use cases remains for the reader as an exercise.

Conclusions We have learned what the REST architectural style is, learned the difference between resources and their representations, setup Codeception to help us define the user stories, learned how to 15 https://github.com/tekkie/autolog-api

28

nr. 43/january 2016 | www.todaysoftmag.com

design an API from a practical point of view, and saw what we need to be aware of to keep it consistent. In the next article we will refine the user stories and work on the implementation.


programare

programming

Frontend Mashup

M

any of the web programmers need the rendering time of a web page to be as short as possible. One is confronted with this problem first of all when one has to choose the tools to work with on a new project.

Raluca Oanca-Boca ralucaonaca@gmail.com Full Stack Developer @Self-Employed

At the beginning of a new project it is always difficult to choose the tools that will ease the work of each team member. We have to be careful when we choose these tools, since they will be used until the end of the project, but also in the deployment process. In this article I am trying to highlight the operations that form the automation of the frontend. They are: the writing of css with a pre-processed framework, the minification and testing of css, as well as the minification and testing of the js and, also, their automation under the form of processes both for the local development environment and for production. For the initial prototype project we have used the PHP programming language as backend, without using any other framework, and as a frontend framework we have chosen AngularJS. When it comes to choosing a styling language, we can choose one of the following: LESS, SASS/SCSS or Stylus. These are preprocessed styling languages, which have an advantage compared to the pure CSS language. The main advantages are: the possibility of having variables, inheritance, nesting and mixins. After making the wanted choices, the challenge is to be able to combine these tools so as to ease our work first of all, the work of a development operator, and also have a page rendering time as short as possible.

The following things are available to us: nodejs, ruby, but also the package manager based on nodejs: npm. As a good practice in using the package manager, a package. json file is used in the root directory of the project. In this file, we will list all the packages we need, as well as a few of the dependencies for the local work environment. After creating this file or after modifying it, we have to run the order: npm install Following the order, the node_modules directory is created, after which we need npm – g install grunt – cli

Ruby programming language will be installed and a few of its dependencies, among which: sass, sass-globing and compass. sudo apt-get install ruby-full sudo gem install sass compass sass-globbing

www.todaysoftmag.com | nr. 43/january, 2016

29


programming Frontend Mashup Once we have them installed, we can begin to build our Gruntfile.js file, which is also created on the same level as the package.json file. We need this file since, every time the grunt order is run, it will take this file into consideration.

The configuration part of the order is done through the configuration file as well as through some of the initial commands. The following step is to load the initial tasks which depend on the customized tasks.

After loading the initial tasks, we will use the compass task for our project. If we run the grunt compass:dev order, we will see that all the used sass files will be chained in the destination scss file. It will be then transformed in css format with expanded display format. For the production work environment, the style is compact. For the chaining of the js files, we have used the uglify task. For the local work

30

environment, we have chosen the option that after the chaining of the files, the result be expanded, and for the production work environment, we wanted it to be minified. We have a problem if we wish to change any sass or js file, through modifications we want to make. For these, we have created the watch task, which will verify any sass of js file, after which it will transform or minify them, depending on each case. This task is useful for the local work environment.

For coding standards, we can use grunt.loadNpmTasks (‘grunt-contribjshint’); but I preferred using a pre-commit hook for git. By using a single command, we can automatize our work in a local environment as well as in a production one. At the same time, we are using the DRY principles, we get fewer errors and we can make changes more easily. In conclusion, the advantage is represented by the fact that we will no longer have to add every css or js file, but in the Towards the end, the goal is the regis- end, by using grunt, we will just have one tration of the customized tasks for the file that should be added in the HTML different work environments. In this line, page. one can also notice the browserSync task, which is based on the watch task, so that Bibliografie: any modification we make will be automa[1].http://conferences.oreilly. tically seen on the web page, without any com/fluent/fluent2014/public/ need of manually reloading the page. schedule/detail/32532 One difference that can be noticed is [2]. https://speakerthat in the production work environment deck.com/addyosmani/ I have chosen to run the order in the end automating-front-end-workflow to add a hash at the end of the file and thus [3]. https://gruntjs.com avoid a cache problem. In the same time, [4]. https://www.npmjs.com/ we can also make a versioning. [5]. http://gruntjs.com/plugins For testing the css, we can use the PhantomCSS for which we have chosen to write tests using CasperJS. For the testing of the js, we can use Karma for unit testing and Jasmine for behavior testing.

nr. 43/january 2016 | www.todaysoftmag.com


education

programare

Searching for (potential) talent

A Mădălina Nastasa madalina.nastasa@happyemployees.eu Sales Development Representative @ Azimut Happy Employees

t the start of each and every year, most of us plan on making radical changes, whether we’re talking about ourselves or the conditions around us, usually in order to reach an extraordinary result – most sales so far, the best software, most motivated employees, largest profit etc. We know that and, therefore, in order to support the momentuum, we will greet you with the new challenges that might slow you down in reaching your extraordinary result in business. We’re keeping our fingers crossed they won’t!

The 2015 statistics

How do we read the signs?

The talent crisis first became worrisome for the HR staff and then ultimately spread to the entire business world since no matter how innovative, open or capable a company is, in the end it will need new talents to keep its performance rising or at least stable. A global average published in 2015 shows that 38% of the employers find it very difficult to find the right people for their company, the highest percentage since 20081. What about Romania? According to the same study, Romania is facing the worse talent crisis on the old continent, with an average of 61% managers worrying that they may not be able to fill in the positions that their business needs. Romania is closely followed by Greece (59%) and Turkey, Bulgary, Hungary. On the other end there’s lucky Ireland ( 11%) but also the Netherlands, Spain and Great Britain with 14%.

The employers also told us what the causes for employees shortage are, in their experience. First of all, there aren’t enough applicants for the jobs. It’s as simple as that. If, by any chance, there are enough candidates, they either lack in experience or in hard or soft skills. Ultimately, employers are also dissatisfied with the unrealistic income expectations the candidates have.

1

h t t p : / / w w w. m a n p o w e r g r o u p . c o m / w p s / w c m /

connect/db23c560-08b6-485f-9bf6-f5f38a43c76a/2015_Talent_ Shortage_Survey_US-lo_res.pdf?MOD=AJPERES

The consequences we see in the business world Do we really need to worry? Well, we can’t really decide unless we take a look at the consequences of this crisis. The EMEA (Europe, Middle East and Africa) statistics show us raising percentages in comparison to last years. This basically means that the employers find the consequences all the more threatening. So: • 55% of the employers find that the main negative impact is reduced ability to serve clients • 51% say that productivity and competitivness are lowering

www.todaysoftmag.com | nr. 43/january, 2016

31


education Searching for (potential) talent • Reduced innovation and creativity (37%) • Increased employee turnover (36%).

Now that you know all this, what’s your complex tasks • training on both hard and soft talent management strategy? ( we’re not even taking into account skills necessary at work that you don’t/won’t have one!) • training potential leaders

The more fortunate news is that there’s still time till 2020 to do something about • investing in young employees so that the looming crisis. The forecasts show that they can become productive in as short a by 2020 the crisis will reach its peak, with time as possbile more employees leaving the work market • satisfying their need for indethan those entering it. This will make the pendence ( the quicker they enter the active workers even more valuable and production phase, the quicker they their retention combined with the recrucan specialize on a domain and gain itment of fresh talent will become top autonomy on their work) priorities in the business world. We abso• initiatic learning programmes, lutely must not be caught off guard by this customized on the needs of the new phenomenon. comers ( they may lack the skills, but Now that we’re aware of the crisis that’s make up for it in learning and growth creeping in on us, what can we do about it? potential) Obviously enough, the majority of the large companies and corporations have • micro-management focused on the already started addressing this crisis since generations present on the market (e.g. their existence and market position are at most of the employees are Millennials, stake. with a different work ethic and expecHere are some human resources stratations than the baby-boomers or tegies put in place around the world2 3: Generation X) • performance management, cle• flexible timetable, focused on the arly linked to the benefits and rewards balance between the professional and available personal life of employees ( based on So that’s what the work market has objectives rather then working hours) • g r o w t h a n d d e v e l o p m e n t prepared for us – a talent crisis that turns recruitment new talent and keeping our opportunities • autonomy on more varied/ current colleagues safely in their seats into 2 http://hrtimesblog.com/2015/03/25/if-you-build-it- each company’s priority. In Romania this crisis has already hit the business enviwill-they-come-overcoming-the-talent-crisis-in-manufacturing/ 3 http://www.bloomberg.com/bw/stories/2008-09-19/ ronment and hit it hard, with 61% of the the-global-talent-crisisbusinessweek-business-news-stock-market- employers facing the challenge of finding and then hiring the right people. and-financial-advice

32

nr. 43/january 2016 | www.todaysoftmag.com


accounting

10 fiscal novelties in force from 2016 with an impact on entrepreneurs

Y

ear 2016 brings important fiscal novelties for entrepreneurs, regardless of the form of organization: SRL (LLC – Limited Liability Company), PFA (Registered sole trader), etc. The main modifications are brought about by the appearance of the new fiscal code (Law 227/2015) and of the Order 2634/2015, which bring important updates to the form of fiscal – accountancy documents.

Delia Mircea delia@contzilla.ro @ Contzilla.ro

We present below an overview of the main modifications with an impact on the entrepreneurs’ day to day activity. 1. The new VAT rate Beginning with the 1st of January 2016 until the 31st of December 2016, the VAT standard rate is 20%, then, from the 1st of January 2017, it will become 19%. The standard rate applied until December, 31st 2015, was 24%. The reduced rates remain 9%, respectively 5% for certain categories of goods and services. Still as an element of novelty applicable from the 1st of January 2016 is the reduced rate of 9% for water. This modification was introduced through OUG 50/2015. A very common case in practice is that where an invoice was made out in December for services in advance (for instance, IT technical services), with deadline in 2016. The advance invoice was issued with 24% VAT. Will the advance be paid back?

Considering the fact that the fact that generates the VAT is happening in 2016, when a new rate is in force, the old invoice with a 24% VAT rate will be cancelled and a new invoice will be issued for the entire amount, with a 20% VAT rate. 2. The new taxing rates for small businesses The taxing rates for the income of small businesses, applied from the 1st of January 2016 are: a) 1% for the small businesses that have over 2 employees, inclusively; b) 2% for the small businesses that have one employee; c) 3% for the small businesses that have no employees. Meeting the condition regarding the number of employees: An employee is the person hired with an individual work agreement and full time, but the law also accepts the cases when the small businesses:

www.todaysoftmag.com | nr. 43/january, 2016

33


accounting 10 fiscal novelties in force from 2016 with an impact on entrepreneurs a) have people hired part time with an individual work agreement, if the fractions of time stipulated represent the equivalent of a full time job when added up – for instance, two employees, each hired for 4 hours/ a day, or 4 employees, each working for 2 hours/ day or any other alternatives that sum up 8 hours. b) have concluded contracts of administration or mandate, according to the law, in the case when their remuneration is at least equal to the minimum gross basic salary in our country, guaranteed in payment. As an exception, the small businesses set up after the 1st of January 2016 benefit from further facilities, meaning that, if they have at least one employee and are established for at least 48 months and the shareholders/ associates haven’t had participation titles in other companies, the taxing rate is 1% for the first 24 months from the registration date of the Romanian company. The taxation rate is applied until the end of the semester when the 24 months period is over. The hiring must be carried oud within 60 days from the registration of the company. Beginning with the 1st of December 2016, for an employee working 8 hours/ day with the minimum salary on economy (1.050 lei), the following taxes are paid: • contributions and taxes withheld from the employee: 265 lei; • contributions owed by the employer: 240 lei. The net salary pertaining to a gross salary of 1.050 is 785 lei. We supposed the employee has no persons in his care. Beginning with the 1st of May 2016, the minimum gross salary on economy will increase to 1.250 lei. 3. The new turnover limit for small businesses Still in 2016, the limit of the turnover for which an entity can register as a small business has changed. Thus, if during

34

the fiscal year a small business makes an income higher than 100.000 euro or the percentage of the income made from consultancy and management from the total income is over or equal to 20%, it owes a tax on profit, beginning with the trimester when any of these limits has been exceeded. Until the 31st of December 2015, the limit was 65.000 euro. What happens if the conditions of being registered as small business are no longer met? If during a fiscal year a small business makes an income over 100.000 euro or the percentage of income made from consultancy and management is equal or higher than 20%, it owes a tax on profit, beginning with the trimester when any of these limits was exceeded. Till December 31st 2015, when the limits were exceeded, the recalculation of taxes was done from the beginning of the respective year, which was a much more disadvantageous situation from the fiscal point of view. 4. The taxation of the registered sole traders (PFAs) Most certainly, year 2016 will not be a fiscally favorable one for the registered sole traders (PFA). What has changes since the 1st of January 2016? • beginning with the 1st of January 2016, for the income from independent activities, one will pay CAS, no matter if the person also has an income from salary or not (until this date, if the PFA also gained income from salary, it did not have the obligation of paying the CAS); • the PFA can chose between the CAS rate of 10,5% (individual rate) applied to the net income gained or 26,3%, corresponding to a complete contribution stage; • the manner of paying the CAS is the following: during the year, the registered sole trader in real system has the obligation of making anticipated payments, on

nr. 43/january 2016 | www.todaysoftmag.com

a monthly calculation base of 35% of the gross medium salary on economy, then in the following fiscal year, based on the declaration of gained income, the fiscal authorities will recalculate the monthly base of calculation of the contribution as the difference between the gross income and the expenses incurred in view of carrying out the activity, excluding the CAS payments. • The CASS is still due in the rate of 5.5%, on a monthly base calculated as the difference between the gross income and the deductible expenses, excluding the CASS expenses. • There are no obligations of paying the other contributions: unemployment, risk fund, vacations, indemnities or debt securities. One can contribute, however, by choice, to unemployment or vacations and indemnities. • In regard to the tax of 16% of the income, it is still due, as there is no change from the previous year. There are certain minimum and maximum limits to the CAS owed by a PFA (registered sole trader): • the minimum limit of CAS is of 35% of the medium gross salary on economy. • in 2016, this salary is 2.681 lei. So, the resulted minimum contribution is 0.352.681 lei 10.5% = 99 lei. • the maximum limit of CAS is 5 gross medium salaries. Thus, the maximum contribution is 10.5% 2.681 lei 5 = 1.408 lei. From 2017, there will also be a limit of the calculation base for the CASS (health) to 5 times the medium gross salary. 5. Taxation on dividend income In 2016, the tax on dividend income is established by applying a taxation rate of 5% on the gross dividend paid to a Romanian juridical person. In 2015, this rate was 16%, and from 2017, besides the 5% tax on dividends, the contribution to health social insurance of 5.5% will also be applied, reaching thus a taxation rate of


TODAY SOFTWARE MAGAZINE 10,5%. Therefore, 2016 is a favorable period for collecting the dividends pertaining to the preceding financial exercises. What happens if there isn’t enough money in the company to make the payment of dividends? Even if at the moment when the profit that can be shared is known, one realizes there isn’t enough money in the company to carry out the payments, it is important to mention that they can be carried out at a later date, as resources accumulate, based on the decision of sharing them. It is also important to mention the fact that the tax on dividends must be withheld in the moment of the payment and transferred to the budget until the 25th of the month following the one when the payment towards the associates or shareholders was made. If an associate is also an employee of the company, what taxes is he subjected to in 2016 for the dividends taken out? What about in 2017? In 2016, an associate that is also an employee in his own company or in another one, will not owe but 5% tax on dividends. In 2017, the same associate – employee will also pay 5.5% CASS besides the 5% tax. 6. Sponsorships Sponsorship is the judicial act through which two parties agree on the transfer of the right of property on some material goods of financial means in order to support some activities with no gainful purpose carried out by one of the parties, named the sponsorship beneficiary.

Sponsorship beneficiaries can be: legal persons with no gaining purpose, who carry out (or will carry out) in Romania some activity in the following domains: culture, art, education, training, science – fundamental and applied research, humanitarian, religious, philanthropy, sports, human rights, medical health, social assistance and services, protection of the environment, social and community service, representation of the professional associations, as well as maintenance, restauration, preservation and promoting the historical monuments, shows or programs of television or radio, as well as books or publications from the above mentioned domains. In 2016, the limit to which sponsorships can be made increases in the case of contributors who pay the taxation on profit. The manner of calculation for 2016 is the minimum of: 1. the value calculated by applying the rate of 0,5% to the turnover; 2. the value representing 20% of the owed tax on profit. Previously to that, till the 31st of December 2015, the criterion on the first point was of 3 to thousand of the turnover. 7. Remission from taxes on reinvested profit The profit invested in technological equipment, computers and off-line equipment, machines and devices of registry, control and invoicing as well as IT programs, products purchased, inclusively based on financial leasing agreements and put into usage with the purpose of carrying out the economic activity, is exempt from

taxation. The tangible assets for which the exemption from taxation is applied are the ones stipulated in the sub-class 2.1, respectively 2.2.9 of the Catalogue regarding the classification and usual functioning duration of capital goods (HG 2139/2004). The novelty for 2016 is the introduction of group 2.2.9 into the list of assets for which the remission is applied. Group 2.2.9 contains “Computers and off-line equipment, machines and devices of registry, control and invoicing.” 8. Day allowance for administrators If, till the 31st of December 2015, the fiscal code did not stipulate the possibility of granting deductible day allowance to administrators, starting with the 1st of January 2016, it is stipulated that they can also benefit from deductible allowance. An important note introduced in 2016: the daily limit not subjected to taxation is granted only if the duration of travel is over 12 hours, every 24 hours being considered a travelling day in view of carrying out the activity. The level of deductible allowance is currently 42.5 lei/ day (legal base: Order 60/2015). 9. Social expenses The social expenses are those expenses which, as the name suggests, have a social purpose such as: funeral aid, aid for serious or terminal illnesses, birth aid, expenses for the proper functioning of some units found in the administration of the contributors, such as: nurseries, kindergartens, schools, museums, libraries, cafeterias, sport facilities, clubs, hostels and other such things, the expenses representing:

www.todaysoftmag.com | nr. 43/january 2016

35


accounting 10 fiscal novelties in force from 2016 with an impact on entrepreneurs

gifts in money or in kind, including the present tickets offered to employees and to their under aged children, health services offered in the case of professional illnesses and work accidents, nursery tickets given by the employer according to the law in force, the value of touristic and/ or treatment services, including transport, offered by the employer to his own employees and their family members, as well as the contribution to the funds of intervention of professional associations of miners or other social expenses incurred based on the collective work agreement or any other inner regulations. Social expenses will have, starting with 2016, a deductibility limited to 5% of the value of expenses with the salaries of the staff, instead of 2% as it was until December 31st 2015. As of 2016, one will be able to also include in the social expenses the present tickets offered to employees and their under aged children on the occasion of Easter, the 1st of June, Christmas and similar holidays of other religious cults, within the limit of 150 lei/person/event. In other words, the tickets offered in these situations are not taxed by 16%. 10. Updating the form of the financial-accountancy documents • the removal of the obligation of applying the stamp on financial documents, as result of the abrogation of legal stipulations regarding the obligation of applying the stamp by the parties and entities stipulated in art. V paragraph (1) and (2) of the OG no. 17/2015 regarding the regulation of some fiscal measures and the modification and completion of some normative acts (eg. travelling order, receipt, expense account); • the removal of the compulsory

36

minimal content within the norms of drawing and using of each form; • the removal of the obligation of issuing a certain number of copies of a document; • the removal of the stipulations regarding the circuit and place of filing away of every document. In conclusion, year 2016 brings novelties on every level: fiscal as well as accountable, both favorable (the reduction of taxes on dividends, the reduction of taxation rate for small businesses) and unfavorable (the additional taxation for the registered sole traders).

nr. 43/january, 2016 | www.todaysoftmag.com



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.