
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 Q908
Object Orientation: Design Patterns
Exercises, examples and other material relating to training module Q908. This topic is presented on public courses Learning to program in Python, Object Oriented Programming in PHP, Python Programming, Intermediate Python
Background Design patterns are the way you apply Object Oriented code in a standardised
way to common techniques across a wide range of different data types.
| Articles and tips on this subject | updated | | 4096 | Perl design patterns example For short programs, just a few lines of code in a single block do an excellent job. As the program size increases, some sort of structure such as named blocks of code (sub, def, function, proc, lambda etc) becomes logical. And as the code grows further, you should consider splitting out logic relating ... | 2013-05-25 | | 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 | | 3843 | Caching Design Patterns We run a hotel, and sometimes we have a quandry when it comes to room changeover.
Scenario: John Smith checks out of room 4 at 8 a.m. on Thursday, and looking at our booking system, we see that the room's not been booked out again until Saturday evening, as a twin room, for Deborah Williams ... | 2012-08-25 | | 3810 | Reading files, and using factories to create vectors of objects from the data in C++ On our C++ courses, we concentrate on objects and object design. But we also take a wider look at topics such as references and templates that go to making the complete language, with sections covering changes to things like file handling from the underlying C language.
I've just added a new example ... | 2012-08-11 | | 3716 | Learning C++ - a design pattern for your first class From today's C++ Course - a new, clear example of a design pattern for a simple class, its headers, and a test harness - [here].
When using an Object Oriented language, design patterns are really useful. Essentially, they're a known and standard way of combining the features of the language in a convenstional ... | 2012-05-05 | | 3608 | Design Patterns - what are they? Why use them? Object orientation provides a wonderful bag of components, but they need to be linked together to provide a full set of facilities for data handling. And very often that linking together is in a way which can be standardised - along the lines of "you normally do it this way". Such standardised methodologies ... | 2012-02-25 | | 2977 | What is a factory method and why use one? - Example in Ruby How do you create an object? By calling a constructor method, of course.
But ... actually ... there's no "of course" about it. Here's a piece of code from an example I wrote yesterday:
sageroll.push Transact::factory(current)
and that call creates an object ...
Whilst you can create ... | 2010-09-30 | | 485 | North, Norther and Northest - PHP 5 Objects Here's a PHP example of calls to PHP methods to return the Longitude North of a place, the more northerly of two objects via an object (dynamic) method, and the most northerly of a whole array of objects via a static function.
$north = $ilike[17]->getlong();
$norther = $ilike[45]->northof($ilike[41]);
$northest ... | 2010-08-14 | | 2741 | What is a factory? A Factory is somewhere that takes raw material, and converts into objects of some value. And so it is in Object Oriented Programming, where a "factory method" takes a chunk of raw material and makes an object out of it. It may differ from a constructor in that we may not know what type of object ... | 2010-04-26 | | 2322 | Looking for a practical standards course I'm a great believer in coding standards. In well commented code. In a good choice of variable names, of code re-use, and of thinking before you write. There are points which I stress on every course, even if the majority of the time I spend is on the actual language. So I should not have been surprised ... | 2009-08-05 | | 1224 | Object Relation Mapping (ORM) Another technical term? Yes - this one is a formal name for how you convert a database into Objects - applicable to any OO language (Perl, Python, PHP, Java ...)
Let's reduce it to basics.
* SQL Tables become object classes
* Table rows each become individual objects
* Individual columns become attributes.
OK ... | 2007-06-12 |
1f51
Examples from our training material
| Validate.pm | Validation of parameters object | | demo1.php | caching design pattern | | pages.py | Factory for webpage objects | | runners | Full OO example / various design patterns in Perl | | uml2.php | Factory, Comparator, Object Sort routine | | umli.php | Code to illustrate UML examples | | valerie | Test and demonstration for Validate.pm |
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 http://www.training-notes.co.uk.
Topics covered in this module
What are design patterns? Attributes, properties and accessors. Factory methods, Comparators, etc. Operator Overloading. Printing and serialising. Utility classes.
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
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. Also
available is the Opentalk
Forum for discussion of technical questions.
|