Jump to content

Jenk

Members
  • Posts

    778
  • Joined

  • Last visited

    Never

Everything posted by Jenk

  1. Kind of answers the question for you..
  2. Use a RESTful protocol of your own design. Much quicker than the highly bloated SOAP protocol. Failing that, ditch the PHP code for Java, or vice versa.
  3. Too vague a problem to fully assist, but you are calling a function on something that is not an object.
  4. I would strongly reconsider your design implementation. You should not know what properties are within an object if they are not public.
  5. static methods are not bound by inheritance. What you are doing is calling a method as if it were a function, i.e. not in a class at all. A class to a static method is nothing more than a namespace.
  6. "Modular" just means that every class/object is concise and only encapsulates one type of behaviour, so that this maximises reusability. If you have an object that is too specific in the way it must be used, you'll be very restricted.
  7. If you have a large application, with many different features, there is. Otherwise it can generally be considered superfluous to use both.
  8. AJAX has absolutely nothing to do with this topic.
  9. No, Dependency Injection is much, much more than Type Hinting.
  10. Try reading it first.
  11. Why not use DOM? php.net/dom
  12. So what happens if you need to change your database class? Oops! You've got lots of finding/replacing to do! and on platforms that are stateful (i.e. not PHP) the registry is also much more usefull than a singleton, because it can be maintained within the session, and as it's nature is to maintain single instances of objects, it allows you to create instances unique to each session, but maintain the same "singleton" effect.
  13. Depends on your structure of session storage.
  14. Almost, they are specific to the currently active session. Users change within the same session.
  15. class B extends A { public function A () { // leave this blank to stop parent constructor executing if it's a php4 syntax class } public function __construct () { //this is your new constructor } }
  16. Singletons are restrictive, and can (but don't neccessarily do) lead to problems later in application life. Just be more disciplined and only instantiate the object once if you want to maintain only once instance. As for the variable/object name argument (which has already been addressed I see,) you are mistaken. An example: <?php $foo = new db(); function foobar ($bar) { $bar->connect(); } foobar($foo); ?>
  17. You either use MVC, or you don't. You don't have to use anything. MVC is a design pattern, a guide for a commonly occuring situation or scenario. If you are setting out to design an application with MVC, you have already caused yourself problems as you do not yet know if MVC is right for your situation.
  18. use $this->forms , not $forms within the create method.
  19. Your application may have a Model component, a View component and a Controller component, but is not a "ModelViewController"
  20. No, you build an application that satisfies the pattern, should the pattern be applicable to your needs. You do not build a pattern.
  21. You still didn't read the first reply properly. empty($var) will return true if either $var is undefined, or contains the value of null, 0, "" (empty string) or an empty array. I suggest you read that line very carefully, then read it again carefully, and once more for luck, before replying again.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.