Issue 38 - August 2015 - Today Software Magazine

Page 1

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

TSM

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

Download from

Windows Store

I Love I Hate NY

mania

Software Project Management in Ro

Web Resources Access Protection Using ASP.NET Identity

BuyAndHelp.ro - a project about affiliate marketing and the wish to help

To be or not to be an object: On the problem of self reference

Non-wage Benefits in 2015 under Scrutiny

ACADEMY+PLUS Students in Internships and Junior Positions

Managing growing data with relational databases

When it hurts, we go to the doctor

The Online Battle: Brand versus Internet Domain



6 BuyAndHelp.ro - a project about affiliate marketing and the wish to help Angela Lepădatu

8 Software Project Management in Romania Razvan Gai

22 I Love I Hate NY Tudor Stânean

26 ACADEMY+PLUS Students in Internships and Junior Positions Gloria Csizser

10 Siemens Developers Day 2015

30 Non-wage Benefits in 2015 under Scrutiny

Razvan Opris

Adrian Beșleagă și Adrian Benta

12 Web Resources Access Protection Using ASP.NET Identity George Rus

16 Managing growing data with relational databases Alin Luncan

20 To be or not to be an object: On the problem of self reference Vlad Ardelean

35 When it hurts, we go to the doctor Szilard Kacso

37 The Online Battle: Brand versus Internet Domain Claudia Jelea


editorial

W

Ovidiu Măţan

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

e are coming close to September, the month when things are getting back to normal. That is, if normality means calling someone with a little more courage, without thinking that they might be on their holidays , or feeling in such a good shape that you haven’t begun dreaming about new holidays yet. The editorial staff of Today Software Magazine has already got in this rhythm. The two releases of the magazine, in Cluj and Oradea, stand as proof. Moreover, we have released the first video commercial for promoting the magazine, which you can watch on our page on Youtube. We hope you like it and we are looking forward to your opinions about it. We are also getting ready to launch the agenda of the Cluj IT Days event, 24-25 November, which has reached its third edition. If, last year, in the leadership section, the approached topic was the transition from outsourcing to product, this year, the focus is going to be on the actual products. In this respect, we are going to have a series of launches on the local market in Cluj. I would like to take advantage of the opportunity and also tell you a few words about programez.ro, which will soon be available. Users will have the possibility of creating a technical profile verified by passing some online tests. According to the points they get, they will have access to different bonuses such as discounts for trainings or they will be able to visualize hidden jobs. These have been the latest news from the TSM team. In regard of the contents of the magazine, it is diversified, as we have already got you accustomed. We are glad to present the success of two local start-ups: BuyAndHelp.ro and ILoveIHate NY. BuyAndHelp.ro is a great idea through which the profit share of e-commerce sites, such as emag.ro, libris.ro, etc. is redirected towards different causes such as: CJ community foundation, Noah’s Ark, Simplon, etc. Congratulations to Radu Popescu, an old collaborator of the magazine, for this idea which gives us the opportunity to contribute ourselves to the well-functioning of these foundations! The other start-up, also from Cluj, has the New York market as a target. It is about inviting visitors to say what it is they like and don’t like about this city. Another article, Software Project Management in Romania, proposes a history of local project management, where many of us, I think, will find ourselves and we will recognize those situations presented. From the technical domain, we suggest Ensuring Authorized Access to Web Resources by Using ASP. NET Identity, which presents the authentication and authorization methods for ASP.NET MVC. Managing growing data with relational databases presents a real case of processing data based on a SQL storage environment and the solution in order to achieve this at a performance as high as possible. The legal provisions regarding the ways in which you can protect your brand in case somebody registers certain web domains for the mere profit represent the topic of another article that is sure to arouse your interest. Towards the end, we invite you to read the impressions of the students from Academy+, after a year of activity.

Ovidiu Măţan

Founder of Today Software Magazine

4

no. 38/2015, www.todaysoftmag.com


Editorial Staf Editor-in-chief: Ovidiu Mățan ovidiu.matan@todaysoftmag.com

Authors list Razvan Opris

Tudor Stânean

Location Manager @Siemens Cluj-Napoca

IOS Developer @3 Pillar Global Romania

razvan.opris@siemens.com

tudor.stanean@3pillarglobal.com

Graphic designer: Dan Hădărău dan.hadarau@todaysoftmag.com Gloria Csizser

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 specialist and tehnoredactor: Ana-Maria Bivol anamaria.bivol@todaysoftmag.com

Angela Lepădatu

angela.lepadatu@cososys.com Marketing Professional @ Buy & Help

razvan.gai@iquestgroup.com Project Manager @iQuest

str. Plopilor, nr. 75/77 Cluj-Napoca, Cluj, Romania contact@todaysoftmag.com

adrian.besleaga@aiconsulting.ro Operations Manager @ A&I Consulting

George Rus

Adrian Benta

Software Developer @ Yardi România

BookKeeper @ Benta Consult

Alin Luncan

Szilárd Kacsó

George.Rus@Yardi.Com

Software Engineer @ Accesa

Made by

Today Software Solutions SRL

Marketing Specialist @ Pitech+Plus

Adrian Beșleagă

Razvan Gai

alin.luncan@accesa.eu

Printed by Daisler Print House

gloria.csiszer@pitechnologies.ro

Vlad Ardelean

vlad.ardelean@3pillarglobal.com Software Developer @ 3Pillar Global Romania

adrian@bentaconsult.ro

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

Claudia Jelea

claudia.jelea@jlaw.ro Lawyer @IP Boutique

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 | no. 38/august, 2015

5


education

BuyAndHelp.ro - a project about affiliate marketing and the wish to help

G

PEC official data says that 1 in 4 Internet users is an online shopper and in 2014 these bought products and services worth 1.1 € billion (40% growth compared to 2013). Therefore, the online shopping market in Romania is very big

Angela Lepădatu angela.lepadatu@cososys.com Marketing Professional @ Buy & Help

and continually growing. In this context, affiliate marketing has started to evolve as well. In the last few years, this concept has gained momentum and has proven to be a considerable source of revenue for all parties involved: affiliates, merchants and affiliate platforms.

What is affiliate marketing? Affiliate marketing is a form of performance-based marketing. In short, it is the process by which affiliates (also called publishers) receive percentage commissions for each lead or sale brought to merchants based on a cookie. This process is mediated by an affiliate platform, where the two parties must be approved in advance. In Romania, the most popular affiliation platforms are 2Parale and Profitshare. These paid in 2014 commissions worth over 184 million lei.

6

no. 38/2015, www.todaysoftmag.com

The emergence of BuyAndHelp.ro Combining this type of marketing with fundraising, the BuyAndHelp.ro project was born within the Innovation Labs 2015 competition, supported by Spherik Accelerator. The road from idea to reality was short. The project started from 0 in March this year and was officially launched in early June. The project quickly attracted media attention and managed to have appearances in numerous online newspapers (Gandul, Monitor Cluj or Ziarul Financiar) and in TV shows such as I Like IT (Pro TV), Recrutat in Cluj (Digi24) or TVR 1 news. Our mission is to raise donations by directing part of generated sales commissions to various social causes and NGOs such as dog shelter „Arca lui Noe” or Fundatia Comunitara Cluj, support for disabled people or coding courses. BuyAndHelp is a web platform where


education

TODAY SOFTWARE MAGAZINE

people can find a wide range of products: electronics, insurances, The platform statistics pharmaceutical, books, etc. offered by some of the largest online The website was officially launched in early June and so far stores in Romania. we have registered 178 donations with total value of 2000 lei, the highest being 79 lei. All these acquisitions and donations were The difference from a classic online store is that the payment made through more than 40 partner online stores, including is made within the integrated BuyAndHelp stores, so buyers are eMag, Elefant or Plafar. directed to them after choosing a product to be purchased. Also, the plus or the HELP part comes from the option to choose to Currently, we are hosting on the platform 11 NGOs and social what social cause the buyer wants to donate part of the product cases of the most diverse. Our users can buy and donate to orgavalue. What is very important is that the customer does not pay nizations dealing with the care and sterilization of animals, to anything extra. We receive from the merchant, for example store support programming courses from Simplon Romania or the X, a commission for bringing them a customer, and part of this Recovery Center „Un zambet cu MIRA”. The only independent commission is directed to the NGO chosen by the buyer. case we have at the moment is „HelpSmaranda” trying to raise money for the treatment of a young woman with cancer. We can best explain the entire process through a simple example. Let’s say you want to buy a new tablet that costs 1000 As future plans, we want to expand the number of partners lei, on the website of an online store (call it X). Accessing the and online stores and have as many special campaigns such as store’s website X through BuyAndHelp.ro (click on its logo) we the one we have with which Gxgia Fashion through which we will receive a commission (let’s say it is 3%). After you buy the donate 100% of the value of 9 unique dresses. We also want to tablet, the store X will transfer to BuyAndHelp.ro 3% meaning 30 create accounts that allow visitors to view their donations and to lei, and we will donate it to social cause that you support. All of develop a browser plugin that will facilitate online purchases and this without you paying more money out of your pocket. donations. Enjoy your shopping!

www.todaysoftmag.com | no. 38/august, 2015

7


management

Software Project Management in Romania

A

t the moment of writing this article - 2015 August - Romania has been classified in many pools as a notable presence in the global IT&C market. It has a strategic geographical location, knowledgeable work force with academic

Razvan Gai razvan.gai@iquestgroup.com Project Manager @ iQuest

8

no. 38/2015, www.todaysoftmag.com

support and is commonly multilingual capable. This country has had the chance to be involved in software projects for almost 20 year now, thus accumulating a vast experience in outsourcing, high-end services and even products. The question is - who’s managing all this? But before talking about Project Management, let’s briefly visit a common definition of a project i.e. „a temporary endeavor undertaken to create a unique product, service, or result”. So all these years Romania had a lot of temporary endeavors creating a product or service which may or not run in production even today. Most of these projects started as subprojects of larger global projects that found their way into a Romanian „software development house”, thus being managed by foreign experienced Project Managers that outsourced pieces of work to Romanians. So actually the management effort for these projects was not that complex to begin with, of course this changed over time.

From entrepreneurs to ... „Project Managers” Thinking about the beginnings - then who managed all this work given to the Romanians? The projects were run initially by the entrepreneurs themselves that created these small companies with small teams and common sense management. As business men, the entrepreneurs, were managing the costs and the throughput like the company itself. Some had MBAs other just natural instinct, some used MS Project, other Excel (even today a very powerful management tool btw), some had strategies and visions, others just focusing on doing a good job for a fully active reference. As demand for scalability increased and more and more software developers „joined the party”, the relatively flat management structure didn’t cope anymore with the load. So „team leaders” emerged out of the „team” and allowed the big boss to delegate management. Over time they received the title of „project managers” and projects were done around these natural born leaders. Of course, there were


