Welcome! Log In Create A New Profile

Advanced

OOP

Posted by Mac 
Announcements Last Post
Announcement : Programming Students at UNISA School of Computing 06/19/2019 02:01PM
Announcement SoC Curricula 09/30/2017 01:08PM
Announcement Demarcation or scoping of examinations and assessment 02/13/2017 07:59AM
Announcement School of Computing Short Learning Programmes 11/24/2014 08:37AM
Announcement Unisa contact information 07/28/2011 01:28PM
avatar
Mac
OOP
August 06, 2013 01:18PM
See this http://www.tonymarston.net/php-mysql/what-is-oop.html

Now, it is a very personal opinion presented here, but I must say he offers convincing arguments. For one, why write a class when it can be coded in two lines? Of course, if you have an app with hundreds of thousands of lines of code, and OOP approach makes sense, especially if you are part of a team. Also, using an email OOP class that is freely available does make your job easier - you do not have to understand how it works to use it (just know to use it - which is clearly explained in the class documentation). That said, using simple functions without an OOP flavour can also reduce maintenance significantly.

Now don't go about breaking your head about this. You just learn the procedural way for now, then moving to OOP will come a little bit easier.
avatar Re: OOP
August 11, 2013 09:56AM
OOP : here is what CodeCademy taught me about OOP, who knows maybe it might help someone...eye rolling smiley If you have some free time and internet at your disposal, why don't you check them out? They'll help you practice..


Language: PHP
# I am going to create/define a Person class bellow class Person{ public $isAlive = true; public $firstname; public $lastname; public $designation; public $school; #if all your objects are from the same school then you might as well inniate the school property i.e public $school = 'UNISA'.... public $age;   #Bellow is a method for innitiating properties to my person class.. public function __construct($firstname, $lastname, $designation, $school, $age){ $this->firstname = $firstname; $this->lastname = $lastname; $this->designation = $designation; $this->school = $school; $this->age = $age; }   #The following method(function) is the interesting part of this code.. public function greet(){ return "Hi my name is ".$this->firstname." I am a proud ".$this->designation." at ".$this->school."<br/>"; } #The person class ends here!!! bellow I'll make use of the class..   # Ok now that I have created my class, let me create two objects to make use of the class, observe.. $student = new Person('Sipho', 'Mkhwanazi', 'Student', 'UNISA', 12345); $teacher = new Person('Some', 'Body', 'Professor', 'UNISA', 12345);   #Ok two objects have been created now lets do something with them using our greet() method/function located in the class echo $teacher->greet(); echo $student->greet();   #We could even do something more interesting with these objects i.e if object status is alive or firstname and lastname properties/variables are innitiated echo greet() as follows if($teacher->isAlive || $teacher->firstname && $teacher->lastname){ echo $teacher->greet(); } else { echo "Object not innitiated"; } }

There is more you can do with OOP, as illustrated above. Notice how it makes my code shorter, by creating classes, I dont have to literally type everything over and over again, everytime I creat a new object. HOWEVER as PROF Mac said above, its not really necessary and to grasp OOP first you need to understand procedural techniques smileys with beer
Re: OOP
August 13, 2013 01:38PM
Thank you Prof. As for you Sipho.... mmmmhhh! you make me feel like I don't know my PHP as yet, but I will get there... you'll see eye popping smiley
Re: OOP
August 16, 2013 11:16AM
This is very interesting reading, but there is a lot to take in. Will come back to this later once I feel I have more experience with PHP. Thank you!
avatar
Mac
Re: OOP
September 30, 2013 04:33PM
Tessa - you said it exactly like it is intended. Small steps. There is much to learn that we cannot cover in an introductory course, and crawling comes before walking/running smiling smiley
avatar Re: OOP
November 12, 2013 12:39PM
Good afternoon Prof MAC

I'd like to know, how much more of a learning curve do we have after this level?

Can one consider themself a PHP/MySQL Web App Developer after this course and site this certificate as their qualification? What are your recomemndations for a student who's finished this course i.e what else must I learn besides mastering OOP? (this is if one wants to work for a Web Development company as a PHP developer)

I am also curious to know if you're the one who coded this forum and the UNISA website..

