Sunday, March 18, 2012

Biweekly roundup: PHP.TO.START sold out

Apparently the Turin event taking place this week is sold out. If you will be present, feel free to come up to me for geek chatting or OO/PHP/testing questions (which is the topic I will talk about.)

In the last two weeks I have published several new articles on DZone, also about other pieces of the web:
A Zend Framework 2 tryout is my review of the Zend Framework 2 beta releases, along with a list of what you don't have to learn again for now.
Asynchronous and negative testing is about testing that something does not happen in a running system.
All the mouse events in JavaScript is a collection of all and only the DOM events that are generated by a mouse, divided into classic and HTML5 ones.
Everything you need to know about Python exceptions is about the try..except..else..finally construct and the exception hierarchy of Python.
All about JMS messages topic's is a must-know for working with ActiveMQ and similar message-based middleware - I know middleware sounds like a buzzword, but I assure you it has a specific meaning.
CSS Bits: The Mouse Cursor is about customizing the mouse cursor appearance (interestingly, without any JavaScript code).
Bootstrap: rapid development and the complexity of a framework is my review of Bootstrap, a front end framework shipping some standard CSS solutions and UI widgets.
Test-Driven Emergent Design vs. Analysis is an essay about the dichotomy between writing code with the support of tests and exploring new classes and objects via other fluffy means like paper and boards. You know, that old thing called thinking.


Anonymous said...

Hi Giorgio, I saw over on where you said that (in the context of the blog) 'I don’t agree that object-oriented programming should go beyond bread.slice()'. For a silly example like a bread slicer, I agree. But what about something more complicated? Wouldn't a Service make more sense? That is, the analog of slicer->cut(bread) or something like that [for more complicated modeling, obviously]. Something outside of the bread itself operates on the bread. Still, the extra complexity of an external service doesn't make sense for that model, but I feel that it would in a more complicated model.

Giorgio said...

There are many choices for this design, and some include a service injected into the Bread object via a parameter:
or as a field:
b = new Bread(knife);
but without more information about the requirements it's difficult to choose one of these or external service or a functional approach where bread is just a data structure.