An Event-Driven Approach for the Separation of Concerns

Last week I presented a paper at the International Conference on Evaluation of Novel Approaches to Software Engineering (ENASE 2012), at Wroclaw, Poland.

Title: “An Event-Driven Approach for the Separation of Concerns”

Abstract: “This paper presents an event-driven approach for the separation of concerns in software systems. We introduce the EventJ framework that provides an event-driven extension to the Java programming language. The paper describes a general methodology that can be used to identify the cross-cutting concerns and separate them from the main functionality using events and event handlers. We discuss the pre-requisites to perform this change and illustrate it with a concrete example. Finally, we make a comparison between the event-driven approach and the aspect-oriented one, and conclude that the use of events to separate concerns has a positive effect on software quality attributes such as maintainability, extensibility and reusability.”

You can freely download a full-copy of the paper.

You can also view the slides:

I hope you find that interesting. Feel free to leave a comment below.

Posted in AOP, OOD, OOP, Research | Tagged , , , | 4 Comments

Self-meetings: Avoiding distractions in the workplace

In the modern workplace, in which we are always connected, there are simply too many distractions. You need lots of discipline to really use your time effectively, besides the capacity to clearly define your priorities. You must be able to identify the reasons your valuable time is not being spent in the most effective way, and then develop methods to fix that.

The chart below, called “How to Focus in the Age of Distraction” has wonderful tips about effective time management and increased productivity. It’s certainly worth more than a thousand words, so I suggest you take a good look at it:

One form of distraction that is not mentioned in this chart are the meetings in the workplace. If we really want to “work in focused bursts”, we must assure that our work is not interrupted by a meeting.

In my experience, this is particularly important for software developers. If a programmer is focused, he can accomplish in two consecutive hours much more than in two periods of one hour each. Every time a programmer starts working on a task, he needs considerable time to “enter the zone”, reaching a state of “flow” and working with maximum productivity.

Too many meetings are certainly a productivity-killer for any professional. But, for a software developer, even a small number of meetings randomly distributed during his work day can reduce drastically his output.

The question is: How can I avoid my work to be interrupted by a meeting?

Self-Meetings

I’ve adopted a simple technique that works very well: When I know that I need time to work on an important programming task, I just go to my calendar and reserve this time for myself, marking it as “busy”. In other words, I create a “meeting” in which I’m the only participant, a meeting with myself. If I know I will need to work for several days on a task, I may just reserve all the mornings in a week. For example, I may create self-meetings, every day, from 8:00 to 12:00.

Thus, when someone tries to invite me for a meeting, he will see that I’m busy, and then he will need to look for an alternative time in which I’m free. Better yet, he may decide that I’m not really needed in this meeting.

Of course you must always leave a certain amount of free time in your calendar. After all, there are meetings in which you need to participate, and you do not want to make it extremely difficult for the meeting organizer to find a suitable time slot.

This technique will not work if your organization has a really bad meeting culture. There two types of common problems regarding meetings:

  • Too many meetings: People are creating meetings that are not really needed.

  • Too many participants: Too many people are being invited to the meetings.

In both cases it is extremely difficult for the meeting organizer to find a time slot in which all the participants are free. Then, you will eventually be invited to meetings during your “busy” time. If your company has such problematic meeting behavior, you must discuss that with your management and your peers. That’s not something that you can solve personally using any individual technique.

Finally, you should avoid as much as possible to use the “suggest alternative time” option when replying to a meeting invitation. This should be done only in unforeseen situations, for example when there is an emergency and you will no longer be able to participate in a meeting that you had already accepted. If you know that you will be busy at a certain time, you should make it explicit in your calendar as early as possible.

So good luck with your self-meetings, I hope this technique will help you become more productive.

You may also want to read my previous post about Super-Productivity.

I will be happy to hear your comments!

Posted in Efficacy | Tagged | 4 Comments

The Seven Rules of Effective Communication

