Articles Archive
Articles Search
Director Wiki
 

the Object Oriented Paradigm Shift

February 5, 1998
by Paul Hemmer

Copyright 1999, Copyright © 1999, Navistream Corporation.

Sipping his third cup of coffee before 9:30, Johnny awaits instructions from his boss. Johnny's boss hasn't yet told him what to do this morning. He finished with his last assignment, so he's got some time to sit around and surf the net while he waits. This isn't a problem though. Johnny's boss - lets call him Johnny's boss, hired Johnny for a reason. Something about his résumé and his interview told Johnny's boss that he'd be a useful asset to the company. You see, Johnny is a skilled professional. He's been working in his field for several years now, and he knows what's up. Johnny has a very refined skill set. He knows what he can do, and his boss and co-workers know what he can do. More importantly, Johnny's boss can get Johnny to do what he does best by simply asking him to get started on it. All Johnny's boss needs to do is give Johnny whatever materials he needs to get started and off he goes (as long as the coffee machine is still working.) Make no mistake, Johnny's boss knew what he was getting into. He was looking for a very specific quality in an employee when he interviewed Johnny. Because Johnny fit the job requirements perfectly, he was hired.

Let's leave Johnny to his coffee for the time being. Fred, Johnny's cube neighbor needs some attention. Fred is a unique individual. Fred may work right next to Johnny, but they do very different things. See, Johnny's boss didn't hire Fred to do the same job that Johnny does. No, Johnny's boss hired Fred because he saw something new and unique in Fred which would certainly be an asset to the company. Fred can do some pretty cool things, things nobody else can do, things nobody else really wants to do. Nobody is really sure just how Fred does what he does, they just know what he can do, and that he's really good at it. Really good at it. Nobody second guesses Fred's ability to complete a task, because Fred's abilities have been refined and time tested. Like Johnny, if Fred is provided with the proper materials, the task will be completed as expected.

There's one more guy who is just begging for some attention at this point. Ted is his name. Ted is one of those intern employees. Like Johnny and Fred, Ted has a certain set of skills which he was hired for. As an intern, he is there to assist Johnny and Fred. Why do Johnny and Fred need help? Well, they don't really, they could both be doing the things that Ted does, but might as well make use of the intern and get Ted working on the things that Johnny and Fred would ordinarily do individually and redundantly. This is a benefit to Johnny's boss, because Ted doesn't require as much money as Johnny or Fred, and therefore Johnny's boss thinks it's efficient to have Ted the intern do some of these things. Johnny's boss is just thinking about long term efficiency. He also thinks it's pretty cool to give this young guy a chance to enter the exciting world of this special company.

Well, as far as the other people who work for this special company, Johnny's boss took a lot of time reading résumés and doing interviews to select people whom he thought would provide the most efficient and robust work force to his special company. You see, there is a lot involved in the day to day operations of this special company. Johnny's boss knew that, and so it was absolutely vital to the success of his special company that he had the most robust, reliable, and efficient work force he could possibly assemble. Johnny's boss was a visionary, a designer of sorts. He could envision the day to day operations of his special company even before he hired his first employee. Day to day operations involved everything from the most important corporate functions of the special company, to controlling the lights at each individual cubicle. Johnny's boss refused to skimp on even the smallest of details. He wasn't about to dampen the efficiency of his highly refined corporate environment. He also refused to use "quick fixes" on the "less important" details when making changes. This would defeat the purpose of his designing his company in such a manner. Also, he certainly would not stand for more than one person performing the same task. Johnny's boss scoured the details of his employees everyday tasks looking for commonalties for which he could hire a new person to do. By doing this, he was able to reduce the amount of "wasted effort" among the individual employees. How? By finding an individual who would do nothing but those common tasks. Ted the intern is a good example.

Stepping back for a moment from what Johnny's boss did to design his special company, we can take in the bigger picture of how this special company will work. Clearly there is a powerful and well defined system underlying this special company and it's daily operations. We have to give credit here to Johnny's boss. He's the one who sought specific skill sets and specific groups of skill sets to design the underlying structure of his special company. Back to Johnny. Johnny's boss can assign a task to Johnny. Part of what Johnny's task entails is not specifically related to Johnny's area of expertise. However, Johnny knows his cube neighbor Fred pretty well. That is, Johnny knows exactly what Fred can do and what Fred needs to do it. Johnny can pass off part of his task to Fred. As long as Johnny gives Fred what he needs to do his job, Fred will be happy to do the job and Johnny and his boss can both rest-assured that the task will be completed.