TODAY SOFTWARE MAGAZINE other sources of managers joining the companies already at the management level, having acquired experience in academic environments and/or outside of the country, who very soon found their places in the upper hierarchical management layers.

One name. Multiple job descriptions & responsibilities. Why use quotes for these early Romanian „Project Managers”? Well, let’s see - because it’s all relative. Each company started to define the role as per their needs. The Project Manager’s responsibilities were limited by the management needs each company had. Of course, there should be a common denominator somewhere - from the simplistic scope-time-budget triangle, to diamonds, to pentagons of management and so on, but no Project Manager was interchangeable from one company to another, hell even within the same company weren’t and aren’t easily interchangeable. So this position of Romanian Software Project Manager had a long way (even today has) until we could clearly know end-to-end which its responsibilities and skills are. This in turn affects hiring in a way that companies that require more from a Project Manager will have a tough time getting valuable people that want to change their company. They would come from a higher role doing the same things but for less money maybe or a downgrade in the title - what some companies call Project Managers others call Line Manager or Program Managers and so on.

and certifications to grow PMs and make Project Management Offices. It’s not an easy challenge and it may be a slow and painful process, but it must be done if we want to increase the today’s frowned upon small percent of actual successful software projects. I’m personally glad to see today project managers from different companies gathering with the help of entities like Project Management Institute - Romania Chapter, holding presentations, sharing information, aligning on the responsibilities a project manager should have, the technical and soft skills a manager and a leader should possess and really building a community, I dare even to say a craft. In conclusion professional Romanian Software Project Management can be a reality, and already is happening, we just need to … never let a project fail :).

„Technical” Project Manager Grown in-house from a Senior Software Engineer is what one could call a „Technical” Project Manager. It appears that this is the preferred way these days in growing Project Managers. In theory a Project Manager from another industry could very well manage a project in the IT industry, however it would take some time to get on-board with all the specifics of the industry and one limitation of course - this project manager is not able to jump in and write code when the going gets tough and the tough get going. And maybe it shouldn’t be the case as it basically violates the very first principle of SOLID - the „single responsibility principle”. Yes, I know that’s for classes, not for people - some programmers might rant, but the philosophy remains. Specialists versus generalists - it’s good to have both of the groups in every aspect of life and profession, but have them both. „One man show” should not be the standard - manager, business analyst, architect, technical leader, guru, god-father, mentor, sales person, not that much place to squeeze all those in one person - so why not just get back to manager. Do one job and one job only and well!

IT CONFERENCE ONIT Conference on

TECHNOLOGIES. IES.

Professional Project Managers „With great power comes great responsibility” actually there is no power, only responsibility. Power can’t be given, responsibility can be given and assumed. Leaders have the power to influence the direction projects head to, but there is no named leader, only self-made. The way forward looks promising as we start to align with the skills, responsibilities, trainings

18-19.09.2015 Locatia : City Plazza https://goo.gl/6N1GKX

www.msg-systems.ro

www.todaysoftmag.com | no. 38/august, 2015

9


events

Siemens Developers Day 2015

T

echnology provides new innovations and inventions that shape the lives of everybody across the world. Digitalization is now part of our everyday life. At its core lays the work of thousands upon thousands of software developers, testers, architects, project managers, engineers and more. Software development is hardly more than several decades old, it went through major transformations from what it was twenty years ago, and in the next ten years it will be completely different again. Twenty years ago, software development was special - there was little information, not a lot of tools or development systems and it relied mostly on the creativity and inspiration of single, passionate developers with deep knowledge in theoretical concepts. As software systems and code bases expanded both in size and complexity, these often erode due to unmanaged, adhoc changes and extensions. Thus, agile processes are introduced, moving away from the classical waterfall model, every so often missing to understand their impact on large systems and overall methodology. The Siemens R&D center in ClujNapoca is deeply involved in supporting Siemens in addressing the challenges of digitalization. Having started a year ago, we have now a team of over 100 colleagues

10

active in developing and maintaining cloud-targeted DevOps environment reahigh-quality, complex enterprise applica- ched its targets within half a year. tions and delivering support services to business units within the Siemens global Evosoft is delivering many software engineering powerhouse. development projects within Siemens, addressing the Industry, Energy, and On the 6th of October, we will dedicate Healthcare areas. Within the last five a special event for software developers: the years, even large-scale projects have first edition of Siemens Developers Day. adopted agile methods like Scrum and Throughout this event, we will provide real continuous integration. But the develife information about some challenges in lopment of cloud applications goes one the IT field, combined with engaging and step further: continuous delivery and fun activities for all participants. This continuous deployment are prerequisievent will be open to developers familiar tes to leveraging the full potential of the with enterprise software development. cloud environment. On our way towards a cloud-targeted DevOps environment, With speakers from evosoft GmbH our colleagues introduced a combination and Microsoft, we will explore the challen- of test-driven pair programming and conges faced while evolving one organization tinuous delivery. Our colleague, Korn茅l towards a DevOps culture by the example Molit贸risz, will share the experiences and of Visual Studio Online and we will dis- lessons learned from this unconventional cover if an unconventional initiative of a initiative.

no. 38/august, 2015 | www.todaysoftmag.com


TODAY SOFTWARE MAGAZINE Attending our event would help you learn about the transformation of an organization – from a classic Waterfall approach towards a DevOps model, with three-week sprints and deployment into a cloud service with six worldwide scale units and more than two million users. Christian Binder, ALM Architect at Microsoft, will outline the agile transformation of the Microsoft Developer Division towards a DevOps culture by the example of Visual Studio Online. In his talk, he will provide revealing insights into how the Developer Division is working today. If you are interested in attending this event, keep an eye on the Siemens Romania Facebook page at http://fb.com/ SiemensRomania. Subscribers of TSM will also receive more information regarding this event.

About the speakers Kornél Molitórisz is an expert in software development and software architecture at evosoft in Budapest. He graduated from the Technical University of Budapest in 2000 and has been working for evosoft since 2003. He has participated in a variety of complex projects, mostly connected with industrial automation, railway automation and healthcare. He is a member of the Expert Office since 2011. His main topics of interest include cloud computing and the technical and methodological aspects of software development in cloud-based approaches. Christian Binder is an ALM Architect at the Microsoft Developer Experience

Group (DX). He joined Microsoft in 1999 and has been working closely with the Visual Studio Product Development Group in Redmond since 2006. He specializes in VS ALM platforms and ALM trends, such as backlog-driven organizations, Lean Teams, Cloud Cadence as well as Build–Measure–Learn. His focus is on implementing these concepts for customers, including internal adaptations for large organizations.

About Siemens Romania Siemens celebrates this year 110 years since its first office was established in Romania. While being a major contributor to the technical and economic development of the country, Siemens is determined to play a major role in Romania’s future development. With more than 1600 employees in 10 cities all over Romania, Siemens SRL is one of the biggest engineering companies in Romania. The company is present in ClujNapoca with two locations. The second headquarter in Cluj-Napoca, inaugurated this year in collaboration with the company’s affiliate evosoft, is a regional research and development center that handles internal IT projects for Siemens, as well as software development projects for applications that are part of the company’s portfolio.

About evosoft GmbH Evosoft GmbH is a fully owned affiliate company of Siemens AG. As an international systems house headquartered in Nuremberg, Germany, evosoft has been developing custom software and IT solutions for customers within Siemens AG since 1995. With roughly 1,400 employees at sites in Germany, Hungary, Romania and Turkey, evosoft supports the entire process associated with this line of business – from consulting through design, startup and training to operating.

Razvan Opris

razvan.opris@siemens.com Location Manager @ Siemens Cluj-Napoca

www.todaysoftmag.com | no. 38/august, 2015

11


programming

Web Resources Access Protection Using ASP.NET Identity

I

n the era of mobility and interconnected smart devices, there are cases when the access to information should be restricted for non-authenticated entities. The aim of this article is to provide high-level details about ways of authentication and authorization for software developers that are using ASP.NET platform, especially ASP. NET MVC. In the following lines, I will talk about the ASP.NET Identity infrastructure. George Rus

George.Rus@Yardi.Com Software Developer @ Yardi România

12

no. 38/2015, www.todaysoftmag.com

I will walk you through the main featu- data persistence. These two concepts are res of the framework, and show you how decoupled, offering developers the opporthis system may be customized in order to tunity to plug-in various storage providers. serve different scenarios. By default, the persistence mechanism is implemented based on the Entity What is ASP.NET Identity? Framework Code First concept. In order In order to answer this question, to store data, a set of tables should be as authors of [1] explain, one may say that generated: the idea behind this framework would be • a table that will store the registered a solution that will provide: user information – user id, user name, • a unique authentication and authomaybe a hashed password; rization mechanism with persistence • another one representing roles – control, easy to extend and unit test, may be interpreted as authorization also providing OWIN middleware, groups; in order to be used for any specific • claims table – set of information that application(web, mobile, cloud); may identify a user; • role and claim based authorization; • logins table – representing data from • plugin-able infrastructure for diffeexternal authentication providers such rent log in providers, such as Microsoft, as Microsoft, Facebook, Google, Twitter, Google, Facebook, Twitter, etc; etc; • facilitates Azure Active Directory integration. The main parts of the framework consist of: Architecture Overview • Microsoft.AspNet.Identity.Core – Out of the box, the ASP.NET Identity users, stores and managers logic; framework provides a working members• M i c r o s o f t . A s p N e t . I d e n t i t y. hip solution. From a high-level point of EntityFramework – EF persistence speview, the architecture of the framework is cific implementation; based on the following aspects: managers, • Microsoft.AspNet.Identity.Owin – that who are responsible for the inforOWIN middleware specific business mation processing/handling, and stores, logic for the identity framework. which represent the implementation of the


programming The following diagram illustrates the architectural components of the framework:

TODAY SOFTWARE MAGAZINE There are a set of stores derived from IUserStore: • IUserClaimStore - stores user specific claims; • IUserEmailStore - stores email; • IUserLockoutStore - access failures and lockout status; • IUserLoginStore - maps users to login providers: Google, Facebook, Twitter, Microsoft; • IUserPasswordStore - stores the password hash for a user; • IUserPhoneNumberStore – stores phone number; • IUserRoleStore - maps users to their roles; • IUserSecurityStampStore - stores security stamp; • IQueryableUserStore - exposes IQueryable users.

On top of the stores we have the managers. They are responsible for the orchestration of the changes, respectively: Taking into consideration the core part of the fra• UserManager – exposes functionality that will save changes mework, the following diagram presents the abstractions of the to user store, user and store concepts: • RoleManager - provides logic for saving the changes related to the role store. Figure 1. ASP.NET Identity Components