In every professional environment, it is essential to communicate effectively with your peers. This is particularly true during meetings, in which people expect to discuss a subject, reach conclusions and make related decisions in a short time. Here are seven rules of effective communication:

1. Respect Experience and Seniority

As I’ve discussed in a previous post, there is a very important difference between knowledge and experience. Sometimes it’s hard to believe, but most people reach senior positions through real competence and accomplishments. Thus you should always listen carefully to what the veterans have to say, even if it appears to be wrong. Most probably they can see something that you can’t, so if you disagree with their opinions first ask them to justify their point.

2. Don’t Interrupt the Speaker

If you are participating in a meeting, you should be very interested in understanding what the other participants have to say. But by interrupting others you are not giving them the opportunity to clearly communicate their opinion. This is first of all a sign of disrespect that may cause bad feelings. But interrupting others also gives them the right to interrupt you, creating a chain-reaction with very negative consequences.

3. Think Before You Answer

Of course we must think if we are not sure about the answer, but we must also think even if we could answer immediately. When participating in a meeting, we are not only interested in expressing our views, we must also be able to explain and justify our opinions. Especially when we know in advance that someone may disagree with us, we need to think about how to present our ideas in a clear and solid way.

4. Focus on the Subject

For meetings to be effective we must focus on the topic being discussed. There is a limited amount of time available to reach a conclusion, and we do not want to waste this time with parallel issues. If there are other important topics that need to be discussed they should deserve their own meeting. Thus when answering  to someone always address directly the question, and never ask questions that are not related to the discussion.

5. Organize Your Speech

When answering a question you should define your priorities. Say the most important things first, and add more comments only in the case they are necessary. If you were asked several questions, answer them in the same order they were asked. Also, answer each question separately. It will be much easier for the other participants to understand you if you present your thoughts in a clear order.

6. Accept that You Don’t Know Everything

If you are asked a question for which you don’t have a good answer, it’s perfectly natural to say that you simply don’t know. Of course you should know the answer for any question directly related to your personal tasks. But when the topics being discussed are related to the work being done by teams of people, you’re not expected to know all the details.

7. Don’t Argue the Facts

You should have your personal opinion about all the important issues being discussed. This is the contribution that the other participants expect you will bring to the meeting. You should know how to explain and justify your opinions. But you should also know how to stop debating when you are presented with new facts that clearly contradict your view.

Conclusion

What do you think about these rules? Do you agree with them? Do you think that if people followed these simple rules their communication would be more effective? And what if I told you that these seven rules where written more than 2000 years ago, in a Jewish book of ethics called Pirkei Avot?

From Pirkei Avot, Chapter 5:

“There are seven things that characterize a boor, and seven that characterize a wise man. A wise man does not speak before one who is greater than him in wisdom or age. He does not interrupt his fellow’s words. He does not hasten to answer. His questions are on the subject and his answers to the point. He responds to first things first and to latter things later. Concerning what he did not hear, he says “I did not hear.” He concedes to the truth. With the boor, the reverse of all these is the case.”

Yes, technology has changed a lot in the last 2000 years, but it seems that human nature remains the same.

I hope you have enjoyed this post and will appreciate to hear your opinion, please leave your comments below.

Posted in Efficacy, Jewish Sources, Psychology of Programming | Tagged , , | 4 Comments

Code Swarm: Visualizing the Evolution of Software Systems

Software systems grow over time. They evolve through additions, extensions and modifications. A successful application is not one that satisfies all the original requirements and then is delivered to its users and remains unchanged. If people are using a system, they will require it to be changed. They will have ideas about new features and capabilities that were not originally planned, and will feel that they really need them. Of course users also find bugs that need to be fixed, but this kind of maintenance is actually a small effort when compared to the addition of new functionality. Thus, if a system is not evolving it is because it is not being used, and if a system is being used it certainly will need to evolve.

Now the question is: How do systems evolve?

