Saturday, December 30, 2006

Software engineers

-- Best jobs of 2006 --

With this post I propose to put an end to 2006, and I thought it would be a good idea to point out one study made by CNNMoney. A research was organized to find out the best jobs and their caracteristics (research done in USA).
I have been pleasantly surprised to see that the Software engineer career ranks highest. Now, I may say it is expected, as among some other factors, growth of IT-markets and rapid development of information technology requires it. If you are in it, you probably agree it is a very competitive branch.
And here are the top 10 jobs of 2006 (in the USA):

  1. 1. Software Engineer
  2. 2. College professor
  3. 3. Financial adviser
  4. 4. Human Resources Manager
  5. 5. Physician assistant
  6. 6. Market research analyst
  7. 7. Computer IT analyst
  8. 8. Real Estate Appraiser
  9. 9. Pharmacist
  10. 10. Psychologist

The factors that were taken into consideration are from my point of view pretty cool: job growth, benefits, what is expected (education level, efficient problem and problem related issue handling (e.g. job stress level) and what is required (creativity, problem solving capabilities, flexibility).

And this is how the chart looks like:

Source picture taken from CNNMoney.

Technorati tags: software engineer, best job, technology, salary.

Monday, November 13, 2006

Transactions, concurrency, performance

In distributed environment performance is an important criteria for software. To achieve performance, we need to make our software work fast and effective. I will try to describe a problem that you may encounter when developing such application, and of course, a solution which may be helpful.

Let's say you have an application in which you need to work with many user data, where frequent database access is foreseen. In this application you need fast access to existing data. As your application is distributed, data access is required from several locations. You may get in trouble for concurrent data access or reading dirty data. Modifications of the same data should be avoided.

An option is to use a database. Although, this will not provide you satisfaction when it comes to performance. Suppose you need to handle data operations. As soon as data is available, it will be processed by your application from the other locations. Concurrent access will be managed by database - transactions will slow you down even more. And it will not make your application performance better. In principal for performance issues using a database is not the best choice, instead using a cahe would be a better choice.

A distributed cache would suit your needs in this case (see JBoss Cache).

O/R operations in cache are performed at high speed. Using JBoss Cache, you can also have your data distributed on many locations. And you will have fast data access, as your data will be replicated and available on the locations you choose to configure. But to increase the performance of your application, you may choose to use or not transactions. Jboss Cache provides the following transaction configuration options (analogous to database isolation levels): NONE, READ_UNCOMMITTED, READ_COMMITTED, REPEATABLE_READ, or SERIALIZABLE (for detailed description of levels please see here). REPEATABLE_READ is the default isolation level used. You should know that Jboss Cache by default is using the pessimistic locking scheme to avoid concurrent data access.

The idea behind using distributed cache and achieving performance is having such a cache structure, where writing reading may be performed without causing exceptions. More precisely, writing to the cache should be performed in the same cache node (read here more about the cache structure) by the application running on a location. This means, you need a cache structure based on the number of the locations your application is distributed on. Creation of the cache should be done on-the-fly: when the application is not available on a location, it should not have a cache entry. Now we have a write-safe cache. As for reading, we can choose from several strategies: you could use the default isolation level, which uses a read-write lock. This you don't need entirely, as you can write your cache safely. So for reading you could use the READ_COMMITTED or READ_UNCOMMITTED values, depending on how your application handles data integrity. But if you handle dirty data and you are for performance, you could pick the the transaction isolation level NONE - where no transaction support is provided. To improve concurrency and performance, you should care for the configurable locking mode OPTIMISTIC, which if is enabled, transaction isolation levels are ignored. With this configuration mode you still have transactions.

The correct configurations, though, are application and requirement specific.

Technorati tags: design, JBoss Cache, transactions, concurrency, performance.

Tuesday, October 31, 2006

Simply Seam

Seam, the Next-gen Web Framework. Please see an overview provided by Michael Yuan of a powerful web framework created by JBoss.

Technorati tags: Seam, Jboss, Web Framework.

Tuesday, September 05, 2006

Best of C++

These are some really interesting articles you can read over at Artima Developer. They are all about C++, and about the most important things that have been accomplished so far using this programming language.
If you are just starting, these articles provide you an insight, like a little history lesson. I am not stating that C++ is history. I have a good opinion about this language. But, as each of us know, it comes a time when you have to step further. I did, now I am on the Java side.
A tip for starters: make sure you understand and get to know as many languages as you can, but deeply, so you can make the right choice of the language that suits you.

Technorati tags: programming, language, skill, C++, Java.

Monday, August 28, 2006


This has been a long time since I have added a post here. Well, I will explain shortly the reason and let you know of my future plans.
Work - as lots of us know - took most of my time, but then a long summer vacation followed. I think I can consider this the next series of my posts (the new series), as soon enough there will be a year since I started blogging.
I plan to share my experiences frequently than so far I used to and of course, hoping this makes it easier for you.

Tuesday, May 09, 2006

Code, in general

Matthew Heusser wrote an article some time ago and he had a really good remark, pointing out that code which is produced is .. well, only produced and not exactly written to be of good quality. I read somewhere posted these days: "Quality pays itself." You probably have experienced this. But with Matthew's words, we don't get to say it too often: "Now that is some fine looking code".
He has some good points when defining beautiful code: code should be readable, focused, testable and elegant.

However I like to take his ideas a little bit further and add that code should be:
  • readable: good comments, coding styles should be respected, some common formatting styles should be followed
  • maintanable: variables, methods, classes should have talkative names, so when it comes to feature enhancing and/or refactoring software-parts shouldn't be just a collection of hard to understand, unreadable code
  • reusable: when it comes to adding new functionalities, especially methods should be organized that they don't contain duplicated code/duplicated logic and already existing feature should be taken advantage of
  • extendable: functionality should be organized so it is clear where new features fit best, and make use of object-oriented techniques
And code that was written with some consideration is easier to re-use, and to refactor. Code is usually refactored to make it more compact, more readable, as when refactoring code to introduce patterns, it is for later simpler reusablity and extendability.

Adrian Sutton also has put the point on the importance of producing quality code: "The other big advantage of writing beautiful code is that it demonstrates good coding practices to anyone who reads that code and anyone who reads beautiful code immediately has a high level of respect for the programmer and for the codebase. They're more likely to take time to understand problems and contribute fixes if they respect the codebase rather than seeing a mass of uncommented code, swearing at the programmers and going off to find a better written tool."

I don't agree with those people who say that generated software is of high quality when code from one programming language has been ported to a second language. Imagine a software written in Visual Basic and ported to C or Java. Imagine yourself now having to add new functionality to that software - it wouldn't be a dream job.

Finally, I think I have to add here that I am devoted to writing quality code: I am using, among other practices, the refactoring. Here you may find the catalog of refactoring to patterns, and you should also take into consideration the recently published Refactoring Databases.Of course, you can have the catalog of refactorings from here.

Technorati tags: software, code, programming, refactoring, practices.

Tuesday, April 04, 2006

Checkstyle - Coding standards

Quality code in my opinion is an important step towards quality software.

I believe having a well-defined set of coding conventions is necessary. To produce code that is readable, reusable and maintainable, it is needed (among other things like having good programming habits) to follow some code writing conventions. I use Eclipse for my IDE. And with it, Checkstyle - the tool that helps write Java code that adheres to a coding standard.

There exist many coding standars. For personal use, I recommend the easiest form: to follow the Sun coding conventions. Of course, you may personalize it. This will help you in coding and your code, to have a standard format. In case of companies, they tend to have different coding standards: you have probably experienced a few, if you have worked already for a couple of different companies. As companies usually develop their own coding standards, sometimes very different from the Sun coding conventions, other times with minor alterations. This is good in either ways: code within a company needs to be maintained, reused, and improved. So this is a small assurance of better code. When a programmer or programmers have a well defined set of coding standards, they will think less about details such as code layout and variable naming conventions, spending more time on the real coding.

Some coding conventions that I find important:

  • Comments: all classes, methods, and variables should have
  • Naming conventions: constants should be in uppercase; variables, methods should have talkative names and should not be abbreviated
    (e.g.: private Map myHashMap;);
  • Declaration: all variables should be declared with visibility modifiers; each declaration should be on separate line

Checkstyle can check many aspects of your source code. You may want to give it try, as it now supports features like: checks for class design problems, duplicate code, and standards related to: Javadoc comments, naming conventions, import statements, white space, modifiers, blocks, etc.

If you already want to add it to your Eclipse IDE, you may find here some hints. As well, you are able to set various highlighting modes.

Technorati tags: Checkstyle, Eclipse, Java, tool, tutorial.

Saturday, January 07, 2006


You may have wanted to peak into a queue or topic. Did you find a suitable tool for it? I have used Hermes, and I had a pleasant experience.

Hermes is a Swing application that allows you to interact with JMS providers. Hermes will work with any JMS enabled transport making it easy to browse or seach queues and topics, copy messages around and delete them. It fully integrates with JNDI letting you discover administered objects stored, create JMS sessions from the connection factories and use any destinations found. Many providers include a plugin that uses the native API to do non-JMS things like getting queue depths (and other statistics) or finding queue and topic names.

It offers some nice tutorials of setting it up with the JMS provider you are using. For example, check out the tutorial for setting up Hermes with JBoss 4.X. It can be used as well as a good example for JMS providers configured via JNDI.

Technorati tags: Hermes JMS, Swing, JNDI, tutorial, tools.