I’ve been unhappy with the inheritance provided by PHP ORM’s I’ve looked at. In looking for something better, I discovered that Postgres has built in inheritance, because it is an object-relational database.
Continue reading post "Database inheritance: Postgres?"objects posts
Javascript: Objects and Callbacks
I’ve been doing my JavaScript coding directly in objects. Before I had been doing them without objects, then modifying them if I had time, but now that I have experience with JS objects, it is much nicer to do the OO straight off. When making objects that are versatile, allowing multiple instances, it is often necessary to be able to perform different operations for different instances. As an example, you might create a single class to handle auto-suggest type functionality, and want it to do different things when you choose one of its suggestions or cancel for different instances of its use. In JS, you could either create forks in the parent class for each possible behavior and use a test to determine which behavior is appropriate, or you could create a callback on instance instantiation or in a function call. The callback method can be very versatile and clean, allowing you to leave alone the core class and modify the calling class or global call.
Continue reading post "Javascript: Objects and Callbacks"