The feature defines a static property for the using class. This static counter remains unique on each poll for a new identity (in this case it’s an integer). The $identityCounter must be ‘increasable’, that is, every time its accessed or ‘advanced’ it must be unique from all the identity values before it. Counting up is a very easy way to accomplish this.
PHP doesn’t have an enumeration data type, so I built an enumeration generator of my own. It actually won an award on phpclasses.org! It has been refactored to use the Configuration feature, formatted to follow the PSR standards as best it can, and relicensed under the MIT License.
The thing about PHP and the mixin’s I’ve developed is that they are not necessarily a class, instead the idea is that they are a trait that offers a particular feature to another class. So you define a feature, something the class can do, such as logging, or being able to hold configurations (see below) and then you can add it to a particular class.
Predicate objects are an interesting concept, which could have many uses in functional programming, in mathematical polymorphism, in input validation, etc. Ranges are a specific version of a predicate object that tests if any given value is within the maximum and minimum range defined in the object.
With the success I’ve had with the open-source libraries I found for speech recognition and synthesis I’ve decided that that plan is outdated. With a little hacking I was able to glue two systems together with using Python and produce an extremely rudimentary ‘artificially intelligent’ in the manner of two days. This gives me quite a bit of hope.
These data structures allow you to define parent and child relationships using a set of vertex information and classes. These are best suited to dealing with a tree of nodes, a common data structure encountered by optimization and artificial intelligence.
The abstract factory class in the link creates other abstract factories. This is much like the Enumeration data type which creates constants/enumerators with specific arguments. Each Abstract Factory is a throw-away object that you can use to create code dynamically for a given factory.
In PHP, keys in an array can only be a string or an integer. However, in many general symbolic programming situations, you may want to be able to associate one piece of data with another. You can establish a link between to pieces of data by setting one as a key and one as a value in an associative array. The Map data type allows you to use any data type as a key and a value.
One interesting note about these interfaces is that both the publisher and the observer include add and detach functions for the other. Usually, observers only have a notify function. Using both of these sets of functions is optional: the only set that must be implemented is on the publisher (to call the observer’s notify).
This data structure mimics the C struct, sort of. A structure has specific fields to be taken care of or filled, some or all of these fields may have restrictions placed upon them. An object that falls under a particular genus may need to implement a specific interface, but contain modifiable members that need to be accessed generically.