In case the Entity Framework does not suit for your project, there are some custom storage providers already written, that support: • MySQL; • Azure Table Storage; • ElasticSearch; • CouchDB / Cloudant; • MongoDB; • NHibernate; • RavenDB; • Redis. If these providers are just not the ones that you need, there is the possibility to write your own. In order to do that, you have to take into consideration, at least, the following: Figure 2. ASP.NET Identity Core Abstractions • data source to be used, • data that have to be stored: user information, user claims, Observing the core structure, we may observe that the base user logins and roles; entities are the IUser and IRole, which are utilized in stores, • store classes: user store, user claim store, user logins store, IUserStore – user management, respectively IRoleStore – role user role store; management. • data access layer that will operate with store classes.

www.todaysoftmag.com | no. 38/august, 2015

13


programming Web Resources Access Protection Using ASP.NET Identity External Authentication There are some scenarios when the application that is being developed needs to offer the possibility of authentication by another source, not only the traditional membership where the user information is maintained into a local database. In this case, the developers may use the built-in support for external provider implementation. There are two standards for authentication that allow users to utilize their accounts from trusted providers. These are OAuth and OpenId. By some experts, the OAuth protocol was built mainly for authorization, but there are a lot of cases when it is used for authentication. The good thing about these standards is that a lot of the providers offer implementation for them, saving the users from the registration process for different applications. When using external providers first of all we have to ensure that the Authentication of the project is set to Individual User Accounts. Connecting to authentication providers like Google, Microsoft, Facebook, etc it is very important to set-up the connection to SSL, and it is a very good practice to keep using https after the login, in order not to transfer sensitive data in cleartext. When developing applications using ASP.NET MVC, the RequireHttps attribute can be used for enforcing all requests to use https and the Authorize attribute in order to specify the access restriction. Another approach will be to create a filter that will enforce all the requests to be over https. Configuring RequireHttps and Authorize for the entire application is considered as a security best practice. Enabling sites to use external login when developing applications using ASP.NET MVC 5 is done through App_Start\ Startup.Auth.cs where the authorization providers are configured. Depending on the protocol implemented, OAuth or OpenID, the provider will request a registration process or not, in order to provide authentication data. Due to the fact that ASP.NET Identity has built OWIN middleware the configuration of external provider is very easy to do regardless the protocol implemented by the provider. The following listing presents the App_Start\Startup.Auth.cs with the OWIN configuration in place: public partial class Startup { // For more information on configuring // authentication, please visit // http://go.microsoft.com/fwlink/?LinkId=301864 public void ConfigureAuth(IAppBuilder app) { // Configure the db context and user manager // to use a single instance per request app.CreatePerOwinContext( ApplicationDbContext.Create); app.CreatePerOwinContext<ApplicationUserManager> (ApplicationUserManager.Create); // Enable the application to use a cookie to store // information for the signed in user app.UseCookieAuthentication( new CookieAuthenticationOptions { AuthenticationType = DefaultAuthenticationTypes. ApplicationCookie, LoginPath = new PathString(“/Account/Login”), Provider = new CookieAuthenticationProvider { OnValidateIdentity = SecurityStampValidator. OnValidateIdentity<ApplicationUserManager, ApplicationUser>( validateInterval: TimeSpan.FromMinutes(5), regenerateIdentity: (manager, user) => user.

14

no. 38/august, 2015 | www.todaysoftmag.com

} });

GenerateUserIdentityAsync(manager))

// Use a cookie to temporarily store information // about a user logging in with a third party // login provider app.UseExternalSignInCookie( DefaultAuthenticationTypes.ExternalCookie); // Uncomment the following lines to enable logging // in with third party login providers //app.UseMicrosoftAccountAuthentication( // clientId: “”, // clientSecret: “”); //app.UseTwitterAuthentication( // consumerKey: “”, // consumerSecret: “”); //app.UseFacebookAuthentication( // appId: “”, // appSecret: “”); //app.UseGoogleAuthentication(); } }

After the registration process with the authentication provider is done, the next step will be to use the Startup.Auth.cs and to configure the application to use that provider. Note that storing sensitive data in code or config files is a security issue and this approach must be avoided. How to secure web applications for different threats and attacks is not the subject of the present article.

Conclusion The main goal of this article was to present how ASP.NET Identity framework features may be used in order to control access to certain areas of your application. In the first part of the article I talked about the general features of the framework, followed by some specific details on how the ASP.NET Identity framework can aid developers who need to add membership functionality to their applications. The second part of the article offers information about the framework’s architecture giving additional details about its abstract components, and also, providing information about what custom storage providers are already written and what aspects should be considered when there is a need to write a custom one. The final part, contains information related about the plug-in and configuration of an external authentication provider. Considering the main features and the possibilities of extending and customizing the framework, the ASP.NET Identity should be considered when the development of an application using .NET technologies implies adding membership functionality.

Bibliography 1 . h t t p : / / w w w. a s p . n e t / i d e n t i t y / o v e r v i e w / g e t t i n g - s t a r t e d / introduction-to-aspnet-identity 2. https://msdn.microsoft.com/en-us/magazine/dn605872.aspx 3 . ht t p : / / w w w. a s p. n e t / i d e nt i t y / o v e r v i e w / e x t e n s i b i l i t y / o v e rview-of-custom-storage-providers-for-aspnet-identity 4.http://odetocode.com/blogs/scott/archive/2013/11/25/asp-net-core-identity.aspx 5.http://www.asp.net/mvc/overview/security/create-an-aspnet-mvc5-app-with-facebook-and-google-oauth2-and-openid-sign-on 6 . h t t p : / / w w w. a s p . n e t / i d e n t i t y / o v e r v i e w / g e t t i n g - s t a r t e d / aspnet-identity-recommended-resources


TODAY SOFTWARE MAGAZINE

IT Communities

T

he events of this period are organized and carried out by some people who are passionate about technologies and their teams. As you can see in the calendar, they are exclusively published on meetup.com and facbook.com, having an audience formed of the local communities.

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

Calendar August 26 (Cluj) Launch of issue 38 of Today Software Magazine www.todaysoftmag.ro August 27 (Oradea) Launch of issue 37 of Today Software Magazine www.todaysoftmag.ro August 29 (Cluj) Lansare Kogaion and Argent Linux OS România eventbrite.com/e/cluj-napoca-lansare-kogaion-si-argentlinux-os-romania-tickets-18251932020 September 3 (Cluj) Drupal Cluj Meetup meetup.com/Drupal-Cluj/events/223672594/ September 17 (Cluj) JavaScript Cluj Meetup meetup.com/JavaScript-Cluj/events/222421552/ September 24-27 (Harghita Băi) Tabăra de testare - Autumn Camp 2015 facebook.com/events/487498068085911/ October 1 (Cluj) Using Protractor and Appium to automate Hybrid apps meetup.com/Cluj-JS/events/224608770/ November 24-25 IT Days (Cluj) A treia ediție a Cluj IT Days itdays.ro

Tabăra de testare Testers community from IT industry with monthly meetings Website: www.tabaradetestare.ro Since: 15.01.2012/Members: 1243/ Events: 107

www.todaysoftmag.com | no. 38/august, 2015

15


programming

Managing growing data with relational databases

I

remember about two years ago one of our clients saying that as it was the main requirement for a new software application. Those words haunted me for a while, I could not understood why he would phrase it like that. An application crash was bad enough but loosing data was out of this world; I was trying to visualize the kind

Alin Luncan

alin.luncan@accesa.eu Software Engineer @ Accesa

16

no. 38/2015, www.todaysoftmag.com

of complexity that made them ask for this particular requirement. I was failing to see the big picture but I learned it. In the past two years and a half I learned that for this client data is everything. Nothing beats data: not UI, not the way data is stored, not even usability. That is because the application collects data used in scientific models from different devices (sensors) and software services (image processing) which is in turn passed to a mathematical model that evaluates the data resulting in even more data that again is re-processed and combined with other sensors readings and inputs that are all re-evaluated in other models that are displayed as charts or grids. But it does not end there: the user has the possibility to filter out bad inputs from any level, which makes the mathematical models re-evaluate. Yes! For this software, data is the entire application; everything else is meaningless if the data is corrupt or unreachable. It took me a while to understand the main requirement in its full form but finally I was there with a full overview of the entire data hierarchy. And we did it. About a year ago, we got to a point in the development that all the data the previous application collected and crashed was saved and stored in our relational database (SQL Server 2012). It was reusable and you could export/import the data between different computers

thought a fast and smart service integrated into the application. We designed together with the client a recursive structure that could handle all future requests, sensors and mathematical models with small changes. It was stable and scalable and we were doing it while still using an Object Relationship Mapping tool (ORM) for the Data Layer. For the data collecting process, it was necessary for us to design several tables of configuration of the sensors and of the process itself: the number of used sensors, environmental constancies and data unit of measurement. The configurations and the actual values of the data are evaluated through a mathematical model in order to obtain a first set of results. The mathematical model is represented by a simple table that is related to the initial configurations of the sensors, one’s own configurations in order to determine the units of measurement and the name of the results it displays, but also a real connection to each result it displays (data output), as there is a logical level in the code that applies the actual mathematical formulas. The output of a mathematical model can serve as an input point for another one, thus creating a parent – child relationship between the models. There is also the possibility that a collected data set be used by several models. All these relations between the models and the outputs are determined by


TODAY SOFTWARE MAGAZINE

the user’s action, as he has the possibility to filter the data collected for a single model or evaluation results for another one. For our data base, this meant adding multiple connection tables in order to be able to determine which data are selected from a set and creating columns in some tables, to indicate the parent of the models, if it exists.

design gave us the flexibility to perform complicated queries from all levels and filter our bad sensor readings and reevaluate our data at every level of the hierarchy be it on the vertical or horizontal scale. I for one was glad we used a relational database and did not fall into the trap of using a NoSQL design on such structured data. But something broke. At the beginning of this year we started The design was working and holding. We handled every new to notice that a particular requirement was producing a big chunk requirement into our structures while still holding the original of low level Evaluation Data. As it turned out, one type of device planned relationships between the tables. The relational database had a requirement to collect and store multiple sensor readings

www.todaysoftmag.com | no. 38/august, 2015

17


programming Managing growing data with relational databases

with a rate of 20 readings per second. That would mean in an hour we would have to do 72000 readings from about 7 sensors, process each record with the mathematical model and store those values. After some math regarding the size of the object for one sensor reading that ends up in the database, we figured out that it will amount to 2 kilobyte of data. So we did some more math: 2 kilobytes x 72000 reading x 7 sensors= 1.008 Gigabyte

That is 1GB of disk size just to hold the data from 7 sensors for one hour. How much more memory was needed to take the objects from the Data Layer to the Presentation Layer so the user could have a full representation of the collected data? Things where not looking good. Handling the problem! The first thing was to double check that the requirement was real (collecting data for one hour at a sampling rate of 20 reading per second). Unfortunately this was a valid use case and furthermore to aggravate the problem the client was getting frustrated with the loading speed. Reading so much data and creating the Business Logic objects for it was taking much more time and memory than just copying data from the disk into memory. We needed a new way to properly handle our relational data so we could achieve a performance as close to the disk read time as possible. We checked how the ORM and other similar tools performed at loading all the data and assembling the hierarchy as described by the database and by the Business Logic. To sum things up the short answer was as expected: badly. We did everything you could imagine with the ORM to the point of using multiple instances to load the data separately per objects, we stopped tracking of the entities states but again and again it was far from the performance we were expected to deliver. The picture was

