Showing posts with label Software Engineering. Show all posts
Showing posts with label Software Engineering. Show all posts

01 January 2014

The emotional health of a software system

 

The eternal truth to software development is its inability to produce any meaningful systems without a coordinated effort from a diverse team of individuals, lots of disparate activities ranging from design to development and quality assurance and finally with the same effort applied to the maintenance and operations of a running system. From the deployment of patches and extensions, to the cleanup and data hygiene of databases to the scaling of the system and hardware and software maintenance efforts.

As much time and effort is spent in the art of software development, often not much effort is spent during the operations phase of a software project.

A rule I’ve often observed in many many projects I’ve been part off is the linear degradation in the effort of maintaining all the scaffolding and activities which are not directly related to coding of a software project. Thus enabled entropy degrades the product and seeps into its operations lifecycle resulting in emotional and business drawbacks for both the organization and the stakeholders included in the project.

Should we accept this? Should we accept a system of development with diminishing software engineering efforts , should we accept the fallibility of people to care and work at top quartile engineering capacity?

I’ve seen that any significant software system, shop and development environment needs guardians in the form of an engineering educated project manager and a strong cadre of technical leaders which have the authority and will to enact and drive and force a strong commitment to all software engineering scaffolding practices which combat the intrinsic entropy found in all human endeavors, especially software development with its heavy intellectual burden, high abstract concepts and emotional stresses.

A common image of software developers is of introverted emotionally challenged people. Truth be told I’ve worked with quite a few of them in my time. Thus a surprising aspect of our live is the emotional toll software development takes from each of us which is directly linked to the quality of work we do and the state of the system.

Human emotions, feelings and states directly transfer to the work we do. The pain of working with  highly abstract concepts, what in truth software development is, is the primary source of all the bad decisions, all the accumulated technical depts., all unsolved problems and defects a system has.

In order to ensure a proper functioning of a system and a team special need needs to be put in and placed under constant guardianship in order to focus on emotional and mental health of the team working under such adverse, but normal conditions.

20 September 2013

On the life

 

As software engineers our life are subject to forces which are not entirely in our control. The chief are health, family and politics. I will start from the latter and go the former, discussing how a software engineer can mitigate some of their ill effects on her life and career.

Politics is the art of the achievable, of getting things done. I’ve listened to an audio book version of the ‘Prince"’ by my namesake Nicollo Machiavelli. While some may disagree with its context or rebuff it in its entirety on moral grounds alone, I generally find its context true and suitable to any endeavor where you have a hierarchy of people working in environment with limited resources, or any environment where you can find humans. The truth is that in the base of the human nature lies the instinct of self preservation, which is often achieved and perceived to originate from ones advancement above her station in respect to the domination and control her peers. When working in any organization there will always be personal goals, issues, treats originating from people working around you, above you and bellow you.

‘I just want to do my work, and be done”, some may say. And you are obviously right in that life philosophy, but given the fact that out there are people who will benefit by inflicting or just by you incurring a loss of some kind. Thus a wise person should strive to position him self in a prepared state, watchful about what is going on around him, about the goals and positions of the people in his circle. He should align him self with the people who have ambitions in alignment with his own, make useful and not a threat to people above his station and respected and not an obvious impediment to people bellow his station. A wise person would also be aware that each state is only temporary and thus not permanent and that person will always need to be on the lookout for the next situation and have always a backup plan when all things start to fall apart.

In short going to work nine to five and forgetting about work afterward is not a really good strategy any more.

The second ill which may befall a software engineer is family. I’m a family man, my family is my sanctuary, my church and holy ground. I short my family is my life. But often the work we do puts us across the needs and wants of our family members. Our spouses, our fathers and mothers, out girlfriends. This is the truth.

If you read any book about people, or software processes or any topic related the the culture of software engineering you are going to pass by references to “Death march “ projects, long hours and weekends spent working, broken projects and divorces which resulted from those activities. The pressures and the time, of the time, we spend working maniacally in order to reach our deadlines reflect negatively on the needs and goals of those around us. No amount of money or bonuses is going to mitigate that. Maybe you live on a farm and regardless of your work you must spend time working on the family estate (new a guy who had a problem like that) or your wife is fed up being all alone with the children while you do whatever you do. And then meeting your business commitments and your family commitments is going to get really though, and your morale and your performance is going to drop and your private life is going, well down under.

What can a savvy engineer do than? First, you can’t please everybody. You have a limited resource, your time, and two opposing forces. What I’ve found out is that you need to be open at the beginning to both parties about what you can do and what you can’t do. And then be prepared to take blows. Or marry a wife who will not mind you being around so much. Or find a nine to five job.

