# Tuesday, August 4, 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, July 26, 2011 8:22:09 AM (GMT Daylight Time, UTC+01:00)
Thanks for sharing. What a pleaurse to read!
Wednesday, July 27, 2011 6:12:34 PM (GMT Daylight Time, UTC+01:00)
Z6yFef , [url=http://iaihethhmcqw.com/]iaihethhmcqw[/url], [link=http://qidlowgwefvk.com/]qidlowgwefvk[/link], http://lejckquankqs.com/
Wednesday, July 27, 2011 6:12:51 PM (GMT Daylight Time, UTC+01:00)
5J1t1T , [url=http://vlitreuefbtn.com/]vlitreuefbtn[/url], [link=http://jxxvcvdowsjj.com/]jxxvcvdowsjj[/link], http://umganwntyocp.com/
Saturday, July 30, 2011 1:59:54 PM (GMT Daylight Time, UTC+01:00)
xM53Oq , [url=http://pldfzubjsfdf.com/]pldfzubjsfdf[/url], [link=http://gqeegfwfyhfh.com/]gqeegfwfyhfh[/link], http://rmeipaecpenl.com/
Friday, December 7, 2012 7:16:42 AM (GMT Standard Time, UTC+00:00)
Trying to use this code in a very long-running CGI script as a viasul confirmation that the script is not hung. Script flushes its output repeatedly in order to insure Apache server serving it out does not time out waiting for the CGI script to complete.CGI initially outputs manual progress bar setup early in the page, and as soon as that part paints, I want the 0% bar to be visible. manualPB2 = new JS_BRAMUS.jsProgressBar( $( element1 ), 0, {animate: true,showText: true,barImage: Array( images/bramus/percentImage_back4.png', images/bramus/percentImage_back3.png', images/bramus/percentImage_back2.png', images/bramus/percentImage_back1.png'), } );CGI next outputs two separate AND EMPTY lists side-by-side.CGI then loops thru a list of several hundred data items and uses JavaScript to write elements to one or the other of the lists. This fills in the lists, and that part WORKS and no, I'm not asking for help on that part. On each loop thru the data, the CGI script calculates the current percentage completed, and when it outputs the newest element, it also outputs a call to your setPercentage() function to set the percentage complete.For example:setSelectOption( UL-DLT-SERVICE-MGT', LEFT_SIDE');myJsProgressBarHandler.setPercentage( element1 , '70 );setSelectOption( UL-DLT-SERVICE-TEAMS', RIGHT_SIDE');myJsProgressBarHandler.setPercentage( element1 , '73 );So as the select lists fill in, the progress bar increments.BUT The progress bar doesn't seem to move at all until all the writes in the loop are output, and then it starts producing incredibly large NEGATIVE values for the percentage and looping, filling in the bar RIGHT to LEFT (the negative?). In the past 25+ minutes it's made it to -73K and still going strong.What am I doing wrong?
Sunday, December 9, 2012 1:09:04 PM (GMT Standard Time, UTC+00:00)
eetwJf , [url=http://oeedixbpjrmd.com/]oeedixbpjrmd[/url], [link=http://yznqtvvvrhlf.com/]yznqtvvvrhlf[/link], http://wkecyspplmam.com/
Wednesday, December 12, 2012 3:08:29 AM (GMT Standard Time, UTC+00:00)
yaeTBl , [url=http://krykahebpwvy.com/]krykahebpwvy[/url], [link=http://lmescfpdusar.com/]lmescfpdusar[/link], http://nofuosbeyzze.com/
Comments are closed.