I’ve finally made it to my first Zendcon. Its nice to see some familiar faces and also nice to put new faces to familiar names.
I gave my maintainable PHP talk this morning. I love doing this talk. Thanks to everyone who attended. I’ve put the slides (pdf) up on my talks page.
Much of the material is based on Test Pattern columns that I’ve written for php|architect. Here are some of the specific columns.
One thing I like about both writing on and presenting on the same material is that I get feedback from the presentations that I can put back into the writing and vise versa. I’m looking forward to finding some better ways to explain layering and the depend on abstractions principle. If you saw the talk, was there anything you particularly liked or needed work? Leave a comment here or on the joined.in page.
Here are some of the books I mentioned in the talk.
I sat in on the PHP Code Review talk this afternoon. I thought it was a great complement to my talk. I tend to be a bit theoretical and this talk was very practical, but we covered a lot of the same principles. Nice talk. Nice scheduling, Zend.
I’m really looking forward to tomorrow. Unfortunately, I have to go back to work on Wednesday.
I have to disagree with your list of drawbacks of DI. You mention that DI requires all potential dependencies to be instantiated. I do not see a drawback here, in case you hardcode the dependencies inside your classes you will also need instances of the objects that the class relies on. Optional dependencies can be set via Setter-Injection, thus not every dependency needs to be passed as constructor parameter. Many direct dependencies can force you to pass many parameters to the constructor but in such a case your application design might not be the best.
Very nice slides, i liked it.
Stephan, did author not mean that dependency has to be instantinated locally or become dependency?
I agree it can become an issue as you want to use an object and suddenly you depend on everything it depends on. Then you have to pass these instances in or create them in many many places.
Usually list of dependencies is not that long but it can be still a pain to pass the along everywhere you go. Especially that they add up int a
Lets assume my validator depends on the config (does not matter why or if it makes sense). Now every form using it will need to inject config object. So every controller using forms like that one has to pass config as well etc. Or every form has to create new instance which makes it directly depending on config (even worse i guess).
Optionally for shared instances some people use repository like Zend but i dislike global-ness of that approach a bit. You never know who add stuff to it and when or where. But for some very basic instances it might be the only easy way out.
Art
There are situations where DI and lazy loading conflict. You can do setter injection to inject optional dependencies. that may also force you to move logic outside of the class to make that decision to inject where you’d rather have that decision inside the class.
Managing the dependencies and building the objects should be done by your DI container so you do not need to worry about deeply nested objects. Instead you just have to ask the container for the object you want, all the wiring is done automatically for you.
did author not mean that dependency has to be instantinated locally or become dependency?
Nice tutorial.Thank’s
important issue, nice post.
Thanks for the slides really enjoyed them. I have one question as I did not see the talk. Why do you turn an array of variables into an object/s
hello,
I seen your PHP Talks, it nice explaining about PHP.It really impotent think in PHP.
thanks
wow,
you delivers a very nice slide, I really love it.
good work keep going on.
I have to disagree with your list of drawbacks of DI. You mention that DI requires all potential dependencies to be instantiated. I do not see a drawback here, in case you hardcode the dependencies inside your classes you will also need instances of the objects that the class relies on. Optional dependencies can be set via Setter-Injection, thus not every dependency needs to be passed as constructor parameter. Many direct dependencies can force you to pass many parameters to the constructor but in such a case your application design might not be the best.
+1
nice article, thanks to share
you’re one smart cookie. thanks for posting the slides for those of us that couldnt attend
I found this article to be a very interesting read! Thank you for sharing this with us!
You prepared really good slide deck, it can be of great use for software engineers.
p.s another option would be to remove the dependency altogether and use AOP.
Simply desire to say your slide deck is as astonishing. Thank you for sharing this with us!
Very Nice article, Thanks.
An interesting blog that easily loses me in moments – I’ll be honest and say I came with motives. I hoped you might like looking at this link, where I’ve blogged about a new social networking site that would be amazing to see made. If it ever got made, I wouldn’t be greedy – only hoping 5% if possible for coming up with the idea. So far, everyone loves the idea on the blog so I’m posting this message to a few blogs to generate interest.
TrendE
http://dravenames.blogspot.com/2011/02/trende-new-social-networks.html
hi this is good.
Great tutorial. thankyou
This last year our team did just want you recommended for our website, re-organized for change. Our PHP/Javascript/mySQL website was very hard for new developers to work with. There was a lot of code redundancy, so we decided to restructure the website by using more classes and stripping out all SQL calls from within the code. While this effort took almost 9months, it was well worth it! thanks
%100 Do?al ve hiç bir yan etkisi olmayan Uzamax’? ke?fedin
UZAMAX içeri?inde mineral ve vitaminler bar?nd?ran, do?al bitkielerden üretilmi? g?da deste?idir. ?çeri?inde herhangi bir kimyasal ürün bulunmamakla birlikte tamamen do?al kurutulmu? bitkisel bir kar???md?r. Sadece birkaç ayl?k kullan?m kürü sonras?nda bile uzamax’?n etkisini hissedeceksiniz.
Uzamax kullanarak do?al yollarla bünyenize gerekli olan tüm besin, vitamin ve mineralleri vücudunuza alman?z? sa?lar.izlanda yosun hapi
Great tutorial. Well done!
Great tutorial. loved the slides thanks for sharing.
Thank you. Just what I was looking for. Great tutorial. Ales
i just catch the problem. and now i will can fix it. thanks
I’m sorry to say there may be a louis vuitton tote bag lie in your closet.And now run to see whether there is a woven label say it’s made in US?Coach,mostly we can say it as a fashion icon,but can’t regard as costless goods.During the worse economic crisis ages,louis vuitton tote CEO Lew Frankfort had a new definition as a young silk-stocking brand “You can own it easily”.We can’t deny the saying run it’s degree up.Let’s take a Lv as an example which you can buy it at around 6000 RMB while a louis vuitton mens wallet tote only deserve one third of it.Though you see all louis vuitton tote selling shops or flagship malls close to LV but it still can’t play as it was that degree.Just like we all know that neighbours have different degrees too.Thanks for the high duties ,discount louis vuitton bags tote becomes valuable brand,but we still confuse a 5000 RMB bag has a what percentage for government?
I agree to this post. Since My Blog shows following:
Rasmus Lerdorf (born on 22th Nov 1968, in Greenland) is a Danish programmer with Canadian citizenship and is most notable as the creator of the PHP programming language.He authored the first two versions. Lerdorf also participated in the development of later versions of PHP led by a group of developers including Jim Winstead (who later created blo.gs), Stig Bakken, Shane Caraveo, Andi Gutmans and Zeev Suraski.
nice tutorial.. thanks for sharing
Our PHP/Javascript/mySQL website was very hard for new developers to work with. There was a lot of code redundancy, so we decided to restructure the website by using more classes and stripping out all SQL calls from within the code. While this effort took almost 9months, it was well worth it! thanks
nach verschiedene Kunststil und Thema. Außerdem können wir auch nach Maß schaffen, die für unsere true religion Kunden die Einzigartigkeit Ihrer Individualität betonen.
Ölgemälde
Ölbilder
Mit Tiffany Schmuck wie z.B Tiffany&Co und Anhänger sieht man ziemlich elegant und charakterisiert aus. Gönnen Sie sich Glaskunst von Tiffany mit günstigen Preisen in Tiffany Onlineshop.
Tiffany & co
Tiffany Schmuck
THanks for sharing.Will wait for your next blog.
epixeltechnologies.com/
Everything you mentioned is correct, but there are so much upsides. Like, able’t be fired.
I have been using codigniter for the last 3 years. Maintainable code is an area that I’m researching in at the moment . I found your post very informative and resourceful.. thank you very much
http://www.Yagnaum.com – the leading software development company providing custom application Development services using PHP, .Net, Drupal, Microsoft, ATG, etc.
Follow Yagnaum systems at LinkedIn @ http://www.linkedin.com/company/yagnaum
dédouanement. Bon de réduction peut être eu avec ces magasins si vous êtes disposé à régler pour les gants
vue de face montrant sur un fond blanc. Le visage doit être comprise entre 1 et 1 3 / 8 pouces à partir du menton au sommet de la tête. Chapeaux, coiffures et uniformes, sauf mot de vêtements religieux quotidiens ne peuvent pas être portés.
Nice tutorial thanks for share.
PHP Tutorial
Rolex Datejust Two Tone
Thanks a lot for your interesting article. I have been searching for such information for a very long time. Not everything is completely easy to understand to me, but it is definitely interesting and worth reading.
Breaking News: Rock Plc Berries Lang & Schwarz sees fair value such shares at € 46.98! Dear investor, dear investor, We will contact you between middle midst of the holiday season or still hammer at you. In today’s breaking news to rock Berries Plc (A1JNYV) are our a using the brilliant results of a company’s current assessment of the prestigious brokerage firm Lang & Schwarz . We would like to take this place , Member an investor event of Berries Rock Plc, which there are the consisting distributed presentation materials has made ??available. First of all: Lang & Schwarz comes to the conclusion Summary , that is for Rock Berries a fair value of € 46.98 each must share. At a current share price of 19.60 € results from this fundamental undervaluation thus thus a short-term upside potential of at least at least 139 percent. But the Opinion displays moreover that in this place or much more to imagine schaffbar.
Your Buzzness,
My boyhood actually preceeded the Nixon administration, so I guess I outrank you. Hey gang, Geezer Wars! I am neither surprised at your insult, as that’s exactly how you entered the fray. However, instead of wasting valuable electrons insulting me, why don’t you summarize what you learned in Statistical mechanics class O Great One? The important stuff, like how chaos naturally crystallizes and evolves into organic entities and processes with primary, secondary, tertiary, quaternary, and as yet unidiscovered levels of structure and interaction, as in the greater than 10,000 complex enzymes operating within a geologically ancient unicell, the absence of any one of which renders the unicell lifeless or dysfunctionally short-lived or sterile. Not even bringing in the organelles and DNA/RNA programming and its support and executive systems that contain the potentiation for common life processes, wings and trunks and teeth (two sets!) and dreams. Oops, that would have been in your Org Chem, Bio Chem or Microbiology course prerequisites for the rest of life.
Nice explaining about PHP.I have been searching for such information on PHP thanks a lot
Our PHP/Javascript/mySQL website was very hard for new php developers to work with. There was a lot of code redundancy, so we decided to restructure the website by using more classes and stripping out all SQL calls from within the code
because i am the php developer . from usa
Outrank Smart is a new kind of backlink generator that provides the user with the ability to get backlinks from link exchanges on autopilot. The system gets thousands of links with the push of a button…
[...]ZendCon: Writing Maintainable PHP Code – Professional PHP[...]…
ggggggggggggggggggggggg
Great blog and it has helped me a lot to organize my website, http://cliplist.com, all my pages before it were a mess and almost impossible to maintain.
Wow, superb weblog structure! How lengthy have you been blogging for? you make running a blog look easy. The total glance of your site is excellent, let alone the content material! Prime Escorts, 350 Kennington Lane, London SE11 5HY, 028 8788 0034
Fantastic blog post, saw on…