Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

OOPS (Design Patterns) [closed]

hey, hi i want put limit on object creation means a class can have at most suppose 4 objects not more than that how to achieve this?

like image 447
0cool Avatar asked Dec 04 '22 13:12

0cool


1 Answers

One approach is using an object factory that creates at most 4 instances. It's an interesting need... Would an object pool serve the same need?

like image 184
marklai Avatar answered Dec 13 '22 03:12

marklai