The third and most important is your health. Your mental and physical health is the most important assent you are having in your career as a software developer. In order to achieve the level of performance and excellence you are able and required to produce you must be mentally and physically fit. Thus you must always leave room for physical exercise and strive to conserve a positive outlook to every situation and prospect. I can’t remember how many time those two thins helped me, and I can remember oh so well how many time one or the other failed me.

Experience is never taught, only learned by doing. Thus read and watch what others have done and experienced. A good documentary I watched five years go showed a year of frenzied development of a team of engineers at Netscape developing the first version the Firefox open source browser. That is a good example of what kind of life we lead.

But all is not dark, and all is not done, for we are human and we make mistake but to be human is to be able to learn and change, to adapt and improve thus we will make our lives better trough knowledge, spiritual advancement and physical toil.

2013-07-26 19.50.14

In the beginning there was the command line

 

In the begging there was the command line, and it was good. Then came the user interface, the mouse and expediency of ease of use. The word was “Don’t let me think” and thus the web was begotten.

And the cometh forth a beast of many heads, or many releases which swarmed into one version, and Google Chrome rose into the world and brought the command line back into the fold.

At first it was the ease of search, ease of address typing, moving and blurring the difference of an url and a query. Now, it was the turn of the information and the knowledge Google brought about your needs, your work, your life. And thus the time of search cometh to the world and the word was good and the masses were fed by the wine of information and food of quick results.

And the devil of engineering said “It shall not be enough, what was before shall come again, the circle of technology and innovation will turn again bringing what was before into the new and bright” and developers brought search to their applications and then it was not enough to have search but commands typed after the url came as orders of the divine and users could use the shell as the address bar and the web page as the console.

Thus in the end there was the command line. And is it was cometh again. Technology turns, what was old becomes anew, rediscovered, dreamed again.

I' am student of technology, servant of engineering and topologist of software. During my travels trough countless projects, books, presentations, frameworks, languages, databases spanning decades now I remember things which once were during the first books I’ve read at the end of the eighties and the nineties and the stuff I read and do now, and often I see old ideas and technologies rediscovered and re-implemented in new spaces.

I’ve read a book about the basics of computer and operating system architectures, how hardware and memory functions and how thing communicate and stood amazed how the same solutions and patterns are copied trough the architectures I’ve done and those I’ve dreamed.

I came to see this as truth about our loved profession. Everything which once was will come again, thus making the study of old systems, old patterns crucial for the future of our advancement. The critical thing which needs to be adopted as practice in our companies and universities and training grounds, and which is known to all old hands who survived several decades of shifting technologies and trend is that regardless that a technology is not used and more, or is redundant that there are core lessons and practices which will prove useful in the problem spaces of now and tomorrow. 

2013-07-07 00.28.31

14 December 2012

MS Community : The lean software development talk



Is it proper for my ninetieth post to be about a talk I held today at the monthly MS Community Istra gathering on the topic of "The Lean software development process"? I don't know but well it was a wonderful evening.

There were some news around it. It was the first talk I held as an independent consultant since I left Labirint/Cenosco earlier this month.

And second it was the first talk I held by using only my browser as the presentation medium using the amazing Prezi service and YouTube. Prezi is presentation re-imagined, it allows for a more dynamic and spacial orientated presentations and is easy to use. You can see my work in the frame above this text.

There were around twelve people present which was nice. I started the talk with some ground rules and my estimate how long the talk will run. I said one hour and half, it took me one hour and twenty minutes.

The talk was broken into four sections :

  1. Lean and muda
  2. The cycle
  3. The steps
  4. The practices
In the first section "Lean and muda" (muda is an Japanese words meaning waste, but in Croatian it means "balls" so figure it out ... are balls a waste? ) I introduced the basics of lean in production by focusing on the Toyota production system and the seven wastes (transportation, inventory, waiting,motion, over -processing, over-producing and rework) and their correlation in software development. 

I also introduced the seven principles of lean in software development and the key principle of kaizen whose examples I talked about in the whole talk.

The second section was the most fun for me. I talked about the basic lean software process I used trough out my carrier what are its rules and how can it be constructed. The principal accent was made on limiting cycles and steps into cycles be value delivered not time (time is important but the first delimiter is value not time, time is used to remove the fat of the value delivered to deliver first what the client wants to see more).

There is a note in the second step which is not visible in the prezi, squares represent big chunks of work and circles represent smaller chunks of work.

The group


The third section covered each step in a typical cycle : requirements, architecture, development and deployment. This was the most fun, since I elicited input for the public. For example when I discussed architecture I did a quick collaborative high level architecture diagram about a system for tracking cargo loaded. I asked do we need a database and got answers : " A small database, Oracle, SQL server ". So we picked SQL Server, then we picked stored procedures as a way to interact with the database and then Silverlight as the UI technology. For each decision I asked a dozen questions to show the group that architecture decisions matter and define how the rest of the project will progress. 