18

no. 38/august, 2015 | www.todaysoftmag.com

clear: do not rely on ORM tools to build and load complex hierarchies. That was the point when we realized we needed to find a way to express the complexity of the hierarchy as it goes both horizontally (siblings) and vertically (parents, children) into a single table so we could get the entities and their relationship with a single simple query and with one pass of this table, the Business Logic objects and their representation could be correctly loaded. We created a table that would hold the mapping for each type of object in the database tables and also store the level of depth for them; that way we covered both sibling and parent relationships. This table (Model Nodes) basically allows us to extract all entries from the data base that have a connection to a mathematical model. Each configuration, each preceding model, each sensor reading, each output of the model has an entry in this table. • ID Model – represents the Id of the mathematical model • NodeType – points towards what we are relating (configuration, results, sensor reading) • Node Id – shows the Id of the object we are relating to • Parent Id – indicates the parent of the node By reading each line of this table, we can create our own index in the memory for a


TODAY SOFTWARE MAGAZINE mathematical model based on which, from each table indicated by the NodeType, we can upload only the relevant data. Suppose we have two mathematical models: M1 and M2. The first model, M1, is based on the data read by sensors S1 and S2 and produces the output results M1R1, M1R2 and M1R3. The second model, M2, gets M1R1 and M1R3 as input and produces the result M2R1. The user wants to delete from this computation only the data influenced by sensor S1, and for this it is enough to unselect it from the interface. Normally, this operation would mean developing a complex query starting from the IDs of the mathematical models, of the sensors and of the outputs. All values from S1 that were used to determine M1R1 and M1R3 are extracted and M2R1 is reevaluated. However, if we use the hierarchy table, we will already have all the necessary IDs in the memory, connected both to M1 and M2:

allows it, filtering out bad sensor reading values will update the aggregated value which in turn can cause the reevaluation of the Mathematical Models. A pattern has emerged and we can draw our conclusion: the database can be split in two types of relations: schema and logical ones. Schema relations are the ones that make your life easy, described by the table schemas, loading this type of data is straightforward and scalable. Logical relations, on the other hand, are the ones that cause problems. Applying complex logic in queries leads to slow performance and huge memory consumptions. This is where you have to optimize and find a way to map those relationships to the database as a schema relationship. Let the database work for you.

All we have to do is read the values from the corresponding tables of the data base, reevaluate the model and update the hierarchy table if necessary. This table can be built in two ways: either by generating it through a script or at the moment of creating new logical entities in the application, an entry is automatically generated and the given example is only one of the multiple scenarios where indexing these logical connections in the memory can save running time on the data base server. To understand why this table solves the complexity of our growing data in relational databases, we need to understand the objects behind it. Relational databases do not have a performance issue with reading flat structured data, but when the Data Layer starts assembling business objects it created complex queries that have high running times and a high memory impact. This table creates a flat description of a hierarchy and any information we need regarding the logical relationships between the objects will be available inside it. All the data needed to describe the logic relationships between the Business Logic objects can be done by running a single query in memory. Just by adding the additional table in our database, we were able to read and assemble objects as fast as the disk allows it from the database at a cost of 40 bytes * 72000 reads * 7 sensors (20 MB) for 1GB of raw data. Looking into the future. This got me thinking how our data will look in the future, how much the application can actually handle this way. Is there something more we can do to optimize it? To answer this question we have again to turn to our database. If the data permits it, we can have aggregated values that could easily fit in the hierarchy table; we could load those values and use them in further filtering and calculation and if the math www.todaysoftmag.com | no. 38/august, 2015

19


programming

To be or not to be an object: On the problem of self reference

T

he self reference (an object’s way to refer to itself) seems to be handled very differently across object oriented languages. While in static java-like languages the this keyword is magic, straightforward and mostly unused, in Javascript the magic can be confusing. Yet again in Python some would describe it as “redundantly explicit”. In another dynamic language, Ruby, the self acts very similarly to Java’s this, but methods aren’t objects there either. Is this variety of behaviors due to random design decisions, or is there some common pattern in all these OO languages? I’d like to propose a thought experiment. We’re going to try and create an OO language that has some comfortable features from the languages above. While creating this language, we’re going to encounter some situations which will hopefully make it very clear why the self reference is handled so differently. Also, we’ll see how the self reference fits in with other features of our favorite languages. The language we’re creating is going to be a statically typed language, but we’ll allow dynamic replacement of all members if they maintain the static contract. In other words, just like we could change an integer attribute’s value from 4 to 5, we can redefine what methods do, at runtime, as long as the signature (formal parameter names, types, return type, etc.) stays the same. This gives us all the compile type safety we need, but does allow for some black magic if we really want to. We’ll also have functions, because we sometimes like those, and they will be objects. To add some spice, we’ll make methods first class citizens and objects too, since we’d like to pass those as arguments (observer pattern with just a callback). There will be no visibility modifiers, those are irrelevant to this argument: everything’s public. If any confusion arises over the word ‘object’, let’s keep it simple: objects are instances of classes. In more detail, objects have a special relation with another entity, which describes (at least in part) the behavior and structure of the given object.

20

Let me sum it up: • static typing • objects are instances of classes • classes have methods • classes, methods and functions are objects • methods and functions can get replaced at runtime Let’s see it, right? Here’s our first class, appropriately named First. class First {

}

int x Constructor(int x){ this.x = x } int double_the_fun(){ return 2 * x }

This should seem familiar to those working in Java-inspired languages. We defined a class with one data attribute that’s going to be an integer value, and we set its value in the constructor. We also have a method that returns this attribute’s value multiplied by 2. Already in this simple example we needed a way to reference the object’s attribute (at least) from inside its constructor. Why was it necessary? Because we are shadowing the attribute x with the formal parameter of the same name. Therefore here, the self reference is used to access a scope that’s the bag of attributes of the object. I promised free functions, so here’s one: int triple_the_fun(int x){ return 3 * x }

I also promised methods could be dynamically replaced, so if we just forgot for one second all that OOP has taught us, we’d do this:

no. 38/august, 2015 | www.todaysoftmag.com

First.double_the_fun = triple_ the_fun

We have treated the method double_ the_fun just like we’d treat a simple data attribute (integer for example). A little weird for some of us, I know. We could conceivably call this new method like this var my_instance = new First(3) my_instance.double_the_fun(3) ar returna 9

#

Works, right? Nothing seems off except for the fact that maybe we’d have liked for the new method, double_the_fun to use the value of x that’s already stored on the object. We’d like my_instance.double_the_fun() to return 9 without passing an integer, or doing ugly things like my_instance. double_the_fun(my_instance.x).

The next move I’ll try to do will make all hell break loose, so it’s important: What if we had put the this keyword inside the definition of the original function triple_the_fun? Well we promised static typing at least for what’s visible before runtime. Ei bine, am promis scriere statică cel puțin pentru ceea ce este vizibil înainte de perioada de rulare. int triple_the_fun(){ return 3 * this.x }

So what’s wrong with this function now? It turns out that in any language, and especially in statically typed ones like ours, this is nasty, if not right out impossible to actually do, because we promised that functions are also objects. Being objects, means they also have a class, let’s say the Function class, which also has attribu-


TODAY SOFTWARE MAGAZINE tes and methods. So would the this keyword refer to members defined in the Function, or in the First class? Let’s try to fix this ambiguity, and propose some alternative resolutions: 1. Accept that this refers to 2 inheritance chains. Imagine we had subclassed both classes: Function and also First (chain 1: Function subclasses ->...-> Function and chain 2: First subclasses ->...-> First). We’ll just get the this.x attribute from wherever it appears (giving priority to one of these scopes). The problem here is that if the attribute is found in both scopes, we’ve just lost a way to get one of them. The Java-like explicit syntax First.this.x vs Function.this.x can’t help us too much because when the function is not set as a method all the code in it must be valid before runtime too (and First.this.x wouldn’t). Also, the type of the x attribute might differ for its definition in the Function versus the First class, so the code would either break when using the object as a function or as a method. Accepting 2 inheritance chains might work better in dynamic languages, but still ambiguity is harder to debug. No language that I know of does this. 2. Accept that this situation happens and introduce 2 magic keywords. Let’s have the keywords caller and this. The this keyword would point to the Function class and the caller would point to the First class. The caller could be null, since functions could become bound, and methods unbound at runtime. This is not that nice to do in statically typed languages, because caller could take any type, and we’d have to check for its type and cast it before usage. It is however

doable, but I don’t know any language that does this either. 3. Just choose one of those scopes and forget about the other one. It turns out that Javascript does something very similar to this. As many might know, in Javascript, this always refers to the scope of its caller object (or the global window object), not that of the original object where the function was defined as an attribute. C#’s delegates, and Ruby’s Procs and lambdas go the other way. They always remain bound to the class they were defined in (also delegate instances aren’t real objects, so this could never refer to any delegate methods/ attributes. Ruby procs and lambdas are real objects, but they are created in such a way as to never refer to themselves with the magical self). 4. Drop the magic of this. Make it just a regular parameter, and also, call it whatever you like. As some might know, Python does this. This solution is inconvenient to some because every method and function that is intended to be used as method, must accept an additional argument. 5. Make the situation impossible by not allowing methods to be objects. This is what Java, C#, Scala (statically typed languages), but also Ruby (dynamic) do. Although all these languages try to go 1 step further with lambdas (Java), delegates and lambdas (C#), native functions (Scala), procs and lambdas (Ruby) these constructs are all distinctly different from regular objects, and have no way to refer to themselves. I hope it’s a little clearer now how all these languages tried to solve the same problem, and simply came up with different solutions.

Before finishing, I’d like to bring up one more interesting problem: nested definitions. What happens when a class is defined inside a method, that’s defined inside a function, that’s defined inside a method and so on? The magic of the self reference begins to fade away in situations like this, since we’d need some additional, more complex syntax to access any enclosing scopes. Java has the ClassName.this.attribute syntax, and other languages might have something similar, but that only partially solves the problem. Ultimately however, the complexity of the scope nesting makes the usage of a magical self reference hard. At that point, the solutions for trying to access the enclosing objects (like the known var that = this; in Javascript) come to resemble Python’s very explicit verbosity. Any reference to enclosing objects will be handled explicitly in situations like this. Perhaps it is not by coincidence that Python is such a reflexive language then. Paying the price of verbosity, it models a lot more things as objects, without worrying about the self reference at all. In conclusion, I wanted to show that the diversity of the implementations is not a purely random or exotic choice, but was influenced by a genuine problem. This limits the decision about what can be modeled as an object in an OO language, and how scopes are referred to. Also, I don’t want to endorse any particular language’s way of implementing OOP, as I’m sure the problem constraints will make all implementations have both pros and cons.

