Search Results

Search found 5 results on 1 pages for 'darga33'.

Page 1/1 | 1 

  • Trying to find a recent - PHP book - that utilizes SOLID principles! [closed]

    - by darga33
    Pulling my hair out! I have heard of Martin Fowler's book PoEAA and the other book Head First OOA OOD but those are not in PHP. I desperately want to read them, but ONLY in PHP utilizing the - SOLID acronym - principles! Does anyone know of the absolute best, most recent PHP book that utilizes the SOLID principles and GRASP, and all the other best practices? I want to learn from the best possible source! Not beginner books! I already understand OOP. This seems like an almost impossible question to find the answer to and so I thought, hey, might as well post on stackexchange!! Surely someone out there must know!!!!!!!!!! Or if noone happens to know, Maybe they know of an open source application that utilizes these principles that is relatively small that is not a framework. Something that I can go through every single class, and spend time understanding the insides and outs of how the program was developed. Thanks so much in advance! I really really really really appreciate it! Well it looks like we aren't supposed to ask about best books, so nevermind this question! Sorry about that!

    Read the article

  • PHP I am pulling my hair out trying to find the best! [closed]

    - by darga33
    PULLING MY HAIR OUT I have heard of Martin Fowler's book PoEAA and the other book Head First OOA OOD but those are not in PHP. I DESPERATELY WANT TO READ THEM, but ONLY in PHP utilizing SOLID principles! Does anyone know of the absolute best, most recent PHP book that utilizes the SOLID principles and GRASP, and all the other best practices? I want to learn from the best possible source! Not beginner books! I already understand OOP. This seems like an almost impossible question to find the answer to and so I thought, hey, might as well post on stackexchange!! Surely someone out there must know!!!!!!!!!! Or if noone knows Maybe they know of an open source application that utilizes these principles that is relatively small that is not a framework. Something that I can go through every single class, and spend time understanding the insides and outs of how the program was developed. Thanks so much in advance! I really really really really appreciate it!

    Read the article

  • Where should I put a method that returns a list of active entries of a table?

    - by darga33
    I have a class named GuestbookEntry that maps to the properties that are in the database table named "guestbook". Very simple! Originally, I had a static method named getActiveEntries() that retrieved an array of all GuestbookEntry objects. Each row in the guestbook table was an object that was added to that array. Then while learning how to properly design PHP classes, I learned some things: Static methods are not desirable. Separation of Concerns Single Responsibility Principle If the GuestbookEntry class should only be responsible for managing single guestbook entries then where should this getActiveEntries() method most properly go? Update: I am looking for an answer that complies with the SOLID acronym principles and allows for test-ability. That's why I want to stay away from static calls/standard functions. DAO, repository, ...? Please explain as though your explanation will be part of "Where to Locate FOR DUMMIES"... :-)

    Read the article

  • Where would a senior PHP developer locate the method getActiveEntries()?

    - by darga33
    I have a class named GuestbookEntry that maps to the properties that are in the database table named "guestbook". Very simple! Originally, I had a static method named getActiveEntries() that retrieved an array of all GuestbookEntry objects. Each row in the guestbook table was an object that was added to that array. Then while learning how to properly design PHP classes, I learned some things: Static methods are not desirable. Separation of Concerns Single Responsibility Principle If the GuestbookEntry class should only be responsible for managing single guestbook entries then where should this getActiveEntries() method most properly go? Update: I am looking for an answer that complies with the SOLID acronym principles and allows for test-ability. That's why I want to stay away from static calls/standard functions. DAO, repository, ...? Please explain as though your explanation will be part of "Where to Locate FOR DUMMIES"... :-)

    Read the article

  • PHP - Code Sample - Polymorphism Implementation - How to allow for expansion?

    - by darga33
    I've read numerous SO posts about Polymorphism, and also the other really good one at http://net.tutsplus.com/tutorials/php/understanding-and-applying-polymorphism-in-php/ Good stuff!!! I'm trying to figure out how a seasoned PHP developer that follows all the best practices would accomplish the following. Please be as specific and detailed as possible. I'm sure your answer is going to help a lot of people!!! :-) While learning Polymorphism, I came across a little stumbling block. Inside of the PDFFormatter class, I had to use (instanceof) in order to figure out if some code should be included in the returned data. I am trying to be able to pass in two different kinds of profiles to the formatter. (needs to be able to handle multiple kinds of formatters but display the data specific to the Profile class that is being passed to it). It doesn't look bad now, but imagine 10 more kinds of Profiles!! How would you do this? The best answer would also include the changes you would make. Thanks sooooooo much in advance!!!!! Please PHP only! Thx!!! File 1. FormatterInterface.php interface FormatterInterface { public function format(Profile $Profile); } File 2. PDFFormatter.php class PDFFormatter implements FormatterInterface { public function format(Profile $Profile) { $format = "PDF Format<br /><br />"; $format .= "This is a profile formatted as a PDF.<br />"; $format .= 'Name: ' . $Profile->name . '<br />'; if ($Profile instanceof StudentProfile) { $format .= "Graduation Date: " . $Profile->graduationDate . "<br />"; } $format .= "<br />End of PDF file"; return $format; } } File 3. Profile.php class Profile { public $name; public function __construct($name) { $this->name = $name; } public function format(FormatterInterface $Formatter) { return $Formatter->format($this); } } File 4. StudentProfile.php class StudentProfile extends Profile { public $graduationDate; public function __construct($name, $graduationDate) { $this->name = $name; $this->graduationDate = $graduationDate; } } File 5. index.php //Assuming all files are included...... $StudentProfile = new StudentProfile('Michael Conner', 55, 'Unknown, FL', 'Graduate', '1975', 'Business Management'); $Profile = new Profile('Brandy Smith', 44, 'Houston, TX'); $PDFFormatter = new PDFFormatter(); echo '<hr />'; echo $StudentProfile->format($PDFFormatter); echo '<hr />'; echo $Profile->format($PDFFormatter);

    Read the article

1