Let's forget about Johnny and Fred for the moment, they are on a coffee-break right now. There are lots of other employees in this special company. People like Mike, Susan, Joe, Patricia, Bob, Larry, Patty, George and Heather have been hired for their unique skill sets. Bear in mind though, that not all these people have technical expertise. Mike was hired to keep track of the employees time. Yes, Johnny's boss requires that every employee punches in and punches out. However, it's a long walk from the production room to the time card room. Making everybody run all the way to the other side of the special company's campus takes time - valuable time. Johnny's boss thought it would be more efficient to hire a single person (Mike) to take care of punching everybody in and out. Sure everybody had to do this and everybody knew how to do it, but making everybody go and do it on their own was just not efficient. As long as everybody knew that Mike was waiting in the time card room to punch them in or out, and everybody had a way of contacting Mike, things were fine.

Johnny's boss is always innovating new things for his special company to do. However, when he decides to start a new division of his special company, he uses the same painstaking attention to detail and overall design when employing new individuals and purchasing new equipment. It is important to him (as well it should be) that the new employees and the new division are as efficient as the rest of his special company. If a new division requires new specific assets and skill sets to function, he painstakingly breaks the new tasks into more manageable tasks, and hires new individuals to perform those tasks. Notice that although these new employees will have to know about Mike the time card guy for example, they don't need to have anything to do with Johnny or Fred. Johnny and Fred are in a totally different division. What they can and can't do, and whether they are even at work or not makes no difference. Johnny's boss planned for this. He doesn't want to have to go back and make changes to the system he already has working and refined if he wants to add a new division to his company. Common sense you think? Johnny's boss is no genius, he's just intuitive.

One day Johnny's boss decided to computerize his time tracking methods. What does this mean for poor Mike the time tracker? Well, as far as anybody else in the special company is concerned, this means nothing. Johnny's boss planned for that too. Don't worry, he's not going to fire Mike the time tracker, he's just going to re-train him to work with a computer instead of a time card machine. All the employees in the company still need to tell Mike to punch them in and out. Johnny's boss predicted that individual sections of his special company would probably need upgrading, or change in the future. Johnny's boss knew from the start that when he decided to make changes in any particular area of his special company, he did not want that change to have an affect on the entire organization. Johnny's boss had designed the corporate structure of his special company such that he could change the way in which any individual performed his or her task without anybody else ever knowing the difference. By this, things would continue smoothly as planned, and the change could happen - invisible to the rest of the company. Again, common sense.

Johnny's boss certainly was a visionary. He designed a "new age" type of corporate environment. He was not concerned with the extra time it might take him to painstakingly design and hire his work force. He wasn't concerned with any overhead budget he might have to worry about when paying his employees. What he was concerned with, as we can see, was designing a robust and extendible workforce for his company which embodied long term efficiency, robustness and reliability. He had high hopes for his company. His visions were of the future, not the immediate task of actually starting the company.

Keeping Johnny's boss and his special company in mind, lets take a look at a completely different person in a completely different environment. We are now going to talk about Joe the Lingo Boy. Joe the Lingo Boy works for a computer software company. Joe the Lingo Boy considers himself a pretty good programmer. He's really excited because a new project just came at him. He's in charge of designing and programming the new super cool 3D killer Internet application which is going to be the flagship product for the company he works for. Joe the Lingo Boy is going to change the world with this application. His boss is excited that his super talented programmer is on the job. Joe the Lingo Boy gets started. Like many of Joe the Lingo Boy's peers, he sits down in front of a blank screen and starts typing. Thinking of all the wonderful things which his killer 3D Internet app is going to do, he starts piecing together functions to do this and functions to do that. Days go by, weeks go by and months go by. Joe the Lingo Boy has a whole lotta of code written. His super cool killer 3D Internet app is starting to look like something pretty cool.

It's time for Joe the Lingo Boy's quarterly review from his boss. "Great job" his boss says when he sees the beginnings of the new super cool 3D killer Internet app. Joe the Lingo Boy continues coding. Finally all the functionality seems to be in place and Joe the Lingo Boy starts testing his super cool killer 3D Internet app.

"Uh Oh, a bug" says Joe the Lingo Boy. "Better track it down huh?" Joe the Lingo Boy starts looking for the cause of the bug. Finding what's keeping it from working right, he decides the solution is to introduce a global variable to track the value of pSomeFooBarVariable across a movie. In doing so, he then finds that he has to go into a gazillion other functions and add this global variable, so that they will all reference it. If they don't, the application won't work at all. Joe the Lingo Boy runs his application, and his bug is fixed! But wait, there's a couple of new bugs. Joe the Lingo Boy fixes those too. Then his boss stops by and says "Oh cool! But can it do it like this instead of like that?"