In the final section I covered the practices of doing daily standup meetings and pair programming which I consider real important practices. 

After the prezi was done I showed a clip on you tube which was a satire on the "Fall of Hitler" movie about an agile project going wrong oh so typically. This video is not about my political, or religious beliefs and its intent is only to show how agile projects often fail not to offend any one,

10 November 2012

The developers song

The developers song by Nikola Stjelja on GoAnimate

Video Maker - Powered by GoAnimate.

As I wait for my one hundred twenty projects long solution to load I pray the Lord for my soul to keep.

As I dream of complex code, loops, functions and classes, patterns and database I reach for Hermes the god Alchemist and inventors in my hour of need.

I no longer can reach the dream of perfect machinery

I no longer can feel the systems beat

It is one long chain of stack overflow, exceptions and performance pits

No tests to speak of, not builds to rely on

Just one long, long evening of darkness and despair of enterprise code ready to be released

It is time for me to step down, to reach my bottommost level and open my snail farm on a far away island

Is it is not that the future that awaits us all?

Hermes doesn't respond

My soul is mine to keep

The solution is loaded , all one hundred and twenty projects long

The code is green and blue and yellow and red

I start pounding my keyboard

I start building my code

It takes a moment for the grid to pop up

For the exception to raise I fix the problem

Release my code I go home happy, ready for tomorrow to do it all again.

15 June 2012

What is technical leadership

Use Case Model

What is a technical lead?

In my opinion a technical lead  is a person who is senior enough and has the required set of skills that can manage the technical aspect of implementing a complete software product or just a part by managing the technical aspect of its development for a small team of up to five people.

The principal focus of a technical lead is the correct technical implementation of a set of requirements by her and her team.

How do I become a technical lead?

In my experience technical leads (or whatever name they have) share the following characteristics:

  • A Technical lead has a level of technical excellence in a all areas core to the product development
  • A Technical lead has the ability to create a technical vision of a finished product, transform that vision in a set of tasks and lead people in their development,
  • A Technical lead can take onto him self to develop the core of the product being developed.
  • A Technical lead needs to have soft skills

In short you need to have all those skills and experience to make it to a technical lead level. But that is not enough. To be successful as a Technical lead you need implicit backing from the organizational management structure. A Technical lead is responsible for the technical aspect of the product being developer and without a proper and implicit organization backing he cannot achieve her goal because technical excellence and soft skills are not enough to technically lead people.

On aspect of the technical lead job is to be the arbiter of any technical decision. In short words if there is any doubt what technical solution is proper for a given problem the duty of the technical lead is to accept upon himself the responsibility of the final decision.

What does a technical lead do?

A technical lead has several areas of responsibility. He is is both an engineer and a operational level manager and thus his work covers both spectrums:

  • Translations of business requirements into technical tasks
  • Planning and organization of technical tasks
  • Technical planning and technology selection
  • Team technical communication
  • Stakeholder technical communication
  • Project technical quality attribute management
  • Construction of the project core

OF the entire list the following two areas of responsibility are important:

  • Construction of the project core
  • Planning and organization of technical tasks

The technical lead must accept and develop the most important and critical part of any project. And he also must manage the implementation of all technical tasks related to the product being build.

24 November 2011

Agile Architecture

There are two core principles to architecture in an agile environment which worked for me real good :

  • Document only small slices of the system one at a time at the time you need them
  • Be as specific as you need without going into too much details
A typical business system, one that is software intensive, is a really big and complex. When developing one such system it is impossible to document everything at once. What I do is to create a general corner stone architectural specification that defines the core architectural areas and principles of the system, a reference architecture around everything will be build and then create a series of small architecture documents (Architectural Notes or Memos) which are slices of architecture targeted at a specific system view or functionality which is developed for a first type. Architecture is a generalized specialization so such documents must convein all the information one needs to implement the designed architecture but not specialized too much in order prevent the multiple variants the same architectural areas can have. 
It is important not to design to early , but at just the right time. The goal is reduce the amount of time passed between the design creation and the implementation and to focus the architectural effort on the architecture which is need right at this moment of the currently developed sprint. 
Designing and documenting and architecture slice is one part of the whole problem, even when you create such a design at the right time with the right amount of detail the majority of the subsequent effort is spent communicating and reviewing the architectural implementation. If the implementation part is done by the architect and the senior team (such as the core of the system) a significant part of the architects effort is spent disemminating through the development team (or teams) the culture and the ideas required by the architecture design. 
Software is plastic, and programming is flexible. Event the most pure architecture can be twisted, scratched and mutated in something recognizable. The best way to insure an architecture to survive is to set up much of its essence in code and build tools which guide the developer down to a certain way of solving problems (which has its own problems , which is why architecture should be approached slice by slice and nothing is one hundred percent fixed in stone and unchangeable) and to integrate its core principles into the development culture of the development team which will ensure it gets adopted by every new team member.
Lots of teams make use of the shared tribal team identity as the only reference how things should be done by the project. This practice is spurned by software engineers, and with good reason, because software cannot be developed with tribal memory and shared culture alone, documentation must exists, tests and build tools must exists in order too enhance the human falabilities to which we all are susceptible : short memory, illness, death, holidays and leaving for a better opportunity. In its essence agile development values people over processes and interaction over rules, it doesn't mean no documentation or processes should be in place. We all are humans, and by definition fallible. Agile architecture should strive to reduce the human error by documenting and the essence of small specific slice of the system such as : grid architecture, background process architecture, form architecture, repository architecture, commenting system architecture etc.
Short is better for software developers, people will more eagerly read a ten page document then a one hundred page document. They will read it more often and learn more from it. It is also really easy to communicate a short document then a large one. Also, less errors are introduced in a short design then in a large one.
The agile manifesto reads as follows:
Individuals and interactions over processes and toolsWorking software over comprehensive documentationCustomer collaboration over contract negotiationResponding to change over following a plan

