25 February 2010

My presentation of the fourth MSCOmmunity Istra


Last Tuesday I presented at the fourth Microsoft Community Istra meeting in Pula at the Student MMC club. I was the sole presenter due to the fact that my colleague Hrvoje couldn't make it.
I presented on the topic of UML. The presentation consisted of a short introdcution to UML, its origins and uses and then I covered the basics of Class, Package, Activity and Sequence diagrams.
I think the presentation went rather well. I wasn't nervous, the crowd was developers mostly and the ambient suited me just fine (dark, dunk walls, underground bar on the back and you female students searching for a higher insight in life, back room poker and a whole day on going LAN party in the next room).

12 February 2010

IT Showoff Zagreb

Winter came to Istra. Once again the snow fell and the cold came. In Labin, where I work at six a.m. the temperature was bellow zero. And today is the day I'm travelling to Zagreb to the IT showoff conference.
I took the company car, my trusted GPS, a two cd podcast collection and on I went. In Rijeka I picked my colleague and friend Hrvoje Hudoletnjak, who will sit on the evening panel “Web framework show down” at the conference.
And today we went.
As the trip progressed the temperature got progressively worse. Bellow zero, bellow five – oh my god please do not look at the thermometer. The snow, let me tell you about the snow. The highway was deep covered in it. On some parts only one way was opened on each side. The snow was stacked up taller then me, and I’m tall.
But, thanks to my superb driving skills and to a little bit of help from the window unfreezing spray we made it to FER where the conference is being held.
Luck was still on our side. We found a free parking space really fast and really close to the university.
A small part of the university was reserved for the conference. When Hrvoje and I arrived there we where greeted by a long waiting line of people waiting to be registered.
The registration proceeded pretty smoothly. The conference boast with pretty looking hostesses ( a bit sexist , but you know) and it proved true. The girls were pretty and competent and Hrvoje and I were registered quickly.
I got a cd, a pool and a conference program. Well, so much for smack. But it is a free conference. I’m not going to complain.
The conference is organized in two university auditoriums and a hall. The hall is where to social aspect of the conference is being held. Lost of drinks and pretzels are served there as nourishment which is cool.
Of the two tracks I attended the right , “development” track. And I was astounded by the quality of content and presenters. They were really good, fun, instructive and furthermore they freely gave promotional t-shirts to those who asked questions, which in three instances was me.
Yep, I won three t-shirts which of course I will give to my beautiful wife. She is already an Ubuntu user. She looks really nice in geek-wear.

30 January 2010

After all is done, the enemy comes to pick the honored fallen bodies

This week I presented on the two events announced on my previous post. Both were real amazing and great opportunity for me to meet new people and practice my presenting skills (which really needed practice).
The first was the MS Community meeting held on the 26th of January in the Konoba “Idila” in Rakovi near Baderna. For those of you who aren’t from these parts a “konoba” is a local tavern type. If you ever played Dungeons and Dragons or watched a fantasy movie it is the place where the shady old man gives you the quest of your life time (or week in case of my gaming group back at college). It was a real nice place. Cold, dark and mysterious where the mysteries of the Windows XP mode of Windows 7 and the arts of Unit-testing were explained in a dark , dunk room, lit only by the ancient fire place in the center of the dining, drinking, area. The walls were of made of hand chipped stones, rugged and hard, cold from the outside winter.
A place was cleared for us. Twenty chairs, a table and a presentation pod. The ceiling was short, wooden planks running back and forth. I was afraid I was going to hurt my head. I’m tall you see. But no such issues were encountered.
Viktor Ezgeta, presented first on the Windows XP mode in Windows 7. He started first with several slides showing the basics of the Windows XP mode and then continued on a live presentation. Viktor is a fun presenter to have, and it showed in this presentation also. I think everyone got the point there. No missing content for Viktor.