"Sure" says Joe the Lingo Boy. Joe the Lingo Boy gets started changing that tiny little piece of functionality. It's Friday, but he'll be able to fix it in a jiffy, so he won't be late for his big date that night. Digging into the code, Joe the Lingo Boy realizes he has to add a couple of new functions and a couple of new global variables in order for the killer 3D internet app to work as his boss would like. "Damn" says Joe the Lingo Boy, that means I have to go back and change this and that, and then do this and do that and delete this function, and change another function. Joe the Lingo Boy did go home that night, but over the weekend, he "found himself" and decided to buy a motor cycle and join the circus. So much for Joe the Lingo Boy. His boss now has to hire a new programming wizard to come in a finish the super cool 3D killer Internet app. Having heard the latest buzzword "object orientation" the boss looks for résumés with that listed as a skill. He finds a women's résumé looks pretty good. Her name is Sally. Liking the fact that she is "object oriented", he hires her.

Sally gets started digging through Joe the Lingo Boy's code. After a few hours, Sally's boss comes over and asks how it's going. "I'm still trying to figure out this code" says Sally. "Ok" says the boss, keep at it. Sally eventually gets an idea of what is going on in this huge mess of incohesive and largely uncommented code. Being "object oriented as she is" she starts designing some Lingo objects to do the new stuff which she has to add to the super cool 3D killer Internet app. Now the system consists of a ton of procedures and functions, global variables (both used and unused), lots of lists and now some objects. Whew.. what a mess. But that's the nature of the beast known as programming right?

Meanwhile, our special company is seeing business as usual. They've hit the Fortune 500, and are now a global force in whatever it is that the special company does.

What does our special company possibly have to do with Joe the ex-Lingo Boy's super cool 3D killer Internet app? Well, as if it isn't obvious, tossing specifics and details out of mind for the time being, both the Fortune 500 company and the mess of parent scripts, global variables and procedures known as the super cool 3D killer Internet app are complex systems of functionality. The difference is, one is clean, understandable, reliable, extendible and fixable, whereas the other is not, and never will be. It makes no difference that one involves physical people and one involves computer programming. We came to the conclusion that Johnny's boss's use of painstaking attention to detail and efficiency of design down to the smallest detail for his company was common sense did we not? His company is built upon a foundation of specific components (employees) each with a specific set of tasks, and each has a clear understanding of what the other employees are capable of doing.

The corporate infrastructure was designed with the utmost respect for detail, efficiency and extendibility before the first brick was laid. If this is so obvious and common sense, then why would anybody in their right mind ever embark in the development of a complex software system without first taking the time to design it, and design it well? Unfortunately this is because "old" programming methodologies of procedures and global variables and "main" functions just do not cater to the notion of a cohesive design using independent components. Ever hear of spaghetti code? There exists a mindset among many programmers which needs to change across the board. A paradigm shift, if you will, has started, but certainly is not close to complete. Welcome to the world of Object Oriented Programming and Design.

Object Oriented Programming (in terms of Lingo in this text) is not simply the use of parent scripts, behaviors and birthing instances of parent scripts. Nor is it the use of graphical "widgets" for an interface. While this is a part of the methodology, adhering to this mindset will yield nothing more than the pile of junk Joe the ex-Lingo Boy left behind. So what if it "works" - it only works for the "current state" of the system and if any changes are needed, say goodbye to your sanity trying to upgrade it. Instances of parent scripts with no cohesive system wide design behind them are simply glorified property lists that can do stuff. Object Oriented Programming (OOP from now on) is a complete paradigm shift. It's a whole new methodology which consists of insight, design, abstraction, extendibility, reuse, reliability and efficiency all in one. All of which happens before the first line of code is written.

The object oriented mindset is truly that; a mindset. It is not simply learning how to define a parent script and create an instance of it. Those are some of the tools. One must learn the ins and outs of the design methodology. Classes need to be designed with the same attention to detail and overall cohesiveness as any complex system. There is no room in Object Oriented Design for "hybrid" systems either. What was left of Joe the ex-Lingo Boy's super cool 3D killer Internet application was a hybrid of objects and procedural methods. It simply won't work. There is no conformity, no sense of design, and no way to design changes.

Clearly this is not a lesson on OOP or the details of the design paradigm. Nor is it intended to be. This is a lesson on the urgency for the paradigm shift to happen across the board. The benefits which it will reap far outweigh the time it might take for one to delve in and really make the shift. Lingo is an object oriented programming language. Like C++, it is possible to program with Lingo procedurally, but why? The old programmers mindset simply doesn't hold anymore. With systems of increasing complexity, and the increasing need for reliable and extendible software which grows with the times, the object oriented mindset is the vehicle that will allow these needs to be met.

Paul Hemmer received a BS in Information Technology from Rochester Institute of Technology. He is Senior Developer for a Rochester NY multimedia company. He primarily does Object Oriented Lingo development and lately has doing quite a bit of ASP programming. Paul is very much an advocate of OOP and always tries to push Director beyond its limits. He is committed to increasing awareness of the power and importance of the object oriented mindset and he does his best to make sure everybody on DirectL knows how he feels. Paul's real love is music. He is a bass player who happens to enjoy slinging Lingo by day. ;)

Copyright 1997-2024, Director Online. Article content copyright by respective authors.