Welcome, Guest: Register On Nairaland / LOGIN! / Trending / Recent / New
Stats: 3,152,773 members, 7,817,150 topics. Date: Saturday, 04 May 2024 at 07:11 AM

Let's Learn Object Oriented PHP! - Programming (2) - Nairaland

Nairaland Forum / Science/Technology / Programming / Let's Learn Object Oriented PHP! (6146 Views)

Object-oriented PHP / A Beginners Guide To Object-oriented Programming (OOP) In PHP 5+ / Criticism Of Object Oriented Programming (2) (3) (4)

(1) (2) (Reply) (Go Down)

Re: Let's Learn Object Oriented PHP! by emsquare(m): 9:19pm On Apr 04, 2012
Seun: OOP PHP. Alright! I'm also thinking about creating threads for functional Visual Basic & high level machine language.

Nyc!
Re: Let's Learn Object Oriented PHP! by sparko1(m): 9:53pm On Apr 04, 2012
first of all i will want to say a big thank you to the OP, that said i do have some mind bugging questions' firstly, where can i find the compiler to download? Well if anyone can help me i would be very happy (PHP and JAVA COMPILER) and wwouldn't mind paying, secondly, where around ikeja can i learn java and php? Though i have some basic html. Finally please i need it like right now please, reply with valid information please.
Re: Let's Learn Object Oriented PHP! by Seun(m): 12:04am On Apr 05, 2012
To develop PHP on your PC, get XAMPP for Windows:
* http://www.apachefriends.org/en/xampp-windows.html
To develop Java on your PC, get Netbeans:
* http://www.oracle.com/technetwork/java/javase/downloads/jdk-7-netbeans-download-432126.html
Re: Let's Learn Object Oriented PHP! by delomos(m): 4:11am On Apr 05, 2012
[quote author=sparko1.... where around ikeja can i learn java and php? Though i have some basic html. Finally please i need it like right now please, reply with valid information please.[/quote]

An excellent place, and it's also free is: http://net.tutsplus.com/articles/news/diving-into-php/

1 Like

Re: Let's Learn Object Oriented PHP! by ecigwe: 5:59am On Apr 05, 2012
nice
Re: Let's Learn Object Oriented PHP! by bumdish: 9:38am On Apr 05, 2012
timbs001: wink@bumdish, nah
The advantages of OOP PHP are too immense to ignore it.
You can't work with most PHP based CMS without understanding
OOP PHP, and also Zend framework.
PHP is fast becoming a full fledged Object oriented language
As of PHP 5.4. To ignore it is to remain outdated
And miss out the advantages and features.
Never regretted learning OOP PHP.
Happy PHPing cheesy

@ Pc_guru, u are right, one can get acquinted with OOP PHP
While working with PHP frameworks.
I will recommend Zend framework or DRupal CMS those are the
Ones I work with. wink

Hi tims001, you obviously didn't get my point. I didn't in any way ask anybody to ignore OOP, in fact, I think I qualify as a PHP/OOP Evangelist. I only advised not to bother doing classic PHP/OOP from ground up, you might end up building what I call pseudo-OOP "POOP"(procedural programming with pseudo-OO design) where you might never do things like Interfaces and stuffs. I guess PC-Guru reiterated this

I would advise the Framework path is worth the journey if PHP/OOP is on your agenda cos PHP in itself isnt constraining like its senior brothers.

CodeIgniter is my preference (I didnt say the best pls.). It is extremely simple to learn, can be set up simply by unzipping, very large community, gracefully documented, MVC/HMVC implementation, accepts your classic PHP functions and patterns, no command prompt wahala, wide DBMS support and like. A host of other frameworks exists, some with even better proposition, but this 1 soothes my soul. I ran away from Yii cos of the command prompt wahala.
Re: Let's Learn Object Oriented PHP! by bakenda(m): 10:19am On Apr 05, 2012
Seun: OOP PHP. Alright! I'm also thinking about creating threads for functional Visual Basic & high level machine language.

You might as well start threads on flying pythons.
That doesn't detract from the fact that PHP is an
Object oriented language. A nice one too.

1 Like

Re: Let's Learn Object Oriented PHP! by kanor: 2:03pm On Apr 05, 2012
Good thread.
I think the best way to learn all these new developments is by buying recent books on PHP.
SECRET: The best book I learned all these was Murach's PHP and MySQL by Joel Murach and Ray Harriss(ISBN: 9781890774561). i JUST HAVE IT BY MY SIDE HERE.i have over 10 books on php and this is the BEST! I bought it from the guys in walahi.com, the nigerian online bookshop. Just so happy.

It gives you all the details on OO php, MVC Patterns , the use of prepared statements, etc and all that.

One page gives you the training and the second page gives you the practical application. GREAT BOOK.
Re: Let's Learn Object Oriented PHP! by instinctg(m): 5:44pm On Apr 05, 2012
*dhtml:
Corrections please: Drupal is a Content Management Framework and it is also a Content Management System at the same time. . . .caramba

So all the OOP jargons means that i can ehm, create a class called say goat, and now create instances of the class e.g.
$doncigalo = new GOAT('meee'); //just kidding.

So is the class the object now or the goat? I seem not to remember. . . . .caramba

oh my Gawd ! see as person wey God create turn into blabbing goat. i de laf o grin grin grin
Re: Let's Learn Object Oriented PHP! by AZeD1(m): 9:37am On Apr 09, 2012
pc guru: for now Zend Framework 1 is having a total rewrite and believe me Zend 1 is too compilcated and slow, i think for now Yii ,CakePHP, codeigniter is good but Yii is the fastest and the easiest that i know, to grasp first Zend Framework 2 is almost out which is a bit too complex esp with new patterns, try Yii if you don't like Yii or find it hard i'll send my real address for you to beat me up cheesy.
Tried yii and its great plus very very easy. If you can read this post, you can use yii.
Re: Let's Learn Object Oriented PHP! by Nobody: 10:09am On Apr 10, 2012
someone should pls help the thread on putting something about interfaces got a .NET Project to submit, will edit and explain the interface later thanks
Re: Let's Learn Object Oriented PHP! by doncigalo: 8:34pm On Apr 10, 2012
@DAFTHTML
Re: Let's Learn Object Oriented PHP! by Nobody: 6:12pm On Apr 12, 2012
Interfaces
First, what are interfaces?

Interfaces are 100% abstract classes – they have methods but the methods have no ‘guts’.
Interfaces cannot be instantiated – they are a construct in OOP that allows you to inject ‘qualities’ into classes .. like abstract classes.
Where an abstract class can have both empty and working/concrete methods, interface methods must all be shells – that is to say, it must be left to the class (using the interface) to flesh out the methods.

Example of a class:
class dog {

function bark() {
echo “yap, yap, yap …”;
}

}

Example of an interface:
interface animal {
function breath();
function eat();
}

Note: the interface’s functions/methods cannot have the details/guts filled in – that is left to the class that uses the interface.

Example of a class using an interface:
class dog implements animal{

function bark() {
echo “yap, yap, yap …”;
}

/* the interface methods/functions must be implemented (given their ‘guts’) in the class */

function breath() { echo “dog is breathing …”;}

function eat() { echo “dog is easting …”;}

}

/*

Remember: when a class uses/implements an interface, the class MUST define all the methods/functions of the interface otherwise the php engine will barf … ‘barf’ is a technical term for: give you an error.

*/

PRIMARY PURPOSES OF AN INTERFACE:

Interfaces allow you to define/create a common structure for your classes – to set a standard for objects.
Interfaces solves the problem of single inheritance – they allow you to inject ‘qualities’ from multiple sources.
Interfaces provide a flexible base/root structure that you don’t get with classes.
Interfaces are great when you have multiple coders working on a project – you can set up a loose structure for programmers to follow and let them worry about the details.

WHEN SHOULD YOU MAKE A CLASS AND WHEN SHOULD YOU MAKE AN INTEFACE?

If you have a class that is never directly instantiated in your program, this is a good candidate for an interface. In other words, if you are creating a class to only serve as the parent to other classes, it should probably be made into an interface.
When you know what methods a class should have but you are not sure what the details will be.
When you want to quickly map out the basic structures of your classes to serve as a template for others to follow – keeps the code-base predictable and consistent.

MISC. NOTES:

The ‘Holy Grail’ of programming is the reuse of existing code – interfaces play an important role in this.
Remember to push up all the code (up the class hierarchy,) to the highest level class. Interfaces help to make this happen.

-

If you find anything to be unclear, please let me know (make a comment) and I will do my best to clarify.

source: http://killerphp.com

2 Likes

Re: Let's Learn Object Oriented PHP! by timbs001(m): 5:40pm On Mar 31, 2021
9 years later. PHP has really evolved since then and I actually still use it a lot in my day to day tasks.
smiley
Re: Let's Learn Object Oriented PHP! by Karleb(m): 8:55am On Apr 01, 2021
Nice thread.
Re: Let's Learn Object Oriented PHP! by timbs001(m): 7:55am On Apr 03, 2021
By the way, I am a lead software engineer(a junior engineer when I started this thread smiley ) and can offer one on one training and also mentor you on how to be a senior software engineer plus tips on how to get remote jobs with foreign companies.
Nb. The services are for a fee.
Re: Let's Learn Object Oriented PHP! by Karleb(m): 1:12pm On Apr 03, 2021
timbs001:
By the way, I am a lead software engineer(a junior engineer when I started this thread smiley ) and can offer one on one training and also mentor you on how to be a senior software engineer plus tips on how to get remote jobs with foreign companies.
Nb. The services are for a fee.

It's been 9 years now.

What is the experience so far?

What stacks do you use now? Do you still code PHP?
Re: Let's Learn Object Oriented PHP! by timbs001(m): 8:38pm On Apr 03, 2021
Karleb:


It's been 9 years now.

What is the experience so far?

What stacks do you use now? Do you still code PHP?

Well it’s been a great experience so far. Yes I still code in PHP. Js and python also. Most notable experience is that I was able to develop myself to consult for foreign companies and work with developers from around the globe.

1 Like

Re: Let's Learn Object Oriented PHP! by lordally(m): 11:32pm On Nov 06, 2022
timbs001:
9 years later. PHP has really evolved since then and I actually still use it a lot in my day to day tasks.
smiley

Hello Timbs001 ... Hope you don't mind if I send you a Mail as regards this

(1) (2) (Reply)

Learn Java EE With Me / Is There Any C++ Compiler For Mobile Phone Se(java) / Cost & Requirements Of Setting Up A Software Productn Company

(Go Up)

Sections: politics (1) business autos (1) jobs (1) career education (1) romance computers phones travel sports fashion health
religion celebs tv-movies music-radio literature webmasters programming techmarket

Links: (1) (2) (3) (4) (5) (6) (7) (8) (9) (10)

Nairaland - Copyright © 2005 - 2024 Oluwaseun Osewa. All rights reserved. See How To Advertise. 51
Disclaimer: Every Nairaland member is solely responsible for anything that he/she posts or uploads on Nairaland.