For a particular system, we can ask specific questions:

  • What parts of the system are being changed more frequently?
  • How the total number of files is growing over time?
  • How the work is being distributed among the software developers?
  • Are there developers that contribute more than others?
  • Is there an “ownership” relationship between developers and software components?

The answers for these questions can be obtained by analyzing the history of the software repository. Every commit represents a change done by a particular developer in a specific file. A commit also means the existence of a relationship between a programmer and a file at a particular moment in time. This relationship may continue for a period of time, if the same person makes several successive changes on the same file.

But for big systems it may be difficult to summarize all this information in order to understand how the system is growing and being changed. Thus, it would be very nice if we could visualize graphically the evolution of software systems. And this is exactly the concept behind Code Swarms, as idealized by Michael Ogawa:

This visualization, called code_swarm, shows the history of commits in a software project. A commit happens when a developer makes changes to the code or documents and transfers them into the central project repository. Both developers and files are represented as moving elements. When a developer commits a file, it lights up and flies towards that developer. Files are colored according to their purpose, such as whether they are source code or a document. If files or developers have not been active for a while, they will fade away. A histogram at the bottom keeps a reminder of what has come before.

For an example, see below the Code Swarm for Twitter:

It is interesting to note how a small number of developers play a very central role in the evolution of Twitter, changing a large quantity of files during a long period of time. It is also interesting to see that other developers join the project, give a relatively small contribution, and then “fade away”. Of course here we can only observe the number of files being changed, and not the size of the contribution in lines-of-code (LOC) neither the complexity of the code being added or modified. But even so it is clear that a few programmers are “hubs” while others are in the periphery.

I really find this useful, and intend to run Code Swarm for the systems I’ve developed recently with my colleagues at work.

I will appreciate to know what you think about this idea of Code Swarms, please leave a comment below.

Posted in Software Evolution | Tagged | 2 Comments

Communication Problems in Software Projects

The cartoon above is the best illustration I know for the so usual communication problems in software projects. This difficulty to capture the customer needs and correctly translate them in the form of requirements, design and working code is one of the main motivations for the methodology of Agile software development.

As I discussed in a previous post, I believe in iterative methods and fast prototyping. I have been applying this approach in all my projects in the last years, and I’m very happy with the results. Among the benefits, I have been able to deliver more frequently and adapt more easily to changing requirements.

Thus, if you are frustrated with your current development lifecycle, you should know that there are alternatives, and try them. Then, perhaps this cartoon will become a thing of the past…

Posted in Agile, Requirements Specification | Tagged , | 2 Comments

How to find the best candidates without interviews

Interviewing candidates for a job is a very expensive process. If your intention is to hire only the best people, as it should be, you will probably have to interview dozen of candidates until you find one good match. And this of course is after the screening process, in which the potential candidates were already selected through careful analysis of their skills and experience, and perhaps other filtering mechanisms such as phone interviews.

What is the cost of each interview? There is the obvious cost of the interviewers’ time, including their preparation before the interview and the time spent writing their conclusions after it. Companies differ in their selection methods, but in general the entire hiring process will always include a series of interviews with people with rising levels of seniority. Thus, to find one good match, the people involved with the hiring process need to invest dozens of work hours, many of them dedicated to candidates that will be rejected. Clearly, we would like to make this process more effective, both to save money and to make it less frustrating for all the people involved, including the interviewers and the candidates.

There is an additional cost if the candidates are coming through job placement agencies. In this case, the agency will normally get one full month of salary for each candidate that is hired. Of course it would be much more cost-effective if we could attract good candidates without the help of these agencies. Better yet, it would be great if we could get the interest from people who are not actively looking for work. We want to hire the best people, but the best people normally already have good jobs and are happy with them. Unfortunately, the truth is that the pool of people actively looking for work is below average, either regarding their skills or experience.

To summarize, we would like a hiring process that:

  • Is extremely cost-effective.
  • Requires a minimum number of personal interviews.
  • Is able to attract good candidates without the help of placement agencies.
  • Is able to attract good candidates that are not actively looking for a new job.

