For 2023 - we are now fully retired from IT training. We have made many, many friends over 25 years of teaching about Python, Tcl, Perl, PHP, Lua, Java, C and C++ - and MySQL, Linux and Solaris/SunOS too. Our training notes are now very much out of date, but due to upward compatability most of our examples remain operational and even relevant ad you are welcome to make us if them "as seen" and at your own risk.
Lisa and I (Graham) now live in what was our training centre in Melksham - happy to meet with former delegates here - but do check ahead before coming round. We are far from inactive - rather, enjoying the times that we are retired but still healthy enough in mind and body to be active!
I am also active in many other area and still look after a lot of web sites - you can find an index ((here)) |

Well House Consultants
You are on the site of
Well House Consultants
who provide
Open Source Training Courses
and business
hotel accommodation. You are welcome to browse and use
our resources subject to our copyright statement and to add in links from your pages to ours.
Other subject areas - resources
Java Resources
Well House Manor Resources
Perl Resources
Python Resources
PHP Resources
Object Orientation and General topics
MySQL Resources
Linux / LAMP / Tomcat Resources
Well House Consultants Resources
Extras Resources
C and C++ Resources
Ruby Resources
Tcl/Tk Resources
Web and Intranet Resources
|
Object Orientation and General technical topics module Q906
Object Orientation: Individual Objects
Exercises, examples and other material relating to training module Q906. This topic is presented on public courses Learning to program in Python, Learning to Program in Java, Learning to program in Ruby, Learning to program in C and C++, Object Oriented Programming in PHP, Python Programming, Perl for Larger Projects, C++ for C Programmers, C and C++ Programming, Java Bootcamp, Ruby Programming, Java Programming for the Web, Intermediate Python, Learning to program in C and C++, C and C++ Programming
Object Orientation is perhaps the best design approach for medium-size to large applications and systems. In this module (the first of three on Object Orientation that are equally applicable to all the OO languages that we teach), we define object orientation, and study the design of simple objects. Related technical and longer articles Incr-Tcl - Object Oriented extension to TclObject Orientation in Perl - First Steps
Articles and tips on this subject | updated | 4650 | Why populate object with values as you construct them? Objects are a great way to bundle up a whole lot of values (also known as properties or attributes) into a single container / collection, allowing the the programmer who makes use of the objects to be able to set them up just once and delegate the management of the values to the class / object code. ... | 2016-02-18 | 4591 | From single block to structure and object oriented programming If you're writing a very short, one-off program, you're likely to mix your calcualtion details in with your data input / output and data format handling - "quick and easy" - for example, code (Python 2.7 and 3.x) [here].
But as your application grows, and the code grows, a single block becomes less ... | 2015-12-03 | 4448 | What is the difference between a function and a method? I strongly encourage delagates on our courses to divide their code into managable, understandable, testable, re-usable chunks rather than write it all into a single block. And the adjectives I've used (managable, understandable, testable, re-usable) explain why.
You can process data within these chunks ... | 2015-03-05 | 4021 | Spike solution, refactored and reusable, Python - Example The other day, we suffered a gap in service from one of our dedicated hosts and after the event I wanted to go through the server logs to find how long the gap was, and whether there was any unusual activity prior to the outage. Problem was - I was looking in a 60 Mbyte log file with ovr 200,000 records ... | 2013-03-01 | 3721 | Naming blocks of code, structures and Object Orientation - efficient coding in manageable chunks Soon after you start to program, you'll learn that you want to re-use code. And that re-use will sometimes come in the form of loops, and at other times in the form of named blocks of code which you'll call up from multiple places in your program, or indeed from multiple programmers.
• A good ... | 2012-05-12 (longer) | 3436 | Moving from scripting to Object Orientation in Python Using what's been described as the scripting idiom, a "scripter" will write a series of code steps which perform a task from top to bottom. For a job that only involves simple data manipulation (even if there's a lot of data to have that manipulation applied), this approach can be very effective indeed ... | 2011-09-14 | 2651 | Calculation within objects - early, last minute, or cached? When you create an object with the constructor, you may also set property [attribute] values within it ... or you may follow on with a series of method calls to set the initial values. Then when you pull back values / attributes / properties from your object you return those values, or the results ... | 2010-03-03 | 2393 | A first demonstration of OO, including polymorphism "Object Oriented" often means big and heavy code even for the first example application demos ... since OO works really well when you're meeting requirements beyond those which are small enough to be described as 'trivial'. So I'm very pleased with this little demonstration in Python which shows - all ... | 2009-09-05 | 2171 | Cleaning up redundant objects In Object Oriented Design, you'll find that there's a piece of code you can add to your classes called the destructor method ... which you don't usually call explicitly in your code.
When a variable goes "out of scope" and is no longer available to your code , it is marked for destruction so that any ... | 2009-05-12 | 2173 | Basic OO principles Object Oriented Programming is often described as "data driven", but what does that mean?
For delegates who have been on my Object Oriented courses, I'm reproducing here is a diagram that I develop on the board during the course. And I'm reproducing it with some reluctance, as it's the very development ... | 2009-05-12 | 1925 | Introduction to Object Oriented Programming "Object Oriented Programming" is a whole new philosophy for programmers who have been writing short scripts for years, and it can be quite frightening to learn with all these new buzzwords like "overriding", "encapsulation" and "polymorphism" creeping in. It's a beautiful concept and a lovely approach, ... | 2008-12-10 (longer) | 1864 | Object Oriented Perl - First Steps There are some occasions when a new example that I write / a topic that comes up on a course results in an article that's so long that it doesn't fit into the Blog / short article format, but requires a more substantial mechanism.
And so it is for my First steps in Object Oriented Perl examples, written ... | 2008-11-02 | 227 | Bellringing and Programming and Objects and Perl For the second time this year (and it's only the second month), I find that I have a keen bell-ringer on my programming course ... he's off each evening to meet up with fellow bell-ringers in church towers in Wiltshire, and having a really good time outside course hours as well as during the day. I understand ... | 2008-05-16 | 1543 | Learning Object Oriented Principles (and perhaps Java) During an intensive 3 day Java course last week, I gave an introduction to the principles of Object Oriented Design, and a very short segment on design principles (there's a limit to how much can be covered in three days, and Java itself was the main topic).
As a follow up to that course, I promised ... | 2008-02-17 | 507 | Introduction to Object Oriented Programming So what exactly IS object oriented programming? Easy question to ask, but a hard one to answer in just a sentence or two. Let's try.
In an object oriented scenario, you group together all the pieces of code that relate to a certain type of data. That code grouping will be called a class and it will ... | 2006-06-05 |
Examples from our training material
after2.c | Functions - fundamental calls | after3.c | Functions - passing in a structure | an01 | creating a hash of data in Perl | an02 | creating a hash of data in a package in Perl | an03 | Creating and accessing simple objects in Perl | animal.pm | Creating and using Perl objects in a class | bells.pm | Bell change class - notation and change interpreter | cap_functional.py | Functional coding | cap_object.py | Object coding | cap_singleblock.py | single block coding | classic.php | First Class demo | develop.cpp | Methods (C++) - functions that run on an object | gap | Log file gap reporter - single code block (Python) | oogap | Log file gap reporter - using logtime object (Python) | oogap2 | Log file gap reporter - using multiple objects (Python) | osx.php | An array of objects | rails_oo | Using the Object Oriented idiom | rails_script | Using the scripting idiom | ringer | Test program for the "bells" class | sc.java | Structured code in Java | sc.perl | Structured code in Perl | ua | Final example - calling basic Perl classes | ua01 | Calling functions in Perl from another file | ua02 | Calling functions from a module in Perl | ua03 | Creating and using objects in Perl |
Pictures Object Orientation really works ;-)
Background information
Some modules are available for download as a sample of our material or under an Open Training Notes License for free download from [here].
Topics covered in this module
A History. Unstructured Code. Subroutines, functions, procedures. Structured Programming. Object Oriented Programming. A note on political, or religious issues. Introduction to OO Programming. Classes. Methods. Static and Nonstatic. Instances. Constructors. Destructors. Overloading. Accessing members of a class. Loading. Use. Direct access to variables. Testing. Encouraging class use.
Complete learning
If you are looking for a complete course and not just a information on a single subject, visit our Listing and schedule page.
Well House Consultants specialise in training courses in
Ruby,
Lua,
Python,
Perl,
PHP, and
MySQL. We run
Private Courses throughout the UK (and beyond for longer courses), and
Public Courses at our training centre in Melksham, Wiltshire, England.
It's surprisingly cost effective to come on our public courses -
even if you live in a different
country or continent to us.
We have a technical library of over 700 books on the subjects on which we teach.
These books are available for reference at our training centre.
|
|
|