I continued next with my habitual “Unit-Testing: A grease monkey introduction” presentation. It took me longer than agreed but no one objected (well my wife number one had several well meaning objections on my presentational style, which isn’t unusual given her background in journalism and her current work as a researcher in communicology). It went well. I first presented on unit-testing theory and then I showed how unit-testing is done in practice with NUnit.



Afterwards it was the social hour of the evening. We all gathered around an old wooden table, really nice, really cool and rustic and the food was served. Fuži with wild animal meat, and njoki with lambs meat. Of course I got my vegetarian meal which was really nice and animal friendly.
The food was good and so was the talk. As a result me and my colleague Hrvoje Hudoletnjak will present on the next Microsoft user community meeting which will be held in Pula on the 23rd of February 2010.
The second event I present on was the recruitment run held by Novatec New Technologies ( the company I work for) and Systec Automation (the parent company I work for ) in Osijek at the Faculty of Electrical Engineering as part of our new campaign of opening Novatec and Systec offices in Osijek. I presented with a colleague. He covered the Systec side of the presentation and I covered Novatec and the recruitment process.
The presentation was held in the new faculty campus which previously was one of the Osijek’s military bases. The base itself is very ominous, during the opening days of the last war the enemy held the base and opened fire on the city from there and the city hospital which is just on the other side of the street.
It is nice to see such a building disbanded from military use and converted to something which will benefit so many people.
The presentation hall was full with students. Some had to event stand, such was the interest. We really got their attention, so I’m sure many will apply for the position.
Osijek is wonderful city. It was my first time there. I have some friends living there, but haven’t had the time to meet with them. I took a short walk through the city the first night I was there and was impressed with its architecture, the Drava river and parks. The people are really nice and friendly, and didn’t hesitate with instructions where to go when I asked them to. I would really like to go back there and see more of the city, its museums, its bars and theaters (well I am the guy who listens to baroque music when programming, really no surprises there).
In short, I think , both events were a real success and I really hope to present some more in the near future.

22 January 2010

Events, events, events

Well, its conference time in Croatia this time of year. First , there was the second Web User Group meeting a Microsoft Croatia which I attended with two of my colleagues . You can watch the live stream here . It was the first WebUG meeting I attended and I was dazzled by the quality of organization , the presentation and the amount of benefits I got just by attending there (lower cost for attending several local conferences and of course the lower early entry cost for the Developer Bootcamp).
The presentation which I attended was titled “User experience on the web” by Vibor Cipan of FatDUX. The presentation was interesting, educational and all in all a good experience for me.
The pizza afterwards was great too.
There are two events I plan, wish to attend to. The first is the IT Show off conference which will be held on the 12th of February this year in Zagreb which is a free one day developer conference and the second is the above mentioned Developers Bootcamp.
I will held two presentations next week. The first will be held on Friday 29th of January at the Osijek Faculty of Electrical Engineering where I will present the company I work at Novatec New Technologies and our software engineering process. Attendance is of course free.
The second will be held on Tuesday 26th of January in the Tavern Idila in Rakovac near Baderna. I will be the second presenter. The first will be Viktor Ezgeta with “Windows XP mod of Windows 7”. I will present my usual introduction to unit –testing presentation. It will cover the basic unit-testing theory and practice by showing how to use NUnit for unit-testing .NET applications.
For the grand finale, I’m announcing my to WinDays 2010 presentation proposals:

  • F# : an introduction and,

  • Domain – driven design in .NET with Visual Studio 2010 modeling projects.


I hope one of the two is taken.

22 December 2009

14. SQL & Developers Users Group meeting in Rijeka

I've recently held a presentation on the 14. SQL & Developers Users Group meeting in Rijeka on the 10th of December 2009 on the topic of unit testing.
Due to the fact that I was the only presenter I had the opportunity to present two talks, one on the theoretical side of unit testing and the other on more practical approaches.
Both talks were successful. The attendees were a mixed bag of old hands and newbees wanting to learn about the topic and art of unit testing. The crowd was small, but that suited me fine since we could talk and explore topics of interests freely.
It was an interesting event for me. I learned a lot about presenting, a skill I have yet to master fully and the attendees later told me that they learned a lot from it which was as good a praise as I needed.

