| |||||||||||
| |||||||||||
Tapping in on resources
When it comes to producing new examples for a course, where better to look than close to home? Yesterday, I was looking for an example to use when I was covering object design in Python and I hit upon working with taps and the water suppy to them. Looking around, we have quite a few taps here; several of them are in the training centre part of the building (the first two that I've pictured) and others are elsewhere. The taps differ a little - some are mixer taps, others (such as the outside tap) are cold only,and the tap in the kitchen is a spectacular tap that I've christened to be a "supertap". Together, these make a great example of a base class and the ability to define inheritance. Our sample application went further. We defined connection objects which describe which mains supply each tap is connected to in the building, and we then define a maximum flow through that connection. This allows our python application to know when there isn't enough capacity available when someone tries to turn a tap on.![]() If you're writing code in an object oriented language such as Python, it's important that you think carefully about the objects that you're dealing with and specify the classes and methods that you'll be using as carefully as possible at the start. On many of our courses, we include modules on object oriented design in order to help you save time in the long term by getting tings right from the start. ![]() It's only when you start working with classes in this way that you realise just what a powerful resource they are ... (written 2005-03-05 08:26:34) Associated topics are indexed under Q907 - Object Orientation and General technical topics - Object Orientation: Design TechniquesY301 - Python - Class Interaction - an example
Some other Articles
Conventional restraints removedWhat and why for the epoch Difficulties with a trolley Crossfertilisation, PHP to Python Tapping in on resources Preparation for a day's work How to get the best from your supplier Giving customers best value Diverse activities Feedback as lifeblood 1705 posts, page by page
Link to page ... 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35 at 50 posts per pageThis is a page archived from The Horse's Mouth at http://www.wellho.net/horse/ - the diary and writings of Graham Ellis. Every attempt was made to provide current information at the time the page was written, but things do move forward in our business - new software releases, price changes, new techniques. Please check back via our main site for current courses, prices, versions, etc - any mention of a price in "The Horse's Mouth" cannot be taken as an offer to supply at that price. Link to Ezine home page (for reading). Link to Blogging home page (to add comments). |
| ||||||||||
PH: 0800 043 8225 or 01225 708225 • FAX: 0845 8382 405 or 01225 707126 • EMAIL: info@wellho.net • WEB: http://www.wellho.net • SKYPE: wellho | |||||||||||