Vlad Ardelean

vlad.ardelean@3pillarglobal.com Software Developer @ 3Pillar Global Romania

www.todaysoftmag.com | no. 38/august, 2015

21


startups

I Love I Hate NY

I

Love I Hate NY is an iOS application dedicated to each individual that has visited, plans to visit or they simply live in New York City. The iOS app represents the best and fastest mode of getting a quick feedback over New York City in a matter of seconds taking into account the score that is made between the positive and negative feedback comments added by several users of the application.

Tudor Stănean

tudor.stanean@3pillarglobal.com IOS developer @3 Pillar Global

Each user will always have the possibility numbers of the two types of messages and to have a clear view over the “pulse” of the the user can see the result in “real time”. city by closely watching the score. Each user will be able to see his feedback in the “All” messages category, or in any of the applied filters. Also, the feedback message will be right away available as a possible result in the search section, if applicable for the certain search criteria.

Brief Description of Main Features

Figure 1: App Icon

The motivation behind the idea comes from observing the users’ desires to express their feedback and their personal opinion regarding a certain domain, in our case New York City and, in the same time, taking into consideration the user’s implication in a competitive game by scoring the positive and negative feedback messages. The score consists of comparing the

22

no. 38/2015, www.todaysoftmag.com

Each user has the possibility to add a feedback message depending on the experience that he had regarding the city of New York: positive or negative; also, if the user is just a potential visitor of the city, he has the opportunity to see the “pulse” of New York City by comparing the positive and negative feedback messages. The screen of adding new feedback comments, available to all app’s users, contains both a “love smiley face” or a “hate smiley face”, depending on the type of message the user wants to add. This will be illustrated in the images below:


programare

TODAY SOFTWARE MAGAZINE The main screen of the application displays all the messages according to the history rules selected by a certain user and the animations between the two smiley faces depending on the available balance between the positive and negative feedback messages.

Figure 2: Main Screen

It can be observed in the image above that the positive smiley face has pushed the negative one towards right because the number of positive messages is higher than the number of negative ones, the score being displayed directly

Users have the option of sharing their experience expressed in feedback messages by pressing the “Share” button. By pressing the “Post” button, their message is written on the server side and to the user. all other users will be able to see it and read it as well. For adding a positive comment, the user will press the “Love” For a better outline of the competition game between positive button and it will be introduced in a new screen for adding the and negative feedback, several animations will take place between certain feedback comment, being displayed the “love smiley face”, the two types of smiley faces. It is a simple and funny game that in the same manner, if a certain user wants to display a negative the user is able to control by giving his own contribution by sha- feedback, it will press the “Hate” button, being displayed in the ring his experience. The smiley faces will change their position same screen, but with the “hate smiley face”. regarding the new balance resulted by registering and taking into account new added messages, either positive and negative. Users can access any of the displayed feedback comments by clicking on them and they will be brought to a secondary detailed Users can filter between the existing feedback messages, by a screen where the title message and its text body will be displacertain period of time, three options being available for filtering yed. From this screen, the user can post his/her own message by the messages after the time they were added: clicking the “Post” button. • All” – this option will display all available feedback messages, positive or negative, no matter the time they were added • “Last 24h” – only feedback messages that were introduced in the last 24 hours will be displayed with this option. This is a suitable feature to be used by travelers that prefer the citybreaks travelling mode, this way they would have a quick and current state of the city • „Last Month” – as it’s name suggests, this option will display feedback messages that were added in the last month

Each time a new comment is added, several animations between the two smiley faces will be displayed depending of the nature of the introduced comment. If the feedback is a positive one, the “hate smiley face” will get on fire and it will be pushed further to the right by the “love smiley face”, otherwise the animation will take place in the opposite direction by the “love smiley face” bursting into fire if a negative feedback is added.

www.todaysoftmag.com | no. 38/august, 2015

23


startups I Love I Hate NY Overview Diagram

Figure 4: Overview Diagram

Parse Framework In order to facilitate the communication between the objects of the application and their equivalent in the objects saved on Parse servers, the ParseManager class was implemented to maintain the communication with Parse servers. Because of the limited types accepted by the Parse platforms, the saved objects’ properties must be reduced to these kinds of types in order to be saved and then converted back when they are read from the server, because of this, the architecture of the application must be developed along with the implementation of the project. All Feedback Objects and Trending Seach Objects have their equivalent in the project data base and both Parse servers under Figure 3: Main Screen with Flame Animation the format of PFObjects (Parse Framework Objects) as in the defined model of the application, this being refreshed at several Besides the presented features, each user has the option of seconds, so that users will always have the latest content. Using a searching by key words, using the search feature. In case he has timer, the data is always refreshed maintaining the displayed data no clue about what key word he should search, a certain list of valid, this way the user will always have the latest data displayed. trending searches will display other searches performed by other users. The implemented communication model facilitates the scalability of the project, new types of objects being introduced easily, Brief Technical Details but also a better performance in terms of response time. The I Love I Hate NY iOS App is slightly different than other apps implementing the classic design pattern of “client-server”, Other features of Parse platform are: the used mechanism implies migrating the processing of data • Data Storage to the client side and the server will be used only for storing • Local Data Storage (offline mode) data, this way the result is a successful combination between the • Cloud Computing “peer-to-peer” based on a network of intelligent clients capable of • Push Notifications Services processing and editing data followed by saving the certain data • Facebook Login on server by conforming to the “client-server” design pattern. • Twitter Login • Parse Analytics For the implementation of this mechanism, the iOS Parse framework was used for storing and writing feedback messages data Software Design Details to servers being available for developers by the Parse platform. For a better performance and an improvement in terms of usability, all animations are managed by an AnimationManager. This approach of project development and the idea of migra- It listens to all events sent by user and manages the animations ting of a certain part of the business logic from server to client, played on the main screen. may be very useful to startup companies because it offers a better solution in terms of managing the financial resources. Parse serAll implemented animations were used using autolayout feavers can be configured and used with ease by mobile developers ture available in iOS SDK, this way the animations are less time decreasing the need of having more backend developers for addi- consuming and they have a better accuracy than the approach tional servers setup and data management. This offers a more of implementing the same animations by modifying the frame positive perspective over the project velocity and the financial property of each view. resources that will be used for the project implementation.

24

no. 38/august, 2015 | www.todaysoftmag.com


programare The fire type animation, applied to each of the two smiley faces was implemented using the CAEmitterLayer class, this making the addition of a particle emitter to be added to a subview all because CAEmitterLayer is a subclass of CALayer and a sublayer with the role of a particle emitter is added to an UIView object very easily. Implementing the particle emitter using the CAEmitterLayer has avoided adding the CoCos2D library in the project, which would have affected the performance in a negative way. Because of this, all iOS graphic features were used at maximum and a certain level of high performance in terms of execution time and used memory were reached. The implemented class described in the previous section, ParseManager realizes the entire communication with Parse servers, feedback objects download, Trending Search objects type reset from server and also sends notifications among the app when all objects were loaded from server, this way the integrity and validity of received data is assured.

TODAY SOFTWARE MAGAZINE Future Development “I Love I Hate” represents a concept that can be applied to any domain of interest for a certain mass of users. The iOS app “I Love I Hate NY” represents a proof of concept of this idea. We have taken into consideration the implementation of the same concept over other cities that offer travel potential and also other domains of interest. Other features are taken into consideration: • Reply to a certain feedback • Push notifications • Share through more social platforms and by mail • Location of a certain feedback • Offline mode • Login Feature

The share feature was implemented using the Framework available in iOS SDK, avoiding the use of Facebook Framework, which as explained above would impact the memory of the project in a negative manner, this way the share feature reaches a maximum performance in response and execution time.

www.todaysoftmag.com | no. 38/august, 2015

25


education

ACADEMY+PLUS Students in Internships and Junior Positions

I

n ACADEMY+PLUS, one can get after passing an online test and going through a difficult selection – the 28 days Pool. The first academic year started in November 2014 and the first generation is now in the compulsory stage of internship. The flexibility of the program means also the fact that this stage can be done anytime, according to the results obtained in the academy projects. Thus, due to the achieved performances, the Academy students have started internships and they have even got employed in IT companies.

Gloria Csizser

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

Thirteen of them fill in positions in the offices of PITECH+PLUS, in the same building as the headquarters of the academy. The story of each one of them is different. The have come to work on different positions, therefore we have decided to make their evolution known, in order for you to see what the ACADEMY+PLUS (A+) experience can mean after going through only a few steps.

How can you get into the academy? Depending on the age of each of them and their professions, every candidate had their own motivation for following this academy and they found out about its existence from different sources. Each Pool is based on a diversity that helps students’ formation. The different backgrounds, different levels of experience and ages are important factors, which contribute to their manifold development. The presentations in high-school made Paul and Luca curious. They were in the 12th grade, they knew they wanted to go to the faculty of informatics; they were admitted to UBB and applied also to the Academy. Thus, they spent the last holiday month in the Pool.

26

no. 38/2015, www.todaysoftmag.com

“Initially, I thought it was too good to be true. They presented a platform of exercises and games to us. And it was also free! After three days in the Pool, I wanted to quit, because it wasn’t easy at all”, said Luca. The same happened in Vlad’s case, in Targu Mures. The A+ staff also went to high-schools from other cities, to present the program. “I wanted to go to university in Cluj, anyway. The Academy was a bonus. I entered Polytechnics and I graduated from the Pool in August.” “Our teacher recommended that we go, and, as there were several of us, we all tried. In the pool, we pushed one another, we motivated each other”, admits Marius, who chose to follow the courses of FSEGA, Economical Informatics. Andrei found out about it from a link on Facebook, while he was on holiday. “Once I got back home, I took the tests; I passed them and got into the third pool. It was the best decision I could have taken. It was October, the first month of the last year in faculty. With the medical engineering, I didn’t have very large perspectives, and I have always been attracted by IT. ACADEMY+PLUS seemed a good opportunity to get into this domain.”


TODAY SOFTWARE MAGAZINE

Alina graduated from the music highschool and didn’t want to go to a faculty. She wanted an unconventional form of studies. “I knew about School 42 from France, I had discovered it on the internet and I began looking for something similar. That’s how I came across A+. I didn’t want to take the tests, I thought I wouldn’t pass them, but still I tried.” The Academy was promoted during the period of the BAC exams, in the high-schools which had informatics as one of the final exam subjects. “They caught me right after I got out from the exam. There were some girls in geeky messages T-shirts, who told me about A+. I took the tests and got into the pool.” – remembers Daniel, laughing.