The agile manifesto clearly indicates that things on the left are more valuable then things on the right, but things on the right have a value. They are second to the things on the left, people have more value to software development over processes and tools, working software is king over documentation. But a balance must be made, without a documentation who will understand what is being developed? Without a set of class diagrams that show the core architecture for a subsystem from top to down and text describing it who will understand the code without someone guiding him through? 
Each day when I start my work I say to my self :

Your job is to enable other people to do their job better

I'm a technician and my focus is technology and the development team that works with it. I'm a software engineer by trade and a craftsman by soul and I really think only three things are important in software development:
working software, people and communication

For me agile architecture is that which maximizes those three things.

01 September 2010

Oh, my learning muse

I didn't write in four months now. It didn't seem to matter, nothing did which was related to my work. What happened to me?
Well, I've been pushing my self for the last three years very hard. Learning, working and applying my self in order to grow, learn and advance as a software engineer. And then I crashed, emotionally and physically. I become cranky , tired and frustrated.
I started then working from home, so I didn't have to drive for two hours a day on really low grade roads. I saw more of my family, and I was more rested.
One thing led to another, I started to shift my priorities to my son and wife. I started spending more time with them, going out to play by the sea, watching movies reading books, going out. Just living my life.
What was not right, was the nagging feeling that something was not right. A sick rotten feeling that I was leaving out something vital and important to me. My learning and education. My personal growth as a professional.
It got to the point that I felt my brain rot from not use. And I didn't like it. So I started learning again, "Patterns of Enterprise Application Architecture" by Martin Fowler, and "WPF Unleashed 4" by Adam Nathan. The former as my regular reading and the latter as my computer time in the evening and weekends reading.
I feel more right now. I guess. I don't spend as much time at the computer cranking code and learning new stuff as I would like.
Every time I can sit at my machine and learn , it seems it is ten in the evening and I'm to tired, my head hurts and I just want to unwind. It is really hard to keep up.

12 April 2010

5th WebUG meeting report

On the 8th of April 2010 I held a talk on the topic of "Software Engineering" at the 5th Web user group meeting which was a SQL/DEV user group meeting (since Windays 2010 are coming soon). The talk was held in the Microsoft offices on the top of business building in Zagreb in the Dante conference room.
The presentation went well. I was really nervous beforehand. I thought that there is for sure someone in the audience who will spot an error and point it out. Well no one did , or if he did he didn't point it out loud.
There were some technical difficulties at the beginning. The network was hard to get and the camera crew didn't come so the talk wasn't recorded. Bummer.
Everything else went just fine. The talk was well received by the audience, people came to me afterwards to congratulate me or to talk about some finer point in private.
The hosts were gracious enough to accommodate my special dietary habits so they ordered a vegetarian lasagna for me during the networking part of the event. Everybody else got "čevape" which went away pretty fast.
All in all it was a nice event. I meet some good people and I hope to have a chance to present again on a future WebUG meeting.
Here are some photos taken from the talk:


03 April 2010

WebUG Presentation: Software Engineering

Next week on the 8th of April 2010 I will present on the monthly Web User Group meeting in Zagreb, at the Microsoft Croatia offices on the topic of Software Engineering.
Software Engineering is something very dear to me. It is also a very hard topic to condense in an one hour presentation.
For those who want to attend you can find more here http://www.webug.com.hr/.

18 March 2010

Key principles of software architecture

Software architecture is the first and most important design step of software development project where are defined and indentified the key components of a product encompassing the logical structure of the product being built, the technologies used and how they are used and the definition of the key processes handled by the system both business and technological.

