SitePoint Sponsor

User Tag List

Results 1 to 10 of 10

Thread: OOP PHP

  1. #1
    SitePoint Addict stu567blue's Avatar
    Join Date
    Aug 2007
    Posts
    316
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    OOP PHP

    Hi All,

    Hope all is well.

    Bit of an odd question this, but I've been tasked by my employer in getting my head around OOP PHP. Now can anyone on here recommend some great books that I can use to get dug in straight away. I have been working with PHP for around 5-6 years but never looked into the OOP side of things so could do with some great resources and tips please.

    Thanks...

  2. #2
    SitePoint Wizard silver trophybronze trophy Cups's Avatar
    Join Date
    Oct 2006
    Location
    France, deep rural.
    Posts
    6,869
    Mentioned
    17 Post(s)
    Tagged
    1 Thread(s)
    There haven't been many threads on this subject recently, so here's a few older ones:

    http://www.sitepoint.com/forums/show...ight=oop+books
    http://www.sitepoint.com/forums/show...ight=oop+books
    http://www.sitepoint.com/forums/show...ight=oop+books
    http://www.sitepoint.com/forums/show...ight=oop+books

    How you learn and the style of tutorial which communicates to you is a very personal thing. I always (boringly) say, go to the biggest bookshop you can find and browse the books and try and find those whose styles appeal to you.

    Spend some time, and be prepared to come away with more than one book.

    Do not look solely at PHP books, once you have the OOP syntax in your head then Java and C# demo code will be easy to understand.

    You may think you are just going to learn OOP, but to do it properly you will have to learn about software design patterns and advanced programming theory - and this can take an awful long time.

  3. #3
    SitePoint Addict stu567blue's Avatar
    Join Date
    Aug 2007
    Posts
    316
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hi Cups,

    Thanks for your reply.

    Hmmmm I've got a couple of Java 5 and 6 books here, might be worth looking at those... (not a Java fan)... will also lay my hands on a few PHP/OOP books. I guess the only way to learn is through trial and error and I'm assuming the structure of OOP programming is near on the same for each OOP language??

  4. #4
    SitePoint Wizard silver trophybronze trophy Cups's Avatar
    Join Date
    Oct 2006
    Location
    France, deep rural.
    Posts
    6,869
    Mentioned
    17 Post(s)
    Tagged
    1 Thread(s)
    I'm probably not the best qualified to answer that, but from what I have seen studying Java and Python (and JS I suppose) yes, they all share the same OOP principles.

    OOP Design Patterns serve as a very good nomenclature across the languages.

    Having said that, by the very nature of the environment in which it operates, some patterns are more frequently used in PHP and its worth tracking down the best and latest books aimed at it. I am not sure if there are new books any aimed specifically at PHP 5.3 or greater.

    Going back to your original post, when your employers talks of OOP, perhaps they have in mind that they think you should be using an MVC framework? Deep-diving into OOP principles will of course set you up well to use an MVC framework to its best, but is certainly not a pre-requisite - which of course learning PHPs OOP syntax is.

    I suspect that choice will depend on the nature of the work you do, and whether your day to day domain specific tasks and complexities will benefit from OOP practices, thinking and disciplines.

    IMO all OOP study is good, and will make you a better programmer and also lead to the discovery of other "robust industry practices".

    Here's a really good old post on learning OOP, which also amusingly cocks a snoot at my reply too.

  5. #5
    Foozle Reducer ServerStorm's Avatar
    Join Date
    Feb 2005
    Location
    Burlington, Canada
    Posts
    2,699
    Mentioned
    89 Post(s)
    Tagged
    2 Thread(s)
    ictus==""

  6. #6
    SitePoint Addict stu567blue's Avatar
    Join Date
    Aug 2007
    Posts
    316
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hi Cups,

    Thanks again for your reply

    My boss wants me to get my head around the concept of MVC. A lot of our work involves the frequent use of Joomla and Open Cart all big on this concept of MVC and I therefore take it on OOP. Will definately have a look at the various resources shared in this post and also pick up some of the books relating to OOP and MVC - although most of these are based around ASP.net

  7. #7
    SitePoint Addict stu567blue's Avatar
    Join Date
    Aug 2007
    Posts
    316
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hi Steve,

    Thank you for your reply.

    Will certainly have a look at the resources and pick up a couple of the books you have recommended.. thanks again

  8. #8
    SitePoint Guru bronze trophy TomB's Avatar
    Join Date
    Oct 2005
    Location
    Milton Keynes, UK
    Posts
    988
    Mentioned
    9 Post(s)
    Tagged
    2 Thread(s)
    I'd suggest getting your head around the concepts in OOP before moving onto MVC and design patterns. If you're coming from a procedural background, then OOP can seem a little backwards insofar as you call functions (methods) on objects, rather than passing data into functions.

    That's the first step! After that, look at the basic patterns then move onto MVC and software architecture.

  9. #9
    SitePoint Member
    Join Date
    Jul 2012
    Location
    Leicester
    Posts
    18
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Firstly learn about the Principles of OOP. It isn't all that complicated but you need to get your head around it before you start coding it.

    The way I learnt is actually by looking at the code of an Open Source software that was coded in OO PHP.

    Then I started creating some simple objects of my own to get the hang of it. Once you've got the concept and know how to make classes, its not as hard as it first seems and makes your coding so much more cleaner and you will never repeat code again

  10. #10
    SitePoint Addict stu567blue's Avatar
    Join Date
    Aug 2007
    Posts
    316
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hi All,

    Thank you for all your recommendations and resources.

    I have since purchased a OOP PHP book, and will also be going back and forth to Amazon to pick up more

    Thanks again


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •