I have a problem here, which I have been thinking about for the past few days. In a php application to do something with a object you need to:
- Bunu tanımlamak
- run a function with it like so: (with autoloading, and a registry object)
- $ Kayıt-> obj = new mathClass ($ var1, $ var2); / / $ Var1 bir veritabanı nesnesini tutan nesnesi oluşturur ve $ var2'ye örneğin 1 değerini tutan
- $registry->obj->calculate('value'); //fetches product rows and returns their total value. This way at any time in the script i can simply run the calculate function (or some other function) that I defined beforehand.
Imagine a web application that has hundreds of classes that might or might not be required for this specific page load, but can only be defined at the start of the application. The desired solution is that I simply run
$obj->calculate('price');
Bunun gibi, örneğin, nesne yaratmadan
mathclass::calculate('price');
ana yükü olmadan kadar bu daha sonra mathclass autoloads, burada problem artık başlangıcında mathclass herhangi bir değişken verebilmesidir
($var1,$var2).
Ne istediğiniz yükü eklemek değil gibi, sınıf oluyor herhangi autoloading olmadan nesne oluşturmak-yalancı, ancak nesne değişkenleri ile kendini yaratır ama aslında onunla bir şeyler yapmak gerekiyor sadece o muktedir olmaktır.
I mean does php really expect me to define each and every class at the start so that I can later use them? is this Lazy-loading? Eager loading?
Ben kötü bu açıklayan böylece doğru yönde bana gelin lütfen olabilir.