Software architecture is software design , but not all software design is software architecture. Architecture implies a high level overview of things. It set the boundaries and key guidelines of the development effort without going into a detailed specification of each implemented use case on the technological or business level.

Every developed system has an architecture. Most software architectures are incidental, matters of accident and small decisions made by different people at different times without accord or shared vision.

Software architecture is both easy and hard. It is easy because it doesn't get into every detail of the system being built, that is for the detailed design effort it is hard because it requires an encompassing vision of each key element of a system and the capability to set it in clear, concise and understandable writing.

As the product changes the architecture will change. Decisions are being made by each key stroke, by each library reference and each guideline not met - no matter how small or temporary.

The software architecture document must be therefore written in a short and concise way with pictures describing each key section of it in order to facilitate rapid understanding and ease of maintenance.

There are muliple way of doing software architecture. A good , and free book published by Microsofts Patterns and Practices covers all aspects of it, the Microsoft Application Architecture Guide, 2nd Edition. I would recommend it to everyone.


A dummy high-level model for a HRM system


When I approach and design a high level architecture document I generally cover the following sections:


  • Project overview

  • Project goals

  • High level architecture diagram

  • Technology platform

  • Technology platform - process and techniques used for specific problems

  • Key processes covered by the product

  • Other



Project overview. A short overview of the project, usually a project sales pitch describing what is the project, who is the client and what the project is really about. I do not go into great details since there are other documents which are generally built to elaborate on the topic further.

Project goals. Or the project high level requirements are the handful of key things the project must be able to accomplish. This is the basis on which the architecture is being designed on. The architecture must be able to fully satisfy these , generally around five, requirements in order to be successful.

High level architecture diagram. The highlevel architecture diagram is the corner stone of the document. This is actually the picture or the sets of pictures most architectural discussions are done between engineers and which will set the broad strokes of the project. The key goal of the high level diagram is to set the relationships and communication channels between each compoment of a system. It can be done by using a block diagram with squares and arrows indicating componets (applications, modules, databases and etc. ) or it can be done by using UML's component diagrams.

Technology platform. A list of technologies used for the product organized in logical sections describing the goals and reasons for the usage of the technology. It is important to correlate the chosen technologies interdependencies, e.g. all the technologies must work well together and if not the risks must be identified, documented and review by all the architectural key stakeholders of the project.

Technology platform - process and techniques used for specific problems. Description of key usages of each technology. Most modern technologies used for the development of modern systems and products can be used in several ways, buy applying several techniques at ones disposal. For example one can rely heavily on the ObjectDataSource object in ASP.NET for all grid operations or could choose to manually bind data or just to build a normal HTML table with data into it. This important for a data heavy application where data will be often presented in a tabular fashion and this will be the main way a user will interact with the system.

Key processes covered by the product. This correlates directly with the high level requirements set for the product, e.g. the project goals and other critical issues which can applied to the entire product and are critical for its proper functioning. Here we could specify how the system reporting solution will work, how the system will interact with other key systems ( for example with an old dos accounting application critical to the client who can only write to the file system plain text files), how the authentication and authorization system will work , how will the caching solution work etc. Apart from the high level diagram this is the most critical part of the architecture and more so for the client. Often to support a specific process implementation an architectural spike will be developed to prove and disprove a point to the key architectural stakeholders.

Other. Architecture is for the most part a technical discipline done for the product development team. It is purposefully ten thousand feet up from the detailed specification of the product in other to cover, restrict and keep up with the full product life cycle. Each product is a separate beast with its issues and pitfalls, risks and challenges and there a myriad characteristic who could be added to the software architecture for a specific project.

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.

03 October 2009

Short, short deadline sprint rules for success

Imagine this situation, its 24 hours before a very important deadline and your project isn't ready. But you must show some progress to the client, something anything to stop them from stopping the project and turning to someone else. What do you?

I've been caught in this situation several times already this year, and will in all probability caught again, and its not easy or simple to handle. For each project I was a technical lead, and the responsibility to actually do the task by the deadline fell to me.

The following rules helped me:


  1. Cash in your relationship chips , you'll need them to motivate your people and make them buy in the effort required of them.

  2. Write a task list of all tasks needed to be carried out in order to successfully meet the dead line, and then filter it out to the bare essential. It's time for brutal reality, not Christmas wish list making.

  3. Take the core, the most difficult and most important stuff on your self. They made you a technical lead for a reason. Now is time to earn it.

  4. Distribute the remaining stuff to each team member according to their capabilities and aptitude.

  5. Make sure no one introduces new (or reopens) new defects into the system. Test the core twice before committing. Break heads if necessary. It's not the time to create more work.

  6. Do not commit unfinished work. It either is done, or it isn't. Only pure 100% completed and tested changes go into the repository. Make sure everyone is on the level with this.

  7. Do standups every four hours in the first twelve hour period, then switch to two hour standups for the remainder of the sprint. Track only completed, not completed progress on the created task list. Look for problems, and replace people who got tired or the tasks assigned to them are to difficult to handle. Pair programming was proven effective in both cases.

  8. On achieving all (or the majority) of the planned task code freeze the repository, and label it as such. Do not allow anyone to commit now unless its a critical defect fix you personally authorized. Break heads if necessary.

  9. After the code was freezed, test everything on your machine. If everything checks out label the code in the repository as such.

  10. Publish the product to the production environment and then check it there once again. If everything checks alright, go home to your family for a head bashing for spending 24 hours on work while your kid won he's first soccer prize (or similar). Be proud of your self for achieving something great and meaningless.



