This is the P2PU Archive. If you want the current site, go to www.p2pu.org!
You haven't posted any discussions yet.
Topic for week 1 assignments, questions and answers. Please post only pastie links if you have a lot of code. It is easier to read and to refer to exact line.
Here's my first stab at the assignment, using furnace and air conditioner as the objects.
http://pastie.org/1596872
I think I hit on just about every point from the reading, except for the private properties/methods as I wanted to reuse elements from furnace in ac. I kept the $temp variable outside of the objects, as in real life temperature is an ambient thing and not tied to a particular appliance :)
This week's assignment: http://pastie.org/1602457
I'm excited because it's all clicking into place, the article is very clear and easy to understand.
I used a person / student analogy I think it fits nicely.
http://pastie.org/1603000
I went with a modified car idea. I also tried a thing my friend told me(can be seen at set-methods and on lines 103 and 104). I had trouble of finding "real life" useful idea, but I think I got the point.
FlashLight: http://pastie.org/1607768
I don't know if I use Inheritance the right way.
It's hard to pick simply-enough real world object for this assigment. I think there are 2 types of objects:
1. Objects with properties only, for example: apple, battery, paper. For this objects i can do only get/set methods for getting/changing state of object (apple is green, battery is empty).
2. living objects or objects with some controls, for example: dog, mobil, elevator. This objects can DO something.
What do you think about this?
http://pastie.org/1611322
Could not think of any "real life" example so i did some file handling stuffs. I have tried to follow Zend coding stander.
Does this ( http://pastie.org/1612454 ) makes sense ?
Oh well, at least I had some fun coding it.
Enjoy "Pokenom battles" php style.
Example from my life:)
http://pastie.org/1618362
Finally done my assignment #1.
It's a classes to work with html tags
http://pastie.org/1643830
I've also created single html page with TOC about Zend Framework Coding Standard (http://pastehtml.com/view/1dj918o.html). All texts was taken from http://framework.zend.com/manual/en/coding-standard.html . I've done it to read on my kindle.
here is my assignment for week 1,
http://pastie.org/1642920
i think that the material is not enough to give u a good idea about php classes if any one knows any good links that explain more about classes that would be helpful