THE POOL 28 intense days of daily exercises, weekly exams, individual or group projects – tough deadlines, strict scores. For Gabi, who wanted to come to the academy in order to change his profession, it was a real challenge. He had studied Installation and he had an 8 hours job. For three years, he had been trying to learn programming, taking online courses, but these “cannot be compared to what is happening in the academy, where there is a different motivation, you have colleagues who help you, whom you can ask for advice.” “It was …wow, it was difficult. I would leave from work and stay until 11 or 12. In the morning, I would start it all over again, job, academy, and this was for 28 days”, Gabi confesses with a smile. Ligia

was also an employee, but she knew she wasn’t going to remain in the domain, as she wanted more. “After I got my Master’s Degree, I took up programming again, in order to remember what I had learned in high-school. I was looking for a job and I would have liked to try IT. I graduated from Constructions Engineering and I found a job in the domain. But I saw a TV show about A+ and I took the tests. The pool was a difficult period. Job, pool, job, pool. But it was all worth it. I got a job offer starting from May and I am glad to work for PITECH+PLUS.” For Andrei, it was “The best diet for losing weight, but especially the best educating regime. I learned how to see things differently, time got new dimensions, organized was the key word in order to be

www.todaysoftmag.com | no. 38/august, 2015

27


education ACADEMY+PLUS Students in Internships and Junior Positions

able to do as much as you can in one day. Several such days turn into habit.” It was a little difficult for him, too, but he proved you can be studying Polytechnics in the last year, in a profile that has nothing to do with Informatics, pass all your exams and get your diploma, pass the pool and follow the academy.

The subjects studied in the pool Concerning what they have each learned in the pool, theoretically and practically, they have all agreed that they have studied exactly what they needed. C is the base, and the projects they had to finish formed their way of thinking. Once the algorithm understood and settled, the logical thinking is formed, and what followed after the selection projects seemed easier, no matter their level of knowledge, which was so different. “You have access to a great volume of information. What I liked most was the fact that you can structure the information as you wish, you can search more about whatever interests you, nothing is imposed on you”, says Sami. “It was the only difficult thing that I really enjoyed” – Anca admits, a little nostalgically. Student in the second year, she wanted to add something practical to the UBB Info studies, which could help her figure out the way for her to go and on which branch to search for a job. The pool taught her how to plan her time well and how to relate to deadlines, which sometimes end up being concluded in the last minute, just like in the case of school projects.

The academic year

a team in order to evolve. They all believe in the power of the community: “Even though there are big age differences, we have all got programming in common, our passion for code, and that is our bond.” – Daniel. The Academy helped Paul, Luca, Vlad and Anca during faculty to understand better and in a more practical way what they were studying in their courses, as the projects are related to both the projects from Babes, and those from Poli. “The studied subjects are complemented.” Alina didn’t find it difficult. “There were many new things and I liked the atmosphere a lot. I found many optimistic people, who believed in me.”

The things they have learned and the things they have enjoyed The four modules studied during the first year are Unix, Algorithmic, Infographics and Web. “Algorithmic and Infographics are the best. In Infographics you actually see something that gets out of your hand, you see the result of your work on the monitor”- says Sami. Marius took part also in the 3day Startup, together with colleagues from the academy and since then, with the team they formed there, he has also worked FrontEnd. “It was a web and mobile application on which the state of skiing slopes was updated through reviews and comments. I realized I like this FrontEnd part and I was glad I could already find a job, doing exactly what I like to do.”

In November, they all started the courses of the academy, When is it ok to follow these courses? where the rhythm was no longer that alert as in the pool, but the The so diverse examples make us believe that the proper level of difficulty of the projects increased, as they all admit. They moment to follow the Academy is at any time. The essential condihad more and more group projects, where they needed to form tions are, however, the motivation and passion for programming.

28

no. 38/august, 2015 | www.todaysoftmag.com


TODAY SOFTWARE MAGAZINE If you got the will, you can start at any time, no matter if you are in your last year of faculty or if you already have a job. But Paul admits that, had he still been in high-school, he may have dropped out of the Academy. But like this, in parallel with faculty, seems to him the best recipe. “The academy in itself is a lot easier than the Pool. You can do it from your home, together with school or job”, says Ligia.

Future plans Alina enjoyed all the modules they have had: “I don’t know yet what I want to do, I want to learn more. I am glad I did my internship on Sys Admin, and I am looking forward to the second year to see what will further attract me.” Neither does Vlad know what he wants yet, but the internship on mobiles has helped him get a better idea. “I would like the programming part more than the web; I am more interested in the functionality of applications.” Ligia is employed, since May, as a Business Analyst, and she is looking forward to the next year to learn other languages, too. “I think it is best to learn more languages, if I have the opportunity; this will offer me more possibilities in the future. I don’t want to know only what is requested now on the market.” Daniel would like to remain on Sys Admin, but he also wants to continue the academy. “I like it more that development; Sys Admin requires more general knowledge, you get to develop your power of analysis.” “I was mostly attracted by PHP and I ended up working on Zend. I hope to have the opportunity to study Typo3 further and, maybe, in the future, I will approach Symfony.”- says Andrei. Bogdan Herea, CEO PITECH+PLUS, founder of ACADEMY+PLUS, stated in relation to the activity of the academy in the year 2015: “Year 2015 comes with changes in respect to the platform which those who will pass the Pools this summer and those who are going to continue the 2nd year will be studying on. They will be able to choose the languages they want to learn and further reinforce. Thus, they have the opportunity to enhance their level of knowledge, but also diversify it in case they don’t know yet what it is they like. Moreover, we wish to conclude as much collaboration with the IT companies interested in getting more work force. In the academy, people are trained on the most varied technologies and they are the solution for the current demand on the IT market.” www.todaysoftmag.com | no. 38/august, 2015

29


accounting

Non-wage Benefits in 2015 under Scrutiny

G

iven that this year the main focus of tax authorities with control attributions has been the identification of additional salaryrelated or similar income, we considered as appropriate to review the main expenditures of companies, apparently in the direct benefit of employees, which may be reinterpreted as a benefit in kind and thus are liable to taxation accordingly.

In terms of taxation, any good, service or amount of money offered to employees, unless it falls within one of the exceptions expressly highlighted by the legislation in force and for which no documents have been prepared in order to be classified in the relevant category, is considered to be wages paid in kind, for which all contributions and income tax must be withheld. Likewise, in the case of partnership associates, the goods, services or amounts of money that do not fall within one of the exceptions provided by law or for which no documents have been prepared in order to be classified in the relevant category, will be considered dividends and the corresponding tax will be calculated. Furthermore, corporate tax is also due for the settlement of such personal expenses, because the amounts are non-deductible when calculating the corporate tax.

Exemptions provided by law Per diem It is the allowance granted to the personnel and only to the personnel employed, for trips over distances greater than 5 km from the town in which the company has its permanent establishment. Article 55(2)(i) of the Tax Code provides that up to 2.5 times the amount of the allowance determined for the public sector, no tax is due for statutory per diems granted to employees. Furthermore, Article 296^15 (g) of the Tax Code stipulates that,

30

in the same amount, no social contributions are due. The last version of the Tax Code does not mention these allowances among the deductible expenses, as the article was abrogated. However, in practice these are considered deductible, the most widely used article for justification being Article 21(1) of the Tax Code. The difference in the amounts granted, which exceeds the ceiling of 2.5 times the allowance determined for staff in the public sector, will be considered benefit in kind, for which contributions will be calculated and the corresponding tax will be withheld. The amount of the per diem for public sector personnel is defined by GD no. 1860/2006 regarding delegation and travel, as amended. The last amendment came into force on January 1, 2015 and raised the per diem to 17 Lei per day, which means that the deductible amount of the per diem is 42.5 Lei for the private sector. This amount applies to business trips within Romania. In the case of trips abroad, the per diem is determined individually for each country, in local currencies. This means that per diems paid to employees, that exceed the aforementioned limits, are liable to taxes and fees similar to the ones payable for wages, i.e. approximately 52%. It is to be mentioned that the law does not impose a minimum or maximum per diem; the amount is agreed between the

no. 38/august, 2015 | www.todaysoftmag.com

employer and employee.

Travel expenses With respect to travel expenses, there are several possible cases, which will be discussed in what follows. The settlement of travel expenses when the employee resides in a city different from the one of the operational working point According to Article 55(4)(f ) and Article 296^15(f) of the Tax Code, if no housing is provided or the rental expenses are not borne, these will not be treated as income from wages and no income tax or contributions will be withheld for the settlement of travel expenses to and from the workplace. The maximum limit is the equivalent of a monthly pass. For such expenses, the mandatory inclusion of certain provisions in the employment contract or collective labor agreement is not specified. If the employee receives a company car by which he/she travels on the domicile-workplace distance, there are several fiscal situations that are to be discussed punctually, depending on the presence of public transportation and the overlapping between the public transportation and the work program. If public transportation is available, the VAT on fuel is not a fully deductible expenditure and will be recorded in the vehicle refueling expenses. In order to qualify for the full deductibility


of fuel expenses, the preparation of vehicle log sheets is mandatory in order to demonstrate that the vehicle is used solely for company purposes. In the absence of vehicle log sheets, the granting of 50% deductibility is presumed both for VAT and expenditures. Lately, the fiscal authorities treat the non-deductible 50% as benefits in kind.

Transport as part of delegation Based on Article 55(4)(g) and Article 296^15(g) of the Tax Code, the coverage of travel expenses for delegations are not treated as income from wages, meaning that no taxes and contributions will be calculated in such cases. The expense is deductible for corporate tax purposes, in accordance with Article 21(2) (e) of the Tax Code. Travel expenses for employees residing in the same city as the company According to Article 55(4)(a), Article 296^15(b) and Article 21(3)(c) of the Tax Code, if it is provided in the employment contract or collective labor agreement, the settlement of transport to and from the workplace will not be construed as benefit in kind and taxes and contributions will not be withheld for these costs. The rules for Article 21 (1) of the Tax Code, also found in point 23(f) of GD no. 44/2004, with subsequent amendments, allow full deductibility. It is necessary to specify in the collective agreement that these facilities may be granted. The transport of directors for business purposes According to Article 21. (2)(e) of the Tax Code, the expenses incurred for the

transport of directors and of the persons deduct. There are two procedures for the assimilated thereto are deductible. calculation of the payable VAT, currently regulated by Article 148 and Article 149 of Settlement of fuel expenses the Tax Code. The analyses must be deveAccording to Article 145^1 (1) of the loped on a specific case. Tax Code, for vehicles that are not effectiIn this context, if the vehicle is only vely used for business purposes, only 50% partially authorized for personal purposes of the VAT on fuel used for cars that are and for a certain period, the benefit in kind not used exclusively for business purposes is calculated by determining the share of is reimbursed. The non-deductible VAT kilometers traveled for personal purposes will be recorded as fuel expenditure. from the total number of kilometers traveAccording to Article 21 (4)(t) of the Tax led during the period in question. Code, for vehicles that are not used exclusiThe equivalent value of the expenses vely for business purposes, 50% of the fuel calculated as such percentage is considered expense (the registered non-deductible to be a benefit in kind. By default, without VAT will also be taken into consideration) being expressly mentioned, we understand will be considered non-deductible. the obligation to draw up vehicle log sheets In terms of interpreting fuel as benefit even when using 50% deductibility in such in kind or anticipated dividend, the same cases, because otherwise we cannot deterrules apply as for the aforementioned tra- mine the amount of the benefit in kind. vel expenses.