The following rules(principles, steps) work because there is a clear scope of the work to do in a very short amount of time. Everyone is clear on the importance of the work to do and what is the price of failure.

The two most important thins are frequent standups and the written, prioritized task list. Why? Frequent standups remind everyone one the goals and the principles of the work to do. They allow faster knowledge sharing between team members and allow you to get a clear view of the progress achieved thus far, of the problems had and allow you to frequently react to those problems in order to remove the impediments thrown in front of the team.

Remember in the end everything falls to you. You must be the leader, the one that starts first and goes home the last. The one that pushes the code to the production and says is done. At four am there is no one else. Its your responsibility to sleep for two hours and show to work to check if everything is OK with the business people showing the product to the client.

You are the hart and soul of the team. You must show firmness and clarity of vision and command, you must be supportive because without them you are nothing . You are your team, and they are yours for good and for worse.

21 September 2009

Best practices in brownfield development

The wikipedia definition for the term 'brownfield is this : ''In the United States city planning jargon, brownfield land (or simply a brownfield) is land previously used for industrial purposes or certain commercial uses. The land may be contaminated by low concentrations of hazardous waste or pollution, and has the potential to be reused once it is cleaned up. Land that is more severely contaminated and has high concentrations of hazardous waste or pollution, such as a Superfund site, does not fall under the brownfield classification. Mothballed brownfields are properties which the owners are not willing to transfer or put to productive reuse.[2]' .

I couldn't agreed more with this definition, especially about the hazardous waste and pollution parts. Brownfield development in software industry is very common, rarely a developer will develop a system from scratch without dealing with legacy code and applications.

In my opinion brownfield development is hard, and understudied. Every book on software development teaches how to develop a green field project, e.g. a project developed from scratch. Which is good. But no one is taught the essential skills and practices of brownfield development.

And that hurts. Very much.

What are the problems associated with brownfield development? They are many and varied and depend on both technical and human reasons:


  • Lack of understanding on the underlying reasons why a technical solution was chooses to solve a particular problem.

  • Lack of any legacy technical documentation and tests.

  • Developers think they know the 'only right way' to develop software.

  • Fear and uncertainty of breaking existing, working functionality.



When working on brownfield project I've found the following to be true and very helpful and productive:

Do not try to re-engineering the project when implementing new functionality, when the time comes that will be the only thing you will be doing. That way your will not bog down on useless, defect prone work.


  • Do it as the other guy, use the same existing infrastructure and follow the same development principles. That way you will not add competing solutions and will achieve a homogeneous environment.


  • Write a short, concise documentation for each feature you develop. That way everybody will know what you have done and why.


  • Document key technical solution and practices in the project. Some problems and questions keep reappearing over and over. That way you will save everyone the time and effort of figuring them by them selves.


  • Write smoke tests (functional or unit) for the core functionality of the project. That way you will always know if the core works or not.



The goal here is to not increase needlessly the complexity of the system, to save time and effort and to quickly gain the core knowledge the other guys had. If the client wanted you to re-engineer their system they would have hired you for that specific goal. It is often better to follow existing practices and procedures than to try to reinvent the wheel and fall in a bottomless pit of defects keeping popping up and deadlines never met.

07 August 2009

Document first , document later

There is a great debate in my head, what is best – to document first , or to document latter. The wanna be engineer in my head would scream “Document first!”, but my practical side, the one that has been into the trenches, that has seen things, horrible things would say “Document later!”. How to reconcile those two opposing views?

Documents can be generally be placed into two broad categories, those that are:

  • Generally written before development

  • Generally written afterwards development


Why do I say Generally? Because in software development nothing is set in stone, and everything is fluid, thus documents cannot be said to have been written always before head or afterwards a piece of software is developed( class, module, library etc.) . A set of documents could be generally written before head, like requirements or the high level architecture, and some are generally written afterwards like in some cases detailed API technical specification.

What makes a document fall into one of the two general categories. Two things :

  • Type of document

  • Current state of the software life cycle


