PHP, Actionscript Object Oriented Programming Design Pattern - php

I was wondering how to do the PHP OOP design pattern for real life application. I wish someone can share their learning experience with me. I am particular interested in PHP and actionscript. Most of the books I could find in the book store are only basic PHP (or AS3) programming. I appreciate any help. Thanks!
Please do not close this topic..I am so desperate to know the answer since no one around me can help me about the topic. Stackoverflow is the best forum that many experts always help people when someone needs it.

I'm not sure if this is exactly what you're looking for but on the last couple Actionscript 3 projects I've developed I have used a combination of PureMVC and AMFPHP with great results. I am a PHP novice but know AS3 well. Hooking up a proxy to a AMFPHP service was pretty straightforward and using commands and notifications worked well.
If you're new to Actionscript or PureMVC you can find project skeletons that will help get you started.

I felt that PHP Objects, Patterns and Practice by Zandstra (ISBN13: 978-1430229254, ISBN10: 143022925X) was one of the most effective books when it came to upping my game in PHP. It covers patterns pretty extensively with some real world examples and clear explanations.

Related

Objective C for iOS... a good resource for a php programmer?

I have been developing web apps (primarily) using php and a bit of python, mysql, etc for many years now. I have a reasonably good grasp of objective-based development, and use objects as much as possible in my projects, although I certainly don't take full advantage of them. I am comfortable enough to be dangerous with C++,C, and have even touched a bit on ruby.
All that said, Objective C is giving me a very hard time. Not sure if it's the syntax, the file structure, etc, but i'm just not grasping how to properly put together the different components of an app, despite having gone through a few tutorials and explanations online. I have xcode, and have tried doing some basic stuff, but get lost quickly in real implementation.
My question: Can anyone recommend me a really solid book/books with some good examples that I can walk through to help me understand this language better? I am primarily interested in database interaction (or xml parsing) and audio streaming/delivery capabilities.
Any suggestions would be very much appreciated! Thanks!
3 items:
The syntax isn't going to be a problem for long. Just keep reading Objective C code, and pretty soon the brackets will start seeming as familiar as the dots (or other forms of punctuation abuse) in other OO languages.
If you are a procedural language coder, you will have to get your head around event driven application design. The basic idea is you can't always tell the OS what to do, when you want to do it, and then do the next thing. You have to learn to chop up your procedural code into callbacks, and then let the OS call your code when the OS is good and ready. You might have to learn how to save appropriate state between callbacks (e.g. You can't use a "loop index" between callbacks without saving it somewhere.)
You might also have to get used to the object oriented MVC design pattern. It's like figuring out the difference between writing procedures for a one-man store, and setting up operations for a larger business with divisions in separate buildings. The guy talking to the customer isn't the guy closing the books. Same with MVC, the view presenting the UI to the user isn't necessarily the same object that does the storing or updating of the data representing what the user sees or does. Once you learn the logic of the separation, figuring out which file to look in for something will get a little easier.
I found Aaron Hillegass' book really helpful in learning Objective-C
iPhone Programming Big Nerd Ranch Guide
There are a bunch of good chapters that walk you through creating your own apps you can deploy right to your iPhone/iPad or run in the simulator. He explains some of the heavier concepts i.e. Core Data really well.
Other than that the Apple Developer docs are a great and invaluable resource.
I cannot recommend any books (I have learned it by doing a lot of experiments), but if you want to get started with Objective-C, I would recommend knowing what pointers are and how to use them. They form the most basic part of Objective-C and once you understand these (and NSObject), you understand 50% of the language itself.
You could, of course, read Apple's documentation at http://developer.apple.com/library/ios/#referencelibrary/GettingStarted/Learning_Objective-C_A_Primer/
I would recommend:
iPhone Programming: The Big Nerd Ranch Guide
It is a very nice getting started guide for both Objective-C and iOS programming.
The official documentation is great: http://developer.apple.com/library/ios/#navigation/
This is a great book. You need to understand Objective-C before you start jumping into creating apps (Cocoa Touch): http://www.amazon.com/Programming-Objective-C-2-0-Developers-Library/dp/0321711394/ref=sr_1_2?s=books&ie=UTF8&qid=1296848502&sr=1-2
This is a great intermediate book: http://www.amazon.com/Cocoa-Design-Patterns-Erik-Buck/dp/0321535022/ref=sr_1_1?ie=UTF8&qid=1292262048&sr=8-1
This is a great forum to learn stuff, in addition, obviously, to here: http://www.iphonedevsdk.com/forum/
The Apple developer videos are also great, and you can download them with iTunes if you want, to have them on the go: http://developer.apple.com/videos/
Also, check out the Stanford iPhone Programming Class videos on iTunes.
EDIT:
Here is the docs on Apple's XML class, NSXML: http://developer.apple.com/library/mac/#documentation/Cocoa/Reference/Foundation/Classes/NSXMLDocument_Class/Reference/Reference.html
And if you're going to be using databases, they'll probably be SQLite, and you'll definitely want to check out this wrapper for SQLite: https://github.com/ccgus/fmdb

Where to start in learning how PHP works?

