background preloader

Pearltrees

Facebook Twitter

Five common PHP design patterns. Editor's note: See the follow-up article "Five more PHP design patterns" to learn about five additional design patterns that you might find useful. Design patterns were introduced to the software community in Design Patterns, by Erich Gamma, Richard Helm, Ralph Johnson, and John Vlissides (colloquially known as the "gang of four"). The core concept behind design patterns, presented in the introduction, was simple. Over their years of developing software, Gamma et al found certain patterns of solid design emerging, just as architects designing houses and buildings can develop templates for where a bathroom should be located or how a kitchen should be configured. Having those templates, or design patterns, means they can design better buildings more quickly.

The same applies to software. Design patterns not only present useful ways for developing robust software faster but also provide a way of encapsulating large ideas in friendly terms. The factory pattern The problem is tight coupling. PrinciplesOfOod. The Principles of OOD What is object oriented design? What is it all about? What are it's benefits? What are it's costs? It may seem silly to ask these questions in a day and age when virtually every software developer is using an object oriented language of some kind. Yet the question is important because, it seems to me, that most of us use those languages without knowing why, and without knowing how to get the the most benefit out of them. Of all the revolutions that have occurred in our industry, two have been so successful that they have permeated our mentality to the extent that we take them for granted. Programs written in these languages may look structured and object oriented, but looks can be decieving. In March of 1995, in comp.object, I wrote an article that was the first glimmer of a set of principles for OOD that I have written about many times since.

These principles expose the dependency management aspects of OOD as opposed to the conceptualization and modeling aspects. Poop.jetroy.we.bs. SVG Dragging. How To Enable Dragging in SVG | CodeDread Blog. SVG allows you to do quite a bit in terms of graphics in the browser that was not possible without a special plugin like Flash. This post describes how I enabled dragging of entities around the screen. Introduction If you are unfamiliar with SVG I would recommend checking out my two Kickstart tutorials here: One and Two. Furthermore, you can see many useful examples at SVGBasics. This should give you a good start if you’ve never seen SVG or XML before.

However, this entry also assumes you are moderately familiar with web development concepts like the DOM and JavaScript. My goal was to create an SVG document that allowed the user to drag entities around the screen as they do with existing windowing environments today. SVG Events In SVG 1.1, you can hook up event handlers to SVG entities by techniques that should be familiar to most HTML/JS coders nowadays: When the rectangle is clicked on, the JavaScript function buttonClick() will be called which lets you do whatever you want.

Dragging. Browser Statistics. Flash’s Future Fades as Windows Close on Adobe | Gadget Lab. Microsoft gave out Samsung Windows 8 tablets at its 2011 BUILD Conference. Image: VentureBeat The future of Flash looks dimmer and dimmer as another major player in the mobile space shuns support of the platform. Microsoft’s brand new Windows 8 Metro user interface will not support Adobe Flash or other plug-ins, instead embracing the HTML5 set of web standards, according to Microsoft’s Internet Explorer team leader Dean Hachamovitch. For users who access legacy ActiveX controls, they’ll have to jump out of the Metro UI and switch to the classic-styled desktop browser. Hachamovitch explains that running IE without Flash or other plug-ins “improves battery life as well as security, reliability, and privacy for consumers.”

“Providing compatibility with legacy plug-in technologies would detract from, rather than improve, the consumer experience of browsing in the Metro style UI,” Hachamovitch wrote in a blog post on Thursday. And Android isn’t the only OS running Flash poorly. Note 1.