# Tuesday, 04 August 2009

Back To Basics

What is OOP?

Most people think of their business systems in terms of the interactions of people, institutions and systems. When describing a system, they often speak in terms of these interactions between entities. For example, they may describe how a customer communicates order information to a salesperson that inputs this information into an Order Processing program. Describing entities and defining how those entities interact with one another maps very well to Object Oriented Programming (OOP). OOP is a programming paradigm that focuses on the objects in a software system and the messages passed between those objects.

Object Oriented Programming is not a new concept. The ideas behind it were first published in the 1960s and the SmallTalk language, developed in the 1970s, formalized many of the programming constructs used in this paradigm. However, OOP gained popularity in the 1990’s with the increased use of the C++ and the last ten years have seen an explosion in object-oriented languages C#, Visual Basic.Net and Java.

In earlier programming models, a program was viewed as a set of methods or subroutines. A main method would call one or more subroutines that might each in turn call other subroutines. Each subroutine would complete its task and return control to the method that called it. Using this approach, developers viewed their programs as a set of tasks. These tasks became central to their application design.

Managing Complex Systems

It was difficult to manage complexity in this task-oriented approach to programming.

For example, one couldn’t be certain that a subroutine would not substantially change variables, files and other parts of the environment. The only way to know for sure was to examine that subroutine in detail to learn how it worked. In fact, you would need to also examine any subroutines called by that subroutine, to verify that they didn’t cause any unexpected side effects.

Another complexity arises because there tends to be a tight coupling between the subroutines. Changes to a subroutine often require changes to any routine that called it, making maintenance difficult.

Often in such systems, you find code duplicated in multiple places. Making a fundamental change to how a rule is implemented requires changing code several times – another maintenance difficulty that adds to complexity.

The Development process itself adds to the complexity of writing software. On most projects, we need to consider how to divide development tasks among team members; merge this code together; manage code deployment; test code modules independently and together; deploy updates to our application; and fix errors as they are found. The entire process can be quite complex, particularly if all our modules are tightly bound together.

Finally, we cannot ignore the fact that many of the problems we are trying to solve are complex. This complexity is often our motivation to automate these problems in the first place. Anything we can do to mitigate that complexity – such as splitting a problem into manageable components – will assist us in building a solution.

OOP attempts to address these challenges by focusing on objects instead of tasks. The whole goal of OOP is to manage complexity. This is done by splitting a complex system into manageable, independent pieces and only exposing enough of each piece to allow other objects to work with it. Much of the complexity of the object can be hidden from the outside world, making the system as a whole easier to understand.

The following basic principles help to accomplish OOP’s goal of managing complexity.

  • Inheritance
  • Abstraction
  • Encapsulation
  • Polymorphism
  • Decoupling

The above concepts are interrelated in that some are used to accomplish others. In a later article, we will dive into more detail about each.

Before we can do that, it’s important to understand the basics of objects before you can grasp Object Oriented Programming.

Next: Intro to OOP, Part 2: Understanding Objects 


Thanks to Chris Woodruff, who contributed to this article.

Tuesday, 04 August 2009 14:23:52 (GMT Daylight Time, UTC+01:00)
# Monday, 03 August 2009

Episode 39

In this interview, Jamie Wright, president of BrilliantFantastic Consulting describes how he has applied the Getting Real software development process from 37 Signals to his own consulting practices.

12 mins, 39 secs

Monday, 03 August 2009 10:58:51 (GMT Daylight Time, UTC+01:00)
# Thursday, 30 July 2009

NPlus1 is an organization designed to assist architects and lead developers and those aspiring to these roles.

The organization began last year with the launch of the NPlus1.org web site. This site features articles written by and for architects; links to screencasts and other resources; and announcements of upcoming events.

Recently, NPlus1 decided to expand its reach by organizing events of its own.  One of these events - the Architecture Summit - takes place Friday July 31 at the Microsoft office in Southfield, MI.  This event will feature three topics: "Introduction to Object Oriented Programming"; "Software Patterns"; and "How I Learned to Love Dependency Injection". The first topic is optional, as it is aimed at those who are new to Object Oriented Programming and, therefore might struggle with the concepts presented in the other two presentations.

I will be delivering the first two presentations (Intro to OOP and Software Patterns) while James Bender will deliver the Dependency Injection presentation.

It is not too late to register for this event and you can do so at https://www.clicktoattend.com/invitation.aspx?code=139245

Thursday, 30 July 2009 16:00:45 (GMT Daylight Time, UTC+01:00)
# Wednesday, 29 July 2009

Episode 38

I have been a fan of TechSmith products for years.
In this interview, TechSmith Chief Evangelist Betsy Weber describes the products offered by her company and the uses of those products.

13 mins, 13 secs
Wednesday, 29 July 2009 14:57:56 (GMT Daylight Time, UTC+01:00)
# Tuesday, 28 July 2009

Michael Eaton slumped in his chair and allowed his arms to fall to his side. Ten minutes earlier, he had been rushing up the stairs to find a designer to help out a team in need.  But now, relaxing in a quiet room with the door closed, the lack of rest began to catch up to him.  Two hours sleep Friday night on a classroom floor with a coat for a pillow seemed an appropriate way to cap off months of preparation for the 2009 Ann Arbor Give Camp.