The Type of the document generally dictates when a software piece will be written. Like, requirements or the functional specification or something like that which is generally needed before a piece of software is written. And some which cannot be (or can, but albeit very hardly depending on the skill of the developer and the knowledge of the system), like detailed technical specification which is not ever accurate when written first and is ever (hopefully) updated once a particular piece of software is written.

The other most contributing factor is the current state of the software life cycle a team find its self in. When developing a green field software it is generally best to do the documentation first ( I'm not discussing waterfall here, you could develop module after module, and before each module write the technical documentation for it before going into development), but when a team finds it self knee deep in a brownfield development project, which generally doesn't have any documentation what so ever, which isn't even commented properly so you cannot generate an API spec automatically which is remotely useful to anyone, when you need to fix unknown defects, when you need to implement a piece of functionality and don't know how to place it inside the project and how it is to be connected to everything else, writing documentation first could be and exercise in futility since you don't know enough about the system. This will change gradually during brownfield development when you will reach a state where writing design documentation first would be a better choice in terms of quality of work and writing speed place into the construction of the document.

So, what to say to may two different parts? It depends. And that is the only answer I can give them, which places my little self once again on the verge of a nervous breakdown due to over thinking so simple things. But documentation is important, some cannot see that, but those cocky bastards will soon find them selves trying to remember how they did that, or where somebody placed this and how is generally this implemented and so on, and will loose valuable money debugging the thing out of its life in order to find something which would take five flimsy minutes to read. Who is stupid now, ha?!

25 July 2009

Database development blues

In most line of business application there are two major types of artifacts involved : the database and the application. Sometime there are two types of developers, but mostly that is not the case. The same pure smuck that built an entity inside the application will usually write the database and UI code for it.
Well generally I don't think thats wrong. I strongly belive in cross functional teams where each developer can work with equal skill on each application tier. When you work in the outsourcing industry as I do, you quickly came to appreciate those team members who seem to be able to do evertyhing: database modeling, stored procedures, domain objects, html and css layouts, documentation, testing and so on.
The major problem with the approach of one developer doing both the application and the database work is that that developer approaches the database work in the same way as he approaches the development of a typical application. But those two types of artifacts are not the same, they behave differently during each phase of the product life cyle.
The application code is fairly easy to modify, extend and delete where the database code is always resistant to change, and it grows more resistant as the product and its database grows. Why is that?
The database is composed of three different types of artifacts:
Data structure
Programmed logic
Data
Data structure is the logical representation of the types of data stored in the database and their respectiove relations. We call them tables.
The programmed logic is what we say to the database it should do with the data that goes in and out of a table. We call this : stored procedures, functions, triggers, constraints etc. To most developers this is the closest thing to real development they will find in a database project.
The data, well, there is not much to say about that. This is the meat and bones of what a database is to most people. The reason d'etre of a database. Users data, application or system data stored for eternity in a database for all to see and use. Most databases store data about them selves in special databases and tables. Figure that.
Well the thing is with databases that the data stored inside them is the most valuable thing in a line of business project. A developer can frag the entire application code and it wouldn't be even as worse if he fragged the data stored in a database. So, losing or modifying data in a database is not a good thing.
As a database (and its accompanied application code) is being developed the volume of useful, production data inside it grows. Each change to the database structure becomes much hardere, since you cannot loose data (thats why most people try to nail the database structure before starting the development process) , and it gets even worse when the database goes live to live free in the wild of an enterprise IT infrastructure. If you frag the database there you can kiss your ass, head and small fingers good bye because angry people in business suits will descend apon your small little you like vultures on a helpless white rabbit with its back pawns broken. Its that bad.
So working with the database is hard and risky.
The underlying fact with the database is that its always changing. New data is added inside it, changed, deleted. The structure is change, new tables are being added each day. Even the programmed logic changes from time to time. It is always changing regardless of it being in development or in production. While the nice and good application code changes quite rapidly and easily during development but its damn impossible to change when its compiled in an executable and shipped to remote production server in the prairie.
So what to do when you have a line of business product to ship on a rapid development track with database and application work done in parallel by the same people. Well , its simple.
Stop making changes in the database manually. Write scripts.
Repeatable, stable , data saving, scripts.
Then , respect the database. It is not your run of mill .NET application. It requires different development practices.
In database work you done have the write, compile, test life cycle of application development. Once you loose data it is gone, once you mess thing its hard to go back.
Think of a new development process for working with the database. It will repay you ten fold in virgins.

09 July 2009

14th SQL/DEV User Group Meeting in Rijeka

I'm thirty minutes away from a trip the fourteenth SQL/DEV User Group in Rijeka. This time its a corporate spornsored trip. Five other colleagues are going with me. We managed to gather up a big van with air conditioning and, event , a corporate sponsored meal. Nice.

The SQL/DEV user group meeting will be organized in the Nautical University of Rijeka and will be composed of two lectures :

  • ASP.NET MVC development practices

  • RubyOnRails, Ruby and IronRuby for .NET developers


And of course, after the presentations a gathering will be organized with drinks and snacks with all the attendees which will be an opportunity to meet new people and learn or discuss about interesting ideas and technologies.
I really think these type meetups are important for a developers advancement, since you can learn and hear about development use cases which would normally be hidden from you.
I started thinking about organizing a presentation for the next OpenCoffe meeting. Something short, maybe half and hour long, and interesting. Practical, maybe event daring in the specific way I conduct all my presentations ;)
I haven't decided anything yet. I was wondering to do something on the following themes:

  • Web UI testing and automation

  • Web portal development process

  • Drupal theme development

  • PHP Unit testing

  • Building an MVC framework in PHP.

  • Workflow Foundation

  • ASP.NET Data binding controls