This is exactly what was idealized by Hola, an Israeli Internet start-up. They have created a promotion in which software developers have to solve a programming challenge in order to win money prizes. A programmer submitting a “perfect” solution gets the top prize of 2000 Shequels (~500 US dollars). Their idea is viral since people can also win prizes if they forward the challenge to their friends, and if their friends solve it. If you are a programmer, you can try their challenge.

According to Ofer Vilenski, Hola’s CEO, several hundreds of Israeli programmers already tried to solve the challenge, but only a few were able to do it perfectly. These few ones that won the prize are considered by Hola to be top programmers, exactly the kind of people they would like to hire. The entire process so far cost to them only a few thousand Shequels, plus the time required to check the solutions, which they claim is very small for each solution. The prize winners are being invited for interviews, even if they were not actively looking for a job.

I’m personally very impressed with the efficacy of this model, which is also very original. But I’m not sure if I would consider adopting it in the future. As I said in a previous post, I believe in the importance of soft skills, but that cannot be measured in a programming challenge.

What do you think? I will be glad to hear your opinion about this idea. Please leave a comment below.

I also invite you to check my previous posts about the hiring process. And if you are a candidate looking for a job, I wish you good luck!

Posted in Hiring | Tagged | 4 Comments

An Interview Question for Fresh Graduates

Hire Me!It is extremely difficult to evaluate a candidate in a job interview, and even more difficult if this candidate is a fresh graduate. In this case we can talk about his grades, the courses he took and the projects he did during his studies. But we cannot learn from his previous experience. Of course we can focus on his soft skills or his problem-solving abilities, but we still need to predict his performance doing a job that requires specific technical skills.

In the case of software developers, we would like to predict if the candidate will be an effective programmer and a good team member. As I’ve written in a previous post, I believe that nothing is more effective than enthusiasm. Then, the question becomes: Will this candidate enjoy being a programmer? Will he be enthusiastic about his tasks?

I believe this question is extremely relevant today, because software development became a popular profession with very high salaries. In the past, people wanted to study Computer Sciences because they really were interested in working with computers; they were very technical-oriented and liked Math. But unfortunately today it is very common to meet students that chose Computer Sciences just because they know that it will be easy to find a good job with a great salary. And I say “unfortunately” because if these students do not really enjoy programming they will not be happy in their future jobs.

Thus, when interviewing the fresh graduate, we want to know: Is this guy of the first kind, the one that always loved computers and has a passion for programming? Or is he of the second type, the pragmatic that chose his faculty with the goal of finding a good job afterwards, but without any special attraction to algorithms and data structures?

Malcolm Gladwell, in his book “What the Dog Saw”, has a chapter entitled “Most Likely to Succeed” in which he discusses the challenge of hiring the best candidate. He mentions one corporate recruiter who used to ask the question “Give me a typical day”. I think this question is excellent, especially for fresh graduates, and I can imagine it in an interview:

Interviewer: “Please describe your typical day.”

Candidate: “I wake up at 7:00. I arrive at my first class at 8:00 and then I’ve classes until 12:00. I eat lunch with my friends, and then I spend the afternoon doing my home works or projects. Sometimes I need to go to the library or to a computers farm in the faculty. Around 18:00 I go either to the gym or to the swimming pool. When I come back home I have dinner and then I watch TV or surf the Web until I go to sleep around 11:30.”

Interviewer: “And when do you code?”

Candidate: “Well, I normally have projects in which I have to code, and some of my home works also require some programming.”

Interviewer: “Sure. But when do you write your own programs?”

If a candidate presents himself as a programmer, I expect him to have his own pet projects, besides home works or projects he had to do during his studies. Today there are many platforms that allow programmers to develop interesting ideas with relatively small effort: Web sites, Facebook games, iPhone or Android apps. These are examples of applications that can be implemented by a single person working during his free time. And of course there is also the option of contributing to a much greater project as part of an Open-Source effort.