Michael EatonIt was Saturday afternoon and the 3-day camp was about half over, but every indication pointed to a successful event. Sixty developers descended on Washtenaw Community College (WCC) and were huddled together in teams - furiously designing and writing code for charities. Many representatives of these charities were on hand, providing clarification of requirements or content or moral support.  In all, the teams were supporting eighteen charities. They wrote web sites and contact management systems and various pieces of software that the charities would be unlikely to afford on their own. They donated their weekend because they believed in this cause.

It was going well.

So, of course, I asked Mike about next year.

"Fifty charities", he insisted.  Fifty is nearly triple the number of charities helped this year, but Mike was determined to make it happen.

As he spoke about this, his energy returned. He talked of lessons learned and how to handle the scale for next year.  One key is to get started planning earlier - within the next few weeks. The goal is to get the charities and developers lined up early next year in order to be ready for the Give Camp in July. Bringing back the same planning team is important, he said. This year, Mike drew heavily on the knowledge of Jennifer Marsman, who organized last year's Give Camp.

He had already spoken with WCC and reserved their conference center - a building with facilities and rooms large enough to accommodate the hundreds of developers needed to support 50 charities.

Mike talked about the challenge of picking teams. Identifying appropriate skill sets was difficult, given that there were a lot of people unknown by the planning team.  Next year, he plans to gather more specific information from each developer in order to better evaluate their experience and place them on the correct team.

Mike stopped short of committing to take charge of next year's Give Camp, but it was clear from his enthusiasm that he wanted to be heavily involved. He did not hide his passion for what everyone was doing this weekend.

The energy of this event was infectious. A developer in Phoenix, AZ plans to put on a Give Camp in his area, so he flew to Michigan to experience one for himself and learn what worked.  WCC donated the facilities and accommodated the numerous requests they had over the weekend.

In the end, the 2009 Ann Arbor Give Camp was a great success. Sixty developers joined together to write code to help out eighteen charities. People worked hard and slept little and learned a lot and had fun and made the world a better place. Charities came away excited by their new software and inspired by the time committed by the development community in Michigan.

This can only increase excitement for next year.

Give Camp volunteers. Click for full-size photo.

More photos

Tuesday, 28 July 2009 14:25:54 (GMT Daylight Time, UTC+01:00)
# Monday, 27 July 2009

Episode36

Martin Shoemaker is the UML Guy.
In this interview, Martin explains what UML is and how to use it to improve your development process.

25 mins, 45 secs

Monday, 27 July 2009 18:30:01 (GMT Daylight Time, UTC+01:00)
# Friday, 24 July 2009

Next week will be a busy one for me. I wrap up my current billable project on Monday and I need to prepare for Friday and Saturday when I will present three different talks in two cities on two days.

In addition, I am scheduled to speak at the October meeting of the Microsoft Developers of Southwest Michigan.  Sadly, a death in my family forced me to postpone last week's MEF talk at the West Michigan .Net User Group. Thank you to Jeff McWherter for filling in on short notice.

Date                  Event Location Topic Description  
Fri. July 31 NPlus1 Architecture Summit Microsoft office, Southfiled, MI An Introduction to Object Oriented Programming
Are you new to OOP? Do you want a refresher on the benefits of Interfaces and the differences between implements and extends? The morning session is a two hour introductory course of Object Oriented Programming. If you are new to OOP the lessons in this session will prepare you for the more advanced topics in the afternoon. link
Fri. July 31 NPlus1 Architecture Summit Microsoft office, Southfiled, MI Software Patterns
Patterns are an important tool to use as architects and developers. They provide a common vocabulary for us to design with, as well as a common approach to a common problem. Come learn about useful patterns, and how to use them in your everyday code. link
Sat Aug 1 Lansing Day of .Net Breslin Center, Michigan State University Using Microsoft Distributed Cache to speed your application
Retrieving data from a disc or a database can be a time-consuming operation. Data that is accessed frequently can be stored in an in-memory cache, which can speed up its retrieval considerably. Microsoft Distributed Cache (aka “Velocity”) provides a framework for storing and managing cached data. In this session, we will discuss how to use this framework in your application and demonstrate some code that implements this framework. link
Thu Oct 22 Microsoft Developers of Southwest Michigan TBD, Kalamazoo, MI Using Microsoft Distributed Cache to speed your application
(see above) link

 

Friday, 24 July 2009 18:08:56 (GMT Daylight Time, UTC+01:00)
# Wednesday, 22 July 2009

Episode 35

In this interview, Jesse Murray shares his opinions on how to implement SharePoint solutions "the right way".

17 mins, 52 secs

Wednesday, 22 July 2009 03:15:42 (GMT Daylight Time, UTC+01:00)
# Monday, 20 July 2009

Episode 37

I spoke with Michael Eaton halfway through the 2009 Ann Arbor Give Camp. We talked about what went into this year's event and his ambitious plans for next year.

19 mins, 21 secs

Monday, 20 July 2009 03:54:10 (GMT Daylight Time, UTC+01:00)
# Wednesday, 15 July 2009

Episode 34

Brian Genisio is developing Silverlight and WPF applications using the Model-View-ViewModel pattern. In this interview, Brian describes the pattern and how to use it.

8 mins, 56 secs

Wednesday, 15 July 2009 07:07:45 (GMT Daylight Time, UTC+01:00)