29 October 2009

Code Documentation

Code documentation is the application documentation written directly in the source code of the application. Code documentation is used to document the application API in order to increase developer code understanding and discoverability, to reduce the time needed to implement a particular feature using prebuild components and to decrease the defect rate of defects caused by the lack of proper component understanding.

Code documentation is written before each package, class, property and method name in the source code using a specific syntax which makes use of automatic code documentation tools possible. The syntax for code documentation varies from language to language. It is well supported in most IDEs for most of the mainstream development languages.

There are two distinct benefits when using code documentation with automatic tooling support.

First for IDEs that support code completion (intellisense in Visual Studio) the IDE will automatically parse the code documentation of the piece of the code the developer is currently writing and it will present it to the developer as she is typing the code , this informing him of the intended use of the component being used.

Second tools exist that can create a proper API documentation from the source code of an application using code documentation and the basic language syntax as tools. The documentation thus generated is much easier to grok than fumbling in the IDE with code completion and random file opening and reading. Once again tools exists for that , e.g. Sandcastle,Phpdocumentator, Pydoc,Javadoc and etc. the list goes on and on.

A problem most developers I've encuntered have is that they do not know what to write in the code documentation, even when they have written the component them selves.

When I write my code documentation I use the following model for each component memeber I document (class, property, method, package etc...).

Each documetation item is composed of two elements: THE WHAT and THE HOW. Of the two THE HOW is optional since in some cases it is not needed.

This is best shown by an example



/// <summary>
/// THE WHAT : MovieService is a service provider for using basic CRUD operation on the Movie object permanent repository storage(e.g. database )
/// </summary>
///
/// <example>
/// An instance of the MovieService object is created with its static Create method which will connect the object instance to the proper system Movie repository.
///
/// MovieService movieService=MovieService.Create();
/// IEnumerable<Movie> movies= movieService.Select();
/// </example>
public class MovieService
{
/// <summary>
/// THE WHAT: Creates a basic instance of the MovieService object. It does not however intialize the required repository connection for the Movie object.
/// </summary>
private MovieService {}

///<summary> THE WHAT: Creates a basic instance of the MovieService object and intializes the required repository connections for the Movie object.</summary>
/// <returns> Working MovieService intance</returns>
public static MovieService Create{return new MovieService();}

/// <summary> THE WHAT: Returns a collection of all Movie objects in the Movie object repostitors.</summary>
/// <returns>IEnumerable<Movie> collection </returns>
public IEnumerable<Movie> Select() {return new List<Movie>();}
}



The THE WHAT ant the THE HOW texts int he previous example are just for the example sake, in real life documentation endeavors they are not needed, and should not be used.

07 October 2009

Arhitecture of a thick web application



