Next

Compilers
and Factories

By Peter Miller
<pmiller@opensource.org.au>


Compiler
A compiler is a computer program that translates text written in a computer language (the source language) into another computer language (the target language). The original sequence is usually called the source code and the output called object code. Commonly the output has a form suitable for processing by other programs, e.g. a linker. (Wikipedia)

Factory
The Factory Method pattern is an object oriented design pattern. Like other creational patterns, it deals with the problem of creating objects (products) without specifying the exact class of object that will be created. Factory Method, one of the patterns from the Design Patterns book, handles this problem by defining a separate method for creating the objects, which subclasses can then override to specify the derived type of product that will be created.

More generally, the term Factory Method is often used to refer to any method whose main purpose is creation of objects. (Wikipedia)

Polymorphism
The ability of objects belonging to different types to respond to method calls of methods of the same name, each one according to an appropriate type-specific behaviour. The programmer (and the program) does not have to know the exact type of the object in advance, so this behavior can be implemented at run time. (Wikipedia)