I know PHP but I don't know why things work the way they do. I just know it has worked in the past so I just put it in there.
I can't seriously call myself a web developer until I truely know the languages I am working with. And if someone asks me why this does that etc., and I can't answer them, it's just wrong.
So my question is, where would be a good place to start learning how things work? I know there is the PHP Documentation but it's quiet large and intimidating. And I know there is college, but are there any other ways?
Appreciate it!
I suspect you just need to read a few good books. There's an existing question ("What is the best PHP programming book?") which should provide more than enough PHP specific books, but I'd also recommend some good general purpose books such as Code Complete. (There's a great language agnostic list within the "What is the single most influential book every programmer should read?" question.)
Whilst it might take a while to wade through these, you'll be a much better programmer if you do, and there's no reason why you can't just read them on a chapter by chapter basis as and when you have the time.
The old fashioned way - a good book.
php Cookbook
Programming PHP

PHP Practice Questions Excercises?

I am learning PHP with help of Wrox Beginning PHP5 but there aren't many practice question in there so can u guys know where I can find a whole bunch of PHP exercises? Kind of like homework/math problems. Where they get increasingly difficult and elaborate.
Practice I am looking for are on the following topics:
Decisions, Loops and Arrays.
Functions.
XML
Files & Directories.
Thanks in advance.
Regards,
appu.
You could try to come up with a web application to create. Forums, a Pythagoras solver etc.
http://projecteuler.net/
There are lots of questions on here like this, search for php project/challenge.
If I were you I'd come up with a small project for yourself, build a small website based on some interest you have. Implement basic things like logins, CRUD operations etc.
This will give you much more experience and build your knowledge quicker than completing small unrelated tasks.
Learning PHP is easy. In fact learning an language is easy. If you try learning it in the course of building a whole project your self it would teach you the practical implementation of functions and concepts. You can even search for projects on internet which will help you for having an start. I even learnt php in course of developing an project for my course work. Good Luck with your efforts.

What is the most extensive PHP/MySQL combo book?

I know this isn't a directly programming related question but I need some help in deciding which book to buy. I usually never buy books, instead I download instructional videos and ebooks from file sharing sites. But I want to buy one big fat book now that I can read on the subways to and from work.
So for MASTERING php/mysql which book has helped you the most and you would recommend above all others.
I don't know how much experience you have with PHP/MYSQL, but the two main books that I have used to master PHP are Head First: PHP/MYSQL, which uses a really interesting graphical teaching method, and Advanced PHP Programming by George Schlossnagle. Those are really the only two books you need to get up and running with PHP. Read up on all of the content that is pre-built in PHP by using PHP.net. Other than that, just code a lot. The best way to master PHP is through experience.
Head First PHP/Mysql --very good book that gets you on the right track.
PHP and MySQL Web Development 4th Edition --covers everything of php/mysql that a beginner needs to know. EDIT: This book is better off as a reference then a "learning" book because it covers a lot but not in depth.
AFTER you have learned all of procedural PHP, consider moving to a framework.
I've looked through a lot of books after just getting in and working on things for about a year. None has been as useful as actually getting in, trying things out, and asking advice of people with more experience.
As such, I recommend Google and StackOverflow.

How to start facebook app?

Just want to know what is better way to get start developing faccebook app?Any tutorial recommnedation?And which is better to start up -php or rails?
From my experience, there is a much better support focus on PHP than on anything else. That said, there'd be no point learning PHP just to take advantage of the superior support.
Two other general points:
The official support community is really awful. The community has no expert voices and the FB staff only interject when their reputation is at stake. Your best friend is Google and your ability to extrapolate from tutorials.
The FB style of interaction doesn't really lend itself to an MVC framework. One might still save you time, but I find they get under my feet. If you need convincing on this point, may I refer you to the many cases where JSON responses are required or where FBML needs to be 'set' for the profile.
The Facebook platform isn't a whole lot of fun and your users won't thank you for your work. But it's a massive audience and a very useful learning experience.
Good luck!
Btw, you can also use ASP.NET, in which case here is how to get started:
http://www.stevetrefethen.com/wiki/Facebook%20application%20development%20in%20ASP.NET.ashx
The link includes a VS.NET starter kit which makes it very easy to get started quickly.
Start with their docs: http://developer.facebook.com/get_started.php?tab=tutorial
There are libraries floating around for lots of different languages and frameworks so I say: whatever you're happiest with is where you should start.
I've seen pretty complete FB wrapper libraries for both PHP and Ruby. Which one you should choose really depends on which language/framework you're more comfortable with.
I will say that when I was evaluating Ruby libraries recently, Facebooker seemed to be superior in terms of active development and tutorial content on the web. (Be sure to use the Facebooker project on GitHub, not the deprecated one on RubyForge.)
Can I put a shout out for Ruby On Rails with the Koala gem?
I have built a Facebook app in the last two months learning Ruby On Rails from scratch (the last programming of any kind I did was mathematical modeling for my Physics degree project in 1995 in Fortran!).
Ruby On Rails was very simple to pick up and there is a ton of help out there. There are also lots of work already done for you in the way of Ruby Gems. For Facebook I looked through them all and I found Koala the easiest to use, personally.
http://github.com/arsduo/koala/
Re: Ruby on Rails vs. PHP - whichever you're currently competent in. If neither, whichever you'd like to become competent in. Both can do what you want.
Use the Get Started tutorial on developers.facebook.com. This will suggest you use the sample code button which will give you some PHP to list your friends.
Then you can start playing with the PHP using the wiki for reference to the FQL and FBML.
PHP will be easier to start with as there are lots of samples in PHP. Rails may have advantages in the long term though.

Categories