How to Use PHP Singleton Trait Variants to Limit the Number of Class Instances that Can Be Created to More Than One Object - TonTon PHP Singleton Trait New Generation package blog

Recommend this page to a friend!
  All package blogs All package blogs   TonTon PHP Singleton Trait New Generation TonTon PHP Singleton Trait New Generation   Blog TonTon PHP Singleton Trait New Generation package blog   RSS 1.0 feed RSS 2.0 feed   Blog How to Use PHP Single...  
  Post a comment Post a comment   See comments See comments (0)   Trackbacks (0)  

Author:

Updated on: 2021-04-22

Posted on: 2021-04-22

Package: TonTon PHP Singleton Trait New Generation

Singleton is a well known design pattern that is used by many classes to assure that only one instance of the class objects exist during the time that a script is executed.

Multiton is a variant of the singleton design pattern that allows more than one instance of a class to exist up to a given limit.

This package provides a solution to implement singleton or multiton classes that can have its variable values be saved to a MemCached container, so the objects can be loaded with the same class values in other times that a script is run after the original script that has set the class variable has ended.




About the TonTon PHP Singleton Trait New Generation Package

The package TonTon PHP Singleton Trait New Generation is one of the few PHP packages that was considered notable recently because it does something that is worth paying attention.

The basic purpose is: Create class objects in a limited number of times

Here follows in more detail what it does:

This package allows to create class objects in a limited number of times.

It provides several trait that can be used with any classes to implement singletons or multitons to limit the number of times that an object of the same class can be created.

Currently it provides traits that can:

- Allow to create a class object only once
- Allow to create class objects a limited number of times up to a given limit number using a key value to distinguish each kind of class object
- Cache the values of the class variables in MemCached based storage
- Allow to create a single class object, only if constraints are met

Conclusion

The TonTon PHP Singleton Trait New Generation can be downloaded from download page or be installed using the PHP Composer tool following instructions in the Composer install instructions page.

This package was considered notable for implementing its benefits in a way that is worth noticing.

Notable PHP packages can be often considered innovative. If this package is also innovative, it can be nominated to the PHP Innovation Award and the author may win prizes and recognition for sharing innovative packages.

If you also developed your own notable or innovative packages consider sharing them, so you can also earn more visibility for your package as well nice prizes.

One nice prize that many PHP developers want and you may like is the PHP elePHPant mascot plush.




You need to be a registered user or login to post a comment

Login Immediately with your account on:

FacebookGmail
HotmailStackOverflow
GitHubYahoo


Comments:

No comments were submitted yet.



  Post a comment Post a comment   See comments See comments (0)   Trackbacks (0)  
  All package blogs All package blogs   TonTon PHP Singleton Trait New Generation TonTon PHP Singleton Trait New Generation   Blog TonTon PHP Singleton Trait New Generation package blog   RSS 1.0 feed RSS 2.0 feed   Blog How to Use PHP Single...  

For more information send a message to info at phpclasses dot org.