Jump to content
Larry Ullman's Book Forums


  • Content Count

  • Joined

  • Last visited

  • Days Won


JohnD last won the day on September 7 2015

JohnD had the most liked content!

Community Reputation

2 Neutral

About JohnD

  • Rank
  1. Do an assignment to a $row_count variable Instead of evaluating mysqli_num_rows($r) inside an 'if'. if (mysqli_num_rows($r) > 0) //replace this line $row_count = mysqli_num_rows($r); //(line1) with these 2 lines if (($row_count) > 0) // (line 2) You could also echo $row_count before the 'if' to see what it has.
  2. This was a good thread. It does a good job of illustrating the sometimes arbitrary and confusing changes introduced into a development platform.
  3. Larry, In ch 7 Design Patterns I am a little uncertain how to fit the UML diagram on p234 to the Strategy example. I realize that it is a generic conceptual model. I think the Context box could represent the intereface iSort, the Strategy box could represent Both Class MultiAlphaSort {} and Class MultiNumericSort {} and the ConcreteStrategyA{} ... C{} would be represented by Class StudentList{}, if fitted to the Strategy pattern example on pages 235 to 240. Is this correct? I do understand the implementation of the Strategy Pattern example. The reason I am bothering with the UML diagram here is that these diagrams have helped me a great deal when included with the oop chapters. Also, a slightly unrelated comment. If you ever decide to write the fourth edition of this book (which I would buy in a heart beat), I think it would be enhanced by an Appendix devoted to a listing of all the UML syntax. Of course keep the in-context examples of UML as well. Thanks, JohnD.
  4. Thanks for the reply Antonio. Nice to know my ideas weren't totally out in space.
  5. This question regards application design and does not have a source code component. Is it common practice, or good practice, to use an abstract class and and multiple interfaces (small i) together in the same application? Consider the example of an abstract class automobile. This general class would enforce the "is a" constraints of all automobile types. Several different interface(s) would be defined and applied to the subclasses of automobile based on the type of automobile being defined. Does this seem reasonable? Or does defining an abstract class and multiple interfaces seem like over-kill?
  6. Nice work! Thanks for the detailed post on how to configure this. You have saved me a lot of trial and error.
  7. I just wanted to put this out there in case anyone is having similiar problems with XDebug running in Netbeans 8. When I was stepping through the code in register.php Netbeans running XDebug debugger was reporting a 'value not available' or some similiar message on the form validation pass, line 98, [First Name]. When I chose Run File from Netbeans (without the debugger) everything worked fine. This appears to be a case of XDebug acting buggy. I was running it with the Debugger to resolve file locations, db name, passwords, etc., just to get the script working. Hope this saves someone some time.
  8. HTML_QuickForm2 is awesome! I will definitely be using it in my projects.
  9. Yes, I see now. I think was confused by the object variable $CONFIG having the same name as the class. Thank you both for the help.
  10. I was curious what instanceof would return here. It's strange because I can't do a print_r() or a var_dump() of $TEST. Also, I thought the whole point of the example was that in the "Singleton pattern is a creational pattern pattern that will restrict an application to creating only a single instance of a particular class type." (p216) I'm just trying to make sense of the models and see if there are cases where the php's behavior is counter-intuitive.
  11. This is the only way I could get it to work. I tried it both ways. Maybe it's just my PHP v5.3?
  12. When I user the instanceof keyword for the Singleton class in Ch07 page 218, it is returning true. See below. // Create a second object to confirm: $TEST = Config::getInstance(); // see what instanceof thinks... if ($TEST instanceof Config) { echo '<pre>$TEST IS instance of Config</p>'; } else { echo '<pre>$TEST IS NOT instance of Config</p>'; } It is echoing that $TEST IS instance of Config. Am I doing something wrong?
  13. I can't change my dev version to php5.4. I'm stuck with php5.3. Can someone help me change the tDebug trait into a class that I can use to debug classes? I have tried myself. I can't figure it out. Thanks, JohnD
  • Create New...