Don't know. More that I think about it I realize that I know squat. Maybe I should just cover and listen to wiser heads talking.

02 March 2009

The sun and the way UML diagrams fold on my freshly inked skin

It is my firm belief that any modern developer, being junior or senior needs to know at least the basic of UML 2.x class, sequence and activity diagrams in order to be productive in his workplace and to communicate effectively with his coworkers about one of the most hard and abstract matters known to man, by which I mean the matter of software design.
But what I find in the field today is sorry state of affairs where the majority of developer are not aware that UML even exists, a small percentage of can read it and only a handful can write and express them selves in the fine software modeling language of UML. It is my opinion , as a practicioner of the craft, that each high school that teaches programming and each university that prepares young feeble minds for a career in IT or software development must teach its students the basics of reading and writing of UML.
UML is most critical to understand object oriented design. When a developer is able to express his idea about a system in uml , that developer shows a deep understanding of that idea, and therefore is able to teach to other, implement it by producing qualty code and adapt it to changes which are sure to come in the future.
Code which isn't described by UML (or any other notation for the matter)is hard to read, hard to teach and hard to change. Code that is described by UML isn't any of those things.
But by the God of Chips and Neurons, UML isn't hard to learn either. You just need a manual (e.g. UML distilled by Marting Fowler) a pen and sheet of paper on which you can sketch your first diagrams. I've learned my UML near the sea in Pula where I live. I would put the Fowler book in my backpack, take a notes and a black 0.4 pilot pen and I would venture on foot the Pula's "long see" (lungo mare) a walkaway for tourists and kinds high on booze and midnight sex , and I would sit there by the see and draw my diagrams watching the sun go down deep below the summer sea and enjoy my self learning a powerful tool which made a better developer, a better person and more ... I don't know.. just better than I was before.
That should be enough for any of you sorry asses who haven't had the time to learn a tool as basic as UML.

20 November 2008

Designing proper HTML code

I think there is a need to engineer HTML code in a web web application, the same way server side and client side code is engineered. I'm posing my self the question how?
For standard programming languages I use UML, but UML can't be applied to HTML. Html denotes the structure of a hyper text it doesn't model interactions or functions. It can't be effectively described with standard software engineering techniques.
HTML code is simple, and short and anybody can learn to do it in one hour. It would seem to the causal user that HTML doesn't need to be specially engineered. I think that is not the case. Every web application is always finally rendered into HTML. All user interactions are defined by how the page is structured in HTML, the way the server side code is structured depends on the way HTML is structured and the ease CSS can be developed also depends on the way HTML is structured. Not to mention cross browser and cross platform portability.
It really matters if a developer uses tables withing tables, or a series of stacked divs. It really meters the decision between table cells and unsorted lists or paragraphs. When put in perspective, most problems I've encountered in my career as a web developer had to do in a way with badly engineered HTML.
I think it is critical to find a way to design and plan markup code for web applications. If we as engineers spend so many hours a day preparing or code and our applications to be of the maximum quality, I think it is imperative to spend the same energy on HTML.
I know what you think. HTML is not serious, it is for kids not engineers. But look around you. Web applications are everywhere, and so it is HTML. Without HTML there would not be the world wide web as we know it. Its simplicity is what it drove web applications inside and outside the corporate firewalls. And neglect to properly engineer HTML code is one of the root causes of the poor qualty many web applications suffer.
It just came to me today, this idea. I spent several days designing several objects in UML, documenting them, writing them, testing them, writing and thinking about unit test, automating them, and it all worked as a charm. But when it got down to HTML and its sister cousin CSS I worked as newb coding like hell without preparing out a head, doing a crap job on a critical part of the application I'm working on. I can't put it there like that. I have to rewrite it tomorrow to increase the quality of the code I'm producing. But how many hours of work would I saved if I engineered my HTML code in the same way I engineered my javascript and C# code?