Accommodation expenses

Company car Under the rules of Article 55 of the Tax Code, also found in section 77 of GD no. 44/2004, the use of the company car for the fulfillment of business duties is not considered to be salary-related income. Due to this reason, taxes and compulsory contributions will not be withheld. If the car is to be used for personal purposes, it will be considered a benefit in kind, therefore taxes and contributions will be calculated in the amount of 1.7% of its value for each month (in accordance with Article 55 (3) of the Tax Code, also found in section 75 of GD no. 44/2004). In this case, if the VAT on car purchase has been deducted, a part of this amount is due to the budget and the company will lose the integrity of its right to

Accommodation during delegations Based on Article 55 (4) ( g) and Article 296^15 ( g) of the Tax Code, the coverage of accommodation costs for delegations is not treated as a salary-related income, meaning that taxes and related contributions will not be calculated. The expenditure is deductible for corporate tax purposes, in accordance with Article 21 (2)(e), as long as the purpose of the delegation is documented (for the benefit of the business activity): visits to customers and suppliers, participation in fairs, exhibitions and trainings with subjects related to the field of activity. This approach cannot be extended to any accommodation expenses incurred by managers or employees, unless it is

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

www.todaysoftmag.com | no. 38/august, 2015

31


accounting Non-wage Benefits in 2015 under Scrutiny confirmed in the documents attached to the accommodation invoice that the trip was made for business purposes. In this case, depending on the beneficiary of the accommodation services, the expenditure will be considered a dividend if the beneficiary is the associate of the company or a benefit in kind if the trip is made by an employee. It sometimes occurs that the accommodation documents (especially the invoice) are issued in the name of the accommodated employee. In this case, the expenditure and VAT may be deductible if the trip is made for business purposes. The travel order is required to be attached to the accommodation documents according to the implementation rules for Article 146 of the Tax Code, also found in section 46 of GD no. 44/2004, with the subsequent modifications.

Health insurance / private pensions Health insurance and private pensions provided to employees are deductible from corporate tax, as long as the legal requirements are met, as follows: health insurance within a maximum amount of â‚Ź 250/year/ employee and pension benefits within a maximum amount of â‚Ź 400/year/employee (Article 21 ( 3)( j) and (k)). Health insurance should not be confused with service plans of private hospitals offering various types of packages. Health insurance must comply with the principles imposed by health law (95/2006). Also according to this law, Article 339 (i) stipulates that medical services provided as service plans are treated as prepaid medical services that are directly offered

32

to subscribers by the suppliers rather than via insurers, outside the basic health care services package of the health insurance system. Thus, this service plan, different from the usual occupational medicine agreements binding by law, must be allocated to each employee and taxed as a benefit in kind. In the case of health insurance, the income tax will be withheld, but the social contributions will not be retained. The current Tax Code does not provide the option in which the employee has his/her own insurance policy, which is then submitted to the employer for settlement, only the option in which the employer negotiates the insurance policy with the insurance company, offering it subsequently to the employee. In this case, the contract is concluded between the employer and the insurance company. Private pensions must be approved by the Financial Supervisory Authority and must be regulated according to law no. 204/2006. This category includes the pillar 3 pensions. Variants of other types of insurance, which provide that the accumulated amounts are to be paid as pension at the end of the contract, are not approved under these regulations of the Tax Code. The policies can be contracted by the employer and offered to the employees or can be contracted by the employees and submitted to the employer for settlement. For such pensions, contributions are not payable within the â‚Ź 400 limit and the amounts are deductible from the payroll taxes.

no. 38/august, 2015 | www.todaysoftmag.com

Holiday vouchers These are regulated by GEO no. 8/2009, with subsequent amendments. According to the Ordinance, holiday vouchers may be granted up to a maximum limit of 6 times the national minimum wage, for each employee per year. These expenses are deductible within the aforementioned limit and no contributions are payable as per Article 296^15 (o), but income tax is due under the rules of Article 55 section 68. Whereas until July 2014 it was required of the legal entity to obtain profit in the previous year in order to grant them, the relevant paragraph was abrogated by law no. 94/2014. Holiday vouchers may only be used in facilities approved by the National Authority for Tourism. These will have nominal values of 10, 20, 30, 40 and 50 Lei. Similarly to food vouchers and gift vouchers, no change may be granted in case of payment with vouchers. The rules for implementing the law governing holiday vouchers should be published by the beginning of August and should bring more clarification on the requirements needed to be met, such as mentioning these facilities in the collective labor agreement, inclusion in social spending, etc. Holiday voucher expenses are fully deductible from the corporate tax, without exceeding the annual sum of 6 x national minimum wage for each employee. Vouchers are subject to salary income tax for natural persons.


TODAY SOFTWARE MAGAZINE “Entertainment” expenses within the office For companies there is no legal definition of the concept of entertainment, the only regulation explaining this expenditure is given in the regulations on the taxation of registered sole traders. According to this legal basis, entertainment expenses are the representation expenses incurred by the taxpayer. In practice, in the bookkeeping of companies, this category includes water, coffee, milk, tea, fruits, sweets and other similar products with low unitary value, which are used for internal purposes. Unfortunately, these expenses are the most reinterpreted during tax audits in 2015. The legal regulations are not specific enough to make a proper classification of such treats. Furthermore, the specifics of the company should also be taken into account, such as the field of activity, number of employees, etc. There have been cases when such treats within the activity were classified as benefits in kind for which tax and contributions were calculated, although there is no concrete practical possibility of allocating such costs for each employee, due to which this approach is absolutely subjective and inequitable. We believe that by drawing up lists on coffee, milk, sugar or candy consumption (the only way to properly deal with these “benefits”), the companies will depart significantly from the proposed business objectives (profit, turnover, efficiency, productivity) and will be loaded with administrative activities involving other unnecessary costs. These types of purchases cannot be classified as entertainment expenses, as these are considered to be “entertainment expenses incurred by the granting of gifts, treats and meals to business partners, conducted for business purposes” and therefore, automatically, the relevant legislation does not apply.

Beauty & spa, access to gyms/fitness centers, etc. Ever more in recent years, employee salaries and service packages offered by multinational corporations and IT companies include, in addition to the basic salary, a number of other extra “benefits”, these being extremely important in attracting new employees or retaining existing teams. These benefits may include, but are not limited to: subscriptions to gyms, beauty centers, rental of sports fields, tickets to concerts, shows and other social events. Unfortunately, the provisions of the Tax

Code are not quite clear about such other types of “remuneration in kind” and are considered salary-related benefits and are taxed as such (income tax and social contributions). The attempt of “pimping up” these expenses from personal practices, in the direct benefit of the employee, into deductible expenses, which help optimize results, has no stable legal basis and thus would not be accepted in the context of a tax audit covering the identification of benefits in kind. In conclusion, if we also refer to the corporate tax, we consider that these are deductible in the amount of 2% from social expenditures, as long as these are generated by an individual employment contract, collective labor agreement, etc.

