Archive for the ‘OOP’ Category

Lesser known PHP functions – call_user_func_array

Nov 9 2009

I wanted to start a series on lesser known PHP functions and call_user_func_array came to me as a good starter topic. In my experience most programmers who use this PHP function are building or working with frameworks. Also, don’t get me wrong, this function may be used more often in your working environment than most, so it may or may not be lesser known to you. If you would like to suggest other ones or write an article, by all means let me know!
Read more »

Posted by Shawn | Comments (6)

Object-Oriented JavaScript – Part II (encapsulation)

Oct 6 2009

To carry on our tutorial on object oriented JavaScript, as our next step will be on encapsulation.

What is encapsulation? Gary Booch defined encapsulation as “the process of compartmentalizing the elements of an abstraction that constitute its structure and behavior; encapsulation serves to separate the contractual interface of an abstraction and its implementation.” Sounds smart eh?

So let’s dummy it down for this example. I’m sure you noticed, and I hope you asked yourself, in our previous examples, what if someone used a method that was being used with one object with another, well that methods scope would be over written by the new one. To ensure that each object can have it’s own method, we would have to write the method in the scope of the object. Did you “whuh?” there again? Maybe a code example will help. Read more »

Posted by Shawn | Comments (7)

Object-Oriented JavaScript – Part I (Objects)

Oct 1 2009

OOP is a style of programming that allows you to define or manipulate your data as objects with attributes and methods applied to those objects. These objects can include features such as polymorphism, inheritance, encapsulation, modularity and more. If you’ve never used object-oriented-programming(oop), this post does assume some knowledge of OOP methodologies, hopefully you can follow along.

Object-Oriented JavaScript is an interesting topic, since Javascript can be easily written and run in procedural form. OOP is intended to help maintain software quality and making use of reusable attributes and methods. JavaScript isn’t really an Object-Oriented language by default, but it is object based so we can utilize enough of the concepts to make our scripts work.
Read more »

Article tags: , ,
Posted by Shawn | Comments (17)