yes, you can do that using the factory pattern. but that also has disadvantages. for example, the garbage collector often cannot destroy classes that have called such factory classes, which leads to memory problems. and a few other little things that I don't want to talk about. for two years I have been working for a company that has done something like that for decades and since then I have been de-sharing this code with a lot of effort.
yes, you can do that using the factory pattern. but that also has disadvantages. for example, the garbage collector often cannot destroy classes that have called such factory classes, which leads to memory problems. and a few other little things that I don't want to talk about.
for two years I have been working for a company that has done something like that for decades and since then I have been de-sharing this code with a lot of effort.