Other gifts (objects, clothing, food products, gift cards, etc.) However, in the Tax Code (Article 21 (3(c)) there is a 2% limit of the total payroll of the company, within which companies have the right to incur certain expenses in the benefit of employees – without these being considered salary-related. For the purpose of tax optimization decisions, we recommend the detailed analysis of the possibilities offered by these provisions in order to exploit them in certain permissible situations. Thus, the category of social expenditure also includes gifts offered to underage children on the occasion of Easter, Christmas and June 1, within an upper limit of RON 150, as well as gifts offered to female employees on the occasion of March 8. Amounts falling within the aforementioned limit are tax deductible and no tax (Article 55 (4(a)) or social contributions (Article 296^15 (b)) are due. Amounts exceeding the RON 150 /person limit, as well as their granting on any other occasion than those prescribed by law are considered benefits in kind and will be taxed accordingly and the related contributions will be withheld. These expenses are tax deductible on the basis of Article 21 (3(c), within an upper limit of 2% of the payroll. If the offered gifts are below the RON 150 limit and if these are offered on other occasions than those mentioned or to persons other than those provided, these will be considered benefits in kind and will be taxable and social contributions will be withheld. Moreover, if the 2% payroll limit is exceeded, even if wage contributions and taxes are withheld, the expenditure will be non-deductible for the company. Although the expression used by the

law is “the granting of goods in cash or in kind”, this category exempt from income tax does not include gift vouchers, which are subject to another tax treatment.

Gift vouchers According to Article 2 of law no. 193/2006 regarding gift vouchers, gift vouchers may be granted internally as social expenditures. Being listed in this category, gift voucher expenditures will be deductible from the corporate tax within an upper limit of 2% of the payroll. According to Article 55 (3)(h) of the Tax Code, an income tax rate of 16% is withheld for such vouchers, but, according to Article 296^15 (o) of the Tax Code, social contributions are not due. By interpreting this regulatory basis, namely social security exemption granted by law, we believe that no social contributions are due for gift vouchers, even if such expenses exceed the 2% limit for social expenses when calculating the corporate tax. In our argumentation we would like to underline that these gift vouchers are given according to the law regarding gift vouchers, which involves their purchase only from authorized facilities and these may only be used in predefined formats, with all requirements met. Social contributions would be due for these gift vouchers if these were purchased from unauthorized facilities or were granted to employees in a manner other than that provided for by the law. The collective labor agreement should specify the conditions under which the vouchers can be offered to employees. It is indicated that the events on which these vouchers are granted have an occasional nature.

Grants for funeral, birth, serious and incurable illness According to Article 55. (4)(a) and Article 296^15 (b), no taxes and contributions are withheld for such grants. If these fall into the 2% payroll limit, they are considered tax deductible. Otherwise, even if taxes and contributions were withheld, these will be recorded as non-deductible.

Team building, festive meals, other outings or events organized Depending on the purpose of such events, these can be classified in terms of deductibility or withholding. Thus, if we are talking about an event that is aimed at employee training and improvement in relation to the activity performed, then the related costs will be

www.todaysoftmag.com | no. 38/august, 2015

33


accounting Non-wage Benefits in 2015 under Scrutiny deductible and no income tax or social contributions are to be withheld (Article 21 (2)(h), Article 55 (4)(n) and Article 296^15 (3)(k)). In order to be included in this category, documentation is to be submitted for supporting the purpose indicated. It is advisable to prepare a dossier on the team building activity, which needs to include the agenda of the event, the list of participants for each training or program activity. It would also be appropriate to have a holistic approach to the objectives pursued, i.e. management decision on the opportunity of incurring such expenses in the light of the results to be obtained. After the conclusion of the event or subsequently, after an estimated period, the results obtained can be evaluated via participants’ feedback sheets and the factual findings of the persons responsible (Department of Human Resources, team managers, project

34

managers, etc.). If vocational training is not the goal of such events, then these events will be considered benefits in kind, thus social contributions and tax aliquot is due for each participating employee. Fiscal risk reduction can be obtained by concretely indicating the participants to these events, existing clients or potential collaborators of the company (as far as possible) in terms of suppliers or possible beneficiaries.

no. 38/august, 2015 | www.todaysoftmag.com

Adrian BeČ™leagă

adrian.besleaga@aiconsulting.ro Operations Manager @ A&I Consulting

Adrian Benta

adrian@bentaconsult.ro BookKeeper @ Benta Consult


management

When it hurts, we go to the doctor

W

hen it comes to our health and well-being, we call in a specialist. And we usually want the best one around, whose advice and treatment we’re careful to follow. We don’t trust what we read over the internet, or tell the doctor how to operate, right? In the end, it comes down to protecting our health. But do we do the same when our company is concerned? Szilárd Kacsó

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

It hurts, but we refuse the recommended treatment It hurts. We know it does: we don’t have the team we’d wish for, results are not the ones expected, or the team isn’t as consolidated at it should be. And it hurts. The health of our organisation is dwindling, and we’re thinking to fix this by organising a team-building. Surely we can treat ourselves, right? We can take care of organising it internally because all in all it’s not that hard. Employees should feel good, have fun, play some paintball, do some bungee jumping, and in the end they’ll start socializing on their own. We invest some time, resources, and money into this „treatment”, in the end only to notice that we’re not seeing any of the desired effects. Maybe because the administered „treatment” wasn’t the right one?

The fact that socializing can have a major impact on the performance of a team is not a new fact. Informal events contribute to the release of stress and worries after a prolonged period of intense work, to the development of interpersonal relations, to the celebrating of success and achievements, to offering a motivational impulse. But these get-togethers can’t substitute real team building activities. Team building programs play different roles and have different objectives. „Team building” is a „treatment” through which a group of people is provoked to work together effectively, as a team, with the help of several events and activities meant to increase motivation and promote cooperation. These activities, facilitated by specialized trainers, increase team performance and help fulfil specific organizational objectives.

www.todaysoftmag.com | no. 38/august, 2015

35


management When it hurts, we go to the doctor What should the administered „treatment” focus on? If we’ve come to realize that it’s in our organization’s best interest to call in a „doctor”, it’s also recommended to follow-up on the prescribed treatment. Even if some stages of the team building program may not seem that important to us, we should stick to them nonetheless in order to reach the end goals. What are the elements of a team building which we should not shy away from? 1. Clearly defined objectives, in tune with organizational objectives. 2. Personalized activities, adapted to the program, group, or specific situation objectives that the participants or team are confronted with. 3. Knowledge transfer: in order for participants to apply what they’ve discovered during the teambuilding, a quality debriefing is necessary. 4. An evaluation report for the team building program: structured observation which can be the basis for a needs assessment intended to help create follow-up activities/programs. 5. A follow-up program: scientific studies [1] as well as personal experience indicate that follow-up programs (trainings, coaching, organizational development) can insure the effectiveness of team building activities and a long term increase in performance. 6. ,,Special elements’’, which offer a unique experience to participants, help achieve objectives, and facilitate learning: the team building’s theme, the game mechanics (gamification), the party themes, etc.

How can the correctly administered „treatment” help us? If we call in a specialist and carefully follow his recommendations, such treatments can help our organizational health by: • Increasing team cohesion • Developing new ways of effectively working in a team • Developing leadership skills • Developing team problem solving skills • Facilitating conflict management and resolution with the team • Improving team communication • Improving the trust level between team members • Realizing what needs and problems still need to be addressed (via follow-up programs)

36

no. 38/august, 2015 | www.todaysoftmag.com

• Offering a motivational impulse In conclusion, if we notice several things lacking or which can be improved within our organization, it is preferable to call in a professional and not shy away from getting only the best in service quality. In the end, if it hurts, we ought to go to a doctor instead of treating ourselves, right?

(1)- Tannenbaum, Beard, Salas: Chapter 5 Team Building and its Influence on Team Effectiveness: an Examination of Conceptual and Empirical Developments


management

The Online Battle: Brand versus Internet Domain

I Claudia Jelea

claudia.jelea@jlaw.ro Lawyer @IP Boutique

f you are wondering what the relevance of this subject in the IT domain is, here are three aspects that are worth thinking about: • The brand strategy in cyberspace should be on the agenda of any company that wants to develop in the digital era. • Most businesses in the IT domain “lead their life” mostly in the digital world – therefore, they should be interested in how they can use their domain names and brands on the Internet. • Changes happen quickly on the global level, and companies must adjust to them. For instance, nowadays, we are witnessing an unprecedented expansion of domain names – the new gTLDs (generic top-level domain names). In the near future, domains such as .tech, .software, .technology, .game, .SRL, .online, .web, .site or .website will be very common, representing a great risk of conflict for the companies that are active in IT and online.

Thus, it is prudent that you be infor- the disputes between brands and domain med regarding certain risks and protection names will most probably increase expomechanisms. nentially and they will be more and more complex.

Why are there conflicts between brands and domain names?

Conflicts emerge, mainly, because of the risk of confusion among clients. Even though domain names are, just like brands, registered on the principle “the first to arrive, the first to be served”, they do not offer the same level of protection as brands do. Actually, most of the times, it is considered that the rights of the owner of a brand can be affected if somebody else registers an Internet domain name which contains a name that is similar or identical to that brand. There are cases, not few, when – if you are not sufficiently active in the online environment – you might find out that your brand is already being used in somebody else’s domain name. This “somebody else” may be a cybersquatter (who registers in ill-faith some domain names containing registered or notorious brands, with the purpose of re-selling them afterwards, to an advantageous price) or even a business man who, in good faith, sells products or renders services (that may be in competition or not). Until recently, “the battle” was generally on the .ro and .com extensions. But in the context of the emergence of the new gTLDs, which I have mentioned above,

What can be done? If you are the owner of a registered brand and you care about its unicity and exclusivity, you will surely want to prevent another person from using an Internet domain that reflects your brand, especially if the respective domain can be your competition or if it hinders you from extending your activity in another geographical area. If you have monitored it and you have found out there is such a domain, try – as a first step – to contact the person who had registered it and take it over, in an amiable way. It is important to point out persuasively the rights on which you are basing your request. If you do not succeed in this first step, you can move on to a formal stage. Usually, the procedure depends on the type of the extension (.ro, .eu, .com, new gTLD, etc.) – you can either opt for an arbitration or mediation procedure (for instance through WIPO Arbitration and Mediation Centre1) or for an action in the court of law (which may consume more resources). However, in these cases, if you want your rights to be properly protected, our recommendation is to turn to specialized legal advice. 1 www.wipo.int/amc/en/domains

www.todaysoftmag.com | no. 38/august, 2015

37


management The Online Battle: Brand versus Internet Domain For example, one of my clients, a Romanian IT company, owns both a national brand, as well as a community one – reflected in the respective domains .ro and .com. Planning to extend its activity to Great Britain, the client wished to also register the corresponding domain .co.uk, but found out that it was already registered by a British citizen. The domain was inactive. My client appealed to the mediation procedure offered by Nominet UK (the British correspondent of ROTLD) and, following the reasons we invoked, he quickly and amiably obtained the transfer of the domain, in exchange of a price reasonably negotiated. If you have registered a domain which includes a name that is identical or similar to another person’s brand, the strategy depends also on the actual manner in which you use the respective domain. It can usually be to your advantage if you have or not a legitimate interest in using it – for instance, on that web domain, you have developed in good-faith a service or product that you offer your clients, etc., if you have previous rights on that name (for example, your own brand or the name of your own company), etc. Therefore, in case you have received a notification from the part of the owner of a brand, who requests (in a threatening manner or not) the transfer of the domain, one of the first things you should do is turn to an expert to analyze your situation and evaluate the chances you have in order to be able to keep the domain. Remember the fact that the situation is always analyzed from case to case, and the analysis is not always simple. Do not make the mistake of giving up your domain immediately, before getting a specialized opinion; you might be surprised to find that you (too) may be entitled to it. A few months ago, a client from the online area, asked me to check a name he wanted to use in his new domain. Before contacting me, he had received a formal notification from a company in Germany which owned a community brand (thus, protected inclusively in Romania) and demanded the immediate transfer of the domain. The client got scared and accepted the transfer, opting for a re-branding and the pertaining costs, without asking for an expert’s opinion. Understandably, in the case of the new domain name he registered, he was diligent and looked for help. But, unfortunately, he also found out that he had a strong case to keep the initial domain he had given up.

A few words on the new gTLDs Concerning the new gTLDs, you can find here2 an infographic drawn by the Internet Corporation for Assigned Names and Numbers (ICANN3) regarding the manner in which owners can protect their brands in the online environment, following the “revolution” of the new domain names (for example, by registering in the Trademark Clearinghouse). Trademark Clearinghouse is a centralized database (made available by ICANN and managed by Deloitte and IBM), where owners can choose to include their brand during the Sunrise period and register the pertaining domains. The brands, after being validated, have priority to the registration of the new gTLDs, and the owners of the brands are notify when a third party is trying to register a new gTLD that includes the respective brand, thus, avoiding the unpleasant situations when they have to fight in order to regain the respective domain. You can check the status of any new gTLD by accessing this link4. And if you wish to find out more details about the .tech domain, you can view this presentation5. In conclusion, who gets to win in the conflict between brands and domain names? I would dare say that, in general, the winner is the owner who is best informed and who better knows his rights and knows how to use them to his own advantage. I would say that, in the future, the new domain names will generate rather serious problems for the owners of brands. The companies, including those in the IT industry, which are offering services and products available in several geographical areas, must adapt to the new picture created by the interference between brands and domain names and focus more on their legal strategy in the online environment. But it is important to remember also that there are always options to solve the conflictual situations resulted from using the brands and the domain names. It’s up to you to choose the one that is most appropriate to the actual situation you are dealing with, and this thing is possible only if you are well informed or correctly advised on time. 2 newgtlds.icann.org/en/announcements-and-media/infographics/tm-protection 3 www.icann.org 4 http://www.trademark-clearinghouse.com/gtld-calendar 5 http://www.trademark-clearinghouse.com/sites/default/files/files/downloads/150617_ webinar_tech.pdf

38

no. 38/august, 2015 | www.todaysoftmag.com


Test your abilities

programez.ro

Coming soon


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.