If you are a fresh graduate, perhaps you got a nice diploma, but if you do not have any personal project I doubt you truly enjoy programming. And since I believe that you must really have fun coding to be a great programmer, I’m sorry, but if you do not have pet projects I would not hire you.

You may want to take a look in my other posts about the hiring process.

Feel free to leave a comment or question, and good luck!

Posted in Hiring | Tagged | 7 Comments

IASA Israel meeting about TRIZ

The first activity of the International Association of Software Architects in Israel in the year of 2012 was a meeting about TRIZ – The Theory of Inventive Problem Solving.

We had an introductory talk by Ido Lapidot, TRIZ expert at Intel Haifa, followed by a panel with other TRIZ specialists to discuss the applications of TRIZ in the industry.

Our invited speakers were:

Ido Lapidot: Directed Evolution and Systematic Innovation Expert (TRIZ) at Intel Strategic Planning Group.

Vladimir Petrov: TRIZ Master, President of the Israeli TRIZ Association and VP R&D at Innovation Technology.

Shadi Saba: Senior Research and Design Automation Team Manager at Intel Corporation.

This meeting was sponsored by SAP Labs Israel.

If you would like to be informed about our next meetings, please join IASA Israel group on LinkedIn.

You can watch below Ido Lapidot’s talk about TRIZ and its applications (in Hebrew):

Introduction to TRIZ: Theory & Practice from Michael Kalika on Vimeo.

Posted in IASA Israel | Tagged | Leave a comment

Separation of Concerns

The most important principle in Software Engineering is the Separation of Concerns (SoC): The idea that a software system must be decomposed into parts that overlap in functionality as little as possible. It is so central that it appears in many different forms in the evolution of all methodologies, programming languages and best practices.

Dijkstra mentions it in 1974: separation of concerns … even if not perfectly possible is yet the only available technique for effective ordering of one’s thoughts”. Information Hiding, defined by Parnas in 1972, focuses on reducing the dependency between modules through the definition of clear interfaces. A further improvement was Abstract Data Types (ADT), by Liskov in 1974, which integrated data and functions in a single definition.

In the case of Object Oriented Programming (OOP), encapsulation and inheritance proved to be essential mechanisms to support new levels of modularity. Design-by-Contract, proposed by Meyer in 1986, provides guidelines of how to improve interfaces using pre-conditions and post-conditions. Finally, the separation of cross-cutting concerns is the most important motivation for the proponents of Aspect Oriented Programming (AOP).

Since the first software systems were implemented, it was understood that it was important for them to be modular. It is necessary to follow a methodology when decomposing a system into modules and this is generally done by focusing on the software quality metrics of coupling and cohesion, originally defined by Constantine:

Coupling: The degree of dependency between two modules. We always want low coupling.

Cohesion: The measure of how strongly-related is the set of functions performed by a module. We always want high cohesion.

All methodologies try to reduce coupling and increase cohesion. Information Hiding reduces coupling by isolating the details of the implementation of state. ADTs reduce coupling by defining clear and abstract interfaces. An ADT that specifies in a single definition the set of functions that can be executed on a type is certainly more cohesive than a global data structure that is modified by external functions.

OOP adds another step in the reduction of coupling with the enforcement of encapsulation and the introduction of dynamic binding and polymorphism. Inheritance allows us to increase cohesion by defining hierarchies based on generalization and specialization, in which we can separate the functionality that belongs to the superclass from its subclasses. AOP provides a solution for the problem of cross-cutting concerns, so that both the aspects and the affected methods may become more cohesive.

There are many benefits that software developers expect to obtain when making a system more modular, reducing coupling and increasing cohesion:

Maintainability: A measure of how easy it is to maintain the system. As a consequence of low coupling, there is a reduced probability that a change in one module will be propagated to other modules. As a consequence of high cohesion, there is an increased probability that a change in the system requirements will affect only a small number of modules.