A thick web application is a application composed of two parts , one is the server which generates HTML , CSS , Javascript and other elements and sends them over a network using the HTTP protocol towards clients who render the received content on the user machine in the form of an interactive user interface, where all the programming elements are tightly bounded in a single application element residing on the server.
Nowadays thick web applications are not the hip thing to do. Everybody is doing service oriented applications or rich internet applications or even cloud oriented applications. Distributed systems are the in of the moment. Thick applications are seen as antiquated, not performing solutions, unable to cope with the requirements expected from modern systems both in the performance/scalability and the maintainability/coolness sides of things.
Everyone forgets that a few years ago every application was a thick application, and that everybody started their careers learning and writing those types of applications. Of course there are still viable cases for such applications to be developed.
First, they are simpler to understand, develop, deploy and maintain. Secondly they can be developed much cheaper and faster than their distributed counterparts due to the lesser numbers of different parts which need to interact and be set up in order to deploy and maintain the thick system in respect to the distributed one.
I’ve actively developed user experience enhanced (web 2.0) applications both in PHP and ASP.NET (with a side note in Django and Google App Engine for a short time) and I’ve found that the following general application architectures is very suitable for developing thick web applications.
The architecture is composed of the following elements (from the front to the back):
Client side modules (screen). This is the top most tier of the application. Here is what is actually sent and executed to the client. Due to the fact how the majority of web application frameworks are organized here we talk about client side code which drives the behavior of a specific module(screen). In lesser respect we talk also about images, video, flash, HTML, and CSS code.
Client side components. This tier is composed of general client side components (once again we talk here mostly about javascript elements – objects and functions) used once or more in one or more client side modules. A client side component is used only for data carrying and data transformation purposes. The required input is provided by the client side code on the each module, and resolution of the task assigned to the client side component is decided by the client side module using the component. Each component must be simple as possible and must do one thing, and one thing only.
Server side modules (screen). This the first server side tier. This tier has two important tasks: first it must generate client side elements sent to the client in response to their request, and the other it must make use of the services provided by the service tier and the API provided by the Domain tier objects returned by the called services in order to compose them in a viable user task. A user task is a set of operations (a workflow) u user must do on the module (screen) in order to achieve a quantifiable business objective.
This tier is where is decided what service (or services and their interactions) must be used in response to a users operation and what message must be sent back to the user in response. This tier must “know” everything that it needs to know about the business problems it tries to solve to successfully communicate with the user.
Server side components. Server side components are composed of reusable elements (classes, functions, widgets or other similar elements) used one or more times in one or more modules. Each component must be used for data carrying or data transformation, it must rely for its required input on the server side module using it and must not decide what to do with its output , which is left to do for the module making use of the component.
Services. This the first tier on the middle tier side. How it is separated from the other middle tiers is not important. What is important how it is used and how it is structured. Regardless of the programming implementation (functional or object oriented) the Service tier must provide a set of stateless, not dependent services each providing an atomic operation. Services must be grouped together by the business task their can perform when used together, but must not make assumptions about the order they are called or the way messages are sent back and forward between the user and the application.
Services must concern themselves with their required input and expected output. If an error condition occurs (invalid parameter etc) the service must raise and exception (or similar message carrying ) construct which will provide technical data to the front end about the error condition occurred. It must not, however, return a full fledged user message.
Domain This tier is tasked with the modeling of the business domain the application is working on. The domain tier is composed from entities, value objects, events and repositories each interacting with each other in the same manner they interact in the business system used by the application. In order to find out more about the Domain tier please read the excellent book written by Eric Evans Domain Driven Design .
This tier is used by both the server side modules and the services. The services will work with input and output parameters taken from the domain tier, and the server side modules will use them to carry out their associated business tasks.
Infrastructure. This tier is used only by the service tier since it provides low level support for interacting with the underlying system, database, other application services and etc. If you need to open and read a file, or send an e-mail message use this tier. What to do with the read data from the file, or what to put in the e-mail message is the job of the server side and services tiers.
Database. The database, or the backend, is the final tier of our typical thick web application architecture. The database is used for permanent data storage, data storage manipulation, querying and fast retrieval. Only one thing is important regarding the implementation of the database: under no condition put a line of application logic in it, no matter how fast or simple it seems to be. It almost always is a bad decision, which will lead to lower system operation visibility and a nightmare of maintenance problems. Just don’t do it. Really.
How to tie all of this together. It’s both simple and terribly complex. What I’ve found out works best is to first design the domain of the application, then translate it into a data model and data transformation procedures. Secondly to define all the business task which must be carried by a user, group them in related modules and break each task into atomic operations which will be actually written as services using the domain tier of input/output.
When writing services I use the following technique: first I ask my self what questions as the user interface I have in order to successfully complete the business task, and then what operations I must perform in order to do it. As the last thing I define the input and output messages for each task/operation.
The infrastructure tier must be made low level as possible. Really low level stuff. The question I ask my self is what I need from the system (world) around me as the services and what I want to be present but also to forget it ever exists. The answer to both question goes into the infrastructure tier.