Search results for constructors

Welcome to the final installment of a series that shows you how to use restrictive constructors in PHP 5. With a decent variety of code samples, this series recreates for you a few common scenarios where the implementation of both protected and private constructors can greatly improve the behavior of different classes in the context of a given application. - And now that you've been properly i
In this third installment of a four-part series, I show you that a private constructor can be truly helpful when strictly implementing the Singleton design pattern. In this case, the pattern will be applied within a class that behaves like a simple MySQL abstraction layer, but the same concept can be extended to other classes. - At first sight, declaring a constructor method protected or priva
In this second part of a four-part series, I rebuild the example application developed in the previous tutorial. As you'll recall, it used a protected constructor to prevent the instantiation of the base array iterator class. In this case, a better result will be achieved by declaring the iterator abstract; still, the example demonstrates a simple utilization of a restrictive constructor in a con
What exactly is a restrictive constructor, and why would you want to use one? If you're a PHP programmer who uses such design patterns as Singleton and Factory, this series of articles on restrictive constructors will give you another tool to use in your applications. - As you'll probably know, with the release of PHP 5 quite some time ago, the language was provided with the ability to specify

Clickiz.com is a social bookmarking place where you can share, find & discuss the best news around on most topics. We focus on hi-tech reviews, gadgets and geekery but we like almost anything that's awesome, appealing and thought-provoking! er6i9ds5mz



Add to Technorati Favorites
Username:

Password:

Remember: