Big Ball of Mud Brian Foote and Joseph Yoder Department of Computer Science University of Illinois at Urbana-Champaign 1304 W. Springfield Urbana, IL 61801 USA email@example.com (217) 328-3523 firstname.lastname@example.org (217) 244-4695 Saturday, June 26, 1999 Fourth Conference on Patterns Languages of Programs (PLoP '97/EuroPLoP '97) Monticello, Illinois, September 1997 Technical Report #WUCS-97-34 (PLoP '97/EuroPLoP '97), September 1997 Department of Computer Science, Washington University Chapter 29 Pattern Languages of Program Design 4 edited by Neil Harrison, Brian Foote, and Hans Rohnert Addison-Wesley, 2000 This volume is part of the Addison-Wesley Software Patterns Series. This paper is also available in the following formats: [PDF] [Word] [RTF] [PostScript] Also by Brian Foote and Joseph Yoder Architecture, Evolution, and Metamorphosis The Selfish Class This paper was twice featured in Slashdot A number of additional patterns emerge out of the BIG BALL OF MUD. Still, this approach endures and thrives.
Encoder son site intégralement en UTF-8 Il existe deux méthodes en PHP permettant d'afficher du texte en UTF-8. Après avoir bien sûr encodé correctement tous les fichiers selon la manière décrite juste au-dessus. L'une est radicale au niveau du fichier, l'autre se fait au cas par cas, sur chaque texte à afficher. La méthode radicale consiste à mettre en première ligne de chaque fichier, un header qui va préciser au serveur de renvoyer de l'UTF-8 : header( 'content-type: text/html; charset=utf-8' ); L'autre méthode consiste à utiliser une fonction PHP autour du texte que l'on veut afficher en UTF-8 : Fonction utf8_decode() Sélectionnez echo utf8_decode( 'Ici mon texte en UTF-8' ); La différence entre les deux méthodes est flagrante. Faisons un petit test pour nous en convaincre. header( 'content-type: text/html; charset=utf-8' ); echo 'Texte accentué Dans test2.php nous mettons ce code : Ouvrons-les dans le navigateur. Mais pourquoi utf8_DEcode() alors que l'on veut ENcoder en UTF-8 ? Encodage Apache AddDefaultCharset utf-8
Understanding Event Delegation Event delegation allows us to attach a single event listener, to a parent element, that will fire for all descendants matching a selector, whether those descendants exist now or are added in the future. For the remainder of the lesson, we will reference the following HTML structure: When an anchor in our #list group is clicked, we want to log its text to the console. Normally we could directly bind to the click event of each anchor using the .on() method: While this works perfectly fine, there are drawbacks. Consider what happens when we add a new anchor after having already bound the above listener: If we were to click our newly added item, nothing would happen. Understanding how events propagate is an important factor in being able to leverage Event Delegation. <a><li><ul #list><div #container><body><html>document root This means that anytime you click one of our bound anchor tags, you are effectively clicking the entire document body!
Well-Intentioned Destruction The custom-built PHP-based content management system suffered from the classic problem of too many cooks in the kitchen. Every code file had conflicting naming conventions and coding styles, structures and duplicate methods all over the place; a Big Ball of Mud. And Dan S. was thrown head first into it. Dan was trudging through the usual drudgery of low-to-medium priority tickets, when suddenly the heavens cracked open and a Very High priority ticket descended from the sky; the first he'd ever seen. Wonderful, Dan thought, our clients can't differentiate the difference between "edit" and "delete." A few months went by, and the same thing happened. 01/25/2009 11:32:43 [Dan] Deleting page ID 108 The only way that a page could be deleted without it being logged is if something had direct database access (for example, all of the other developers on his team), or if someone had bypassed security. A Well-Intentioned Destructive Force And that's when he saw something troubling.