Extensibility: A measure of how easily the system can be extended with new functionality. As a consequence of low coupling, it should be easier to introduce new modules, for example a new implementation for an existing interface. As a consequence of high cohesion, it should be easier to implement new modules without being concerned with aspects that are not directly related to their functionality.

Reusability: A measure of how easy it is to reuse a module in a different system. As a consequence of low coupling, it should be easier to reuse a module that was implemented in the past for a previous system, because that module should be less dependent on the rest of the system. Accordingly, it should be easier to reuse the modules of the current system in new future systems. As a consequence of high cohesion, the functionality provided by a module should be well-defined and complete, making it more useful as a reusable component.

As software developers, after we recognize the importance of SoC, we need to apply this principle in at least two ways: Understanding the power of our programming language tools and patterns, and learning how to evaluate and compare different designs in terms of coupling and cohesion.

Tools: For each mechanism in the programming languages we use, we should understand how it can be applied to reduce coupling and increase cohesion. For example: How encapsulation, dynamic binding, polymorphism and generic types can be used to separate concerns? Similarly, for each Design Pattern, we can analyze how it helps to make a system more modular.

Designs: When evaluating and comparing our own design alternatives, it is always useful to think in terms of coupling and cohesion. Sometimes a design seems to be more complex than others, but this may be a consequence of a better separation of concerns, with fewer dependencies between modules through the definition of additional layers. Another design may at first appear to have too many classes, but this may be an advantage if each class becomes more cohesive.

Producing effective software designs requires lots of experience, but principles such as the Separation of Concerns are essential to perform a great work. So reduce coupling, increase cohesion and good luck!

Posted in AOP, Design Patterns, OOD, OOP, Software Reuse | Tagged , , , , | 52 Comments

Events for Software Developers in Israel

Something very nice is happening in the Software Development Community in Israel: People are organizing meetings to share their knowledge, but not only with their colleagues in the workplace – these are meetings open to the public, including engineers from “competing” companies. I personally think that this strong sense of community and this desire to share knowledge and experience is a wonderful characteristic of the Israeli hi-tech industry, well described in the book “Start-up Nation“.

I am myself one of the co-founders of the International Association of Software Architects in Israel (IASA IL). We are organizing an event next week, focused on TRIZ – the Theory of Inventive Problem Solving. The meeting will include an introductory talk about TRIZ, followed by a panel to discuss its applications in the industry. Our speakers are Ido Lapidot and Shadi Saba, from Intel Haifa, and Vladimir Petrov, president of the Israeli TRIZ association. You can register in the event. You can also join our LinkedIn group.

Another very active group is the Software Craftsmanship in Israel (SCISR), leaded by Uri Lavi. They are having their 10th meeting this week, with the special participation of Corey Haines. The meetings organized by SCISR are extremely popular, and if you don’t register fast you will surely find yourself in the waiting list.

The ILTechTalks initiative, organized by Ori Lahav, has as its goal to “facilitate knowledge and experience exchange between Israeli tech professionals”. They have a rich list of very interesting talks, with highly qualified speakers that volunteer to present these subjects in your own company.

The Agile community in Israel also became very active in the last couple of years. They have several groups on LinkedIn, in which you can always find interesting blog posts. They are organizing a great two-day event next week, the Agile Practitioners 2012 Conference, with the participation of Gojko Adzic, David Evans and Corey Haines. There will also be talks by several of the leading members of the Agile movement in Israel.

Besides the opportunity to exchange knowledge and experience, these meetings are the best places to socialize and increase your network. In a recent article at the Fast Company, Kevin Purdy talks about the importance of the Third Place:

“The First Place is your home, and the Second Place is your office. You have assigned roles and tasks at each place, and you know nearly all the people in each. The Third Place is where you meet with people you don’t know that well, or maybe at all, and you exchange ideas, learn about other people, and enrich society and yourself.”

 So don’t miss these events! Hope to see you there!

Posted in Agile, IASA Israel, Israel | Tagged , , | 1 Comment