Thank you..
avatar
Mac
Re: OOP
November 13, 2013 07:38AM
You will need to learn OOP.
It takes time to become an accomplished programmer. A certificate is just that - they will ask what have you done. You need a portfolio of applications to show what you can do/have done.
This forum software is open sourced.
I have just programmed the Osprey web site which is db-driven and has a admin backed, but that was some years ago. I do program some stuff for the department, but I am not employed as a programmer. It is just to keep up to date.
Re: OOP
November 14, 2013 10:17AM
Hi Prof mac,

It seems that Sipho and I a similar problem. We realize that by doing this course that we've only seen the
tip of an iceberg. We now know we need to learn OOP but we are looking for your expertise as to what
else we should be looking at. Are there other courses available that would complement the one we have
just completed?

Regards CharlesU
avatar
Mac
Re: OOP
November 14, 2013 01:03PM
It is not a problem... it is a processsmiling smiley We do not offer advanced courses yet - still a few years away as the process is long and tedious. As far as I know other courses in SA are presented over a few days.... not sure if that is the way to go. Just build little apps yourself, and learn OOP using the 'net.
avatar Re: OOP
November 14, 2013 01:23PM
Here is a good PHP OOP introductory tutorial -

http://www.tutorialspoint.com/php/php_object_oriented.htm


There are many others, just Google.


There are also many good PHP books, available for free from here -

http://it-ebooks.info/book/411/

(Just use the search facility to find others - there are quite a few).


Also have a look at frameworks like CodeIgnitor and CakePHP.
avatar
Mac
Re: OOP
November 14, 2013 02:04PM
I'll add http://www.killerphp.com/tutorials/object-oriented-php/ which is on the CD.

Basic, but it introduces the basic concepts in a relaxed and easy to understand approach. An updated tutorial is available on the site. There is a PDF which you can download - I do not like videos because my pen which I use to make notes scratches my screen... Have a look at the 1st paragraph, which is what this course tried to do.
avatar Re: OOP
November 14, 2013 03:39PM
Thanks a lot for the input guys, I am finding the killerphp site very interesting..

Coding my portfolio kind of boost my confidence and I promised my boss I'll code an application for our franchise (prodeduraly that is possible) but now I think I want to code it in OOP (Good thing about it is, if I manage to code this application, head office wants to buy it and use it on all their franchises)..

They really liked my Client/Service Data Management App and now they asked me to build sites for all franchises same way as I coded this one.

I'd like to ask Prof Mac if its possible to code Desktop Applications in PHP (Google thinks its possible), if possible how does one go about doing such? What would you recommend? Will I need a framework? or must I stick to NotePad++/Sublime Text?eye rolling smiley
Re: OOP
November 14, 2013 11:01PM
Hi,

I'm still enjoying Prof mac's opinion about videos! See php can be fun! Thanks bigron, glad to see you you still
keeping an eye on things,your sites and input is always useful!

CharlesU
avatar
Mac
Re: OOP
November 18, 2013 09:53AM
72903694_Sipho Wrote:
-------------------------------------------------------
> I'd like to ask Prof Mac if its possible to code
> Desktop Applications in PHP (Google thinks its
> possible), if possible how does one go about doing
> such? What would you recommend? Will I need a
> framework? or must I stick to NotePad++/Sublime
> Text?eye rolling smiley

Depends what you mean by a desktop app... if you installed xampp and ran the code it can be considered an desktop app. GTK allow you to create a desktop-app graphical user interface - I think that is what you meant.
http://zetcode.com/gui/phpgtktutorial/

But now I need to get back to marking...
avatar Re: OOP
November 29, 2013 09:45AM
@Sipho

Notepad++ is ok, but I came across an IDE that makes PHP development so much easier. Have a look at NuSphere I downloaded the trail version and after a couple of days they contact you regarding if you like their program. I told them yes, but that it was very expensive and that I am currently studying PHP. Instantly they sent me a voucher and I got the software a student pricing. It is an awesome program. I just got version 11 of it and it works like a dream. For the amount that it cost it is definitely, worth every sent.

Well done on the app for the job!! I am doing the same at the moment at my place. Just need to figure out how to get PHP to talk to the Oracle database.

___________________________________________________________________________
Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning...
Sorry, only registered users may post in this forum.

Click here to login