216 reputation
18
bio website
location
age
visits member for 2 years, 4 months
seen Jul 27 at 21:08

Jul
27
comment Does it make sense to break fluid interface if a bad argument is passed?
@JamesBlack during development, I kind of like having fatal errors that force me to fix bugs immediately. Perhaps when it is ready for customer use, I change the code so that it throws exceptions for the developer, and the customers/users don't see anything weird. ?
Jul
27
comment Does it make sense to break fluid interface if a bad argument is passed?
The more code I write the more I realize that it is a pain to have a method return different types. But I don't mind PHP fatal errors like false->set('number',12) because they show me where there is an unhandled condition in the code. I can use exceptions to do that without breaking the code, but in a way I prefer the code breaks completely than continues running with unplanned for conditions.
Jul
2
awarded  Curious
Jul
2
accepted Do objects maintain identity under all non-cloning conditions in PHP?
Jun
8
revised Do objects maintain identity under all non-cloning conditions in PHP?
added some detail about my understanding of PHP objects and the clone operator
Jun
8
comment Do objects maintain identity under all non-cloning conditions in PHP?
Are you sure about that? I just found this stackoverflow question whose chosen answer states that you do not need to use & with objects. I suppose that fairly soon I will find out for myself once my code is wired and I start testing it. SO: stackoverflow.com/questions/2715026/…
Jun
8
asked Do objects maintain identity under all non-cloning conditions in PHP?
May
15
comment Many-to-many in OOP: Class A instantiates Class B, which instantiates Class A, which
I'm thinking perhaps my third-party would use the "builder pattern." I guess I'll not have the circular dependencies in the constructor. The builder will (somehow?) know which objects to create and then throw them together. Voila. I'm new to design patterns. But my application is getting too complex for me to just keep hacking away at it without a grander scheme.
May
15
comment Many-to-many in OOP: Class A instantiates Class B, which instantiates Class A, which
@teresko I have a mysql database. I have to access it somehow, right?
May
14
asked Many-to-many in OOP: Class A instantiates Class B, which instantiates Class A, which
Apr
27
comment Dependency injection for request variables in a web application
You have to put $_GET['id'] somewhere, though. Should it be outside of all classes, in a functional area of the code? Or should there be a class whose sole purpose is to take globals into itself and instantiate objects of other classes based on them?
Apr
27
awarded  Yearling
Apr
27
asked Dependency injection for request variables in a web application
Apr
8
answered How should one debug a PHP web application securely without exposing secrets to competitors?
Feb
22
comment Is it bad habit not using interfaces?
I enjoyed reading the quoted section, as well as what came before it.
Feb
22
comment Does it make sense to break fluid interface if a bad argument is passed?
I'm just thinking about the advantages/disadvantages. When you stop program execution you know for sure there's been an error without a doubt. But if I return $this no matter whether there was an error or not, then things keep rolling.
Feb
22
asked Does it make sense to break fluid interface if a bad argument is passed?
Dec
29
asked How to prevent re-checking already-checked data?
Nov
7
accepted How can a collection class instantiate many objects with one database call?
Nov
4
comment How can a collection class instantiate many objects with one database call?
I was using a lot of static methods for loading multiple objects. You don't have to use public setters. You can do one database call and load thousands of objects. If I use an object.loadFromDB(), then I have to call it on each one. The OOP solution would seem to be a collection class whose loadFromDB() method would achieve the same result. But then I have to make the setters of the base class public to everyone!