<?xml version="1.0"?>
<?xml-stylesheet type="text/css" href="http://wiki.huihoo.com/skins/common/feed.css?303"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="zh-cn">
		<id>http://wiki.huihoo.com/wiki/?action=history&amp;feed=atom&amp;title=%E7%94%A8%E6%88%B7%3AXifo</id>
		<title>用户:Xifo - 版本历史</title>
		<link rel="self" type="application/atom+xml" href="http://wiki.huihoo.com/wiki/?action=history&amp;feed=atom&amp;title=%E7%94%A8%E6%88%B7%3AXifo"/>
		<link rel="alternate" type="text/html" href="http://wiki.huihoo.com/wiki/?title=%E7%94%A8%E6%88%B7:Xifo&amp;action=history"/>
		<updated>2026-08-17T03:24:36Z</updated>
		<subtitle>本wiki的该页面的版本历史</subtitle>
		<generator>MediaWiki 1.19.2</generator>

	<entry>
		<id>http://wiki.huihoo.com/wiki/?title=%E7%94%A8%E6%88%B7:Xifo&amp;diff=41604&amp;oldid=prev</id>
		<title>Xifo：以内容'Chapter 10. Code Organization  Table of Contents Overview Encapsulation Managing Dependencies Exercises Overview  When you move beyond adding simple enhancements to your we...'创建新页面</title>
		<link rel="alternate" type="text/html" href="http://wiki.huihoo.com/wiki/?title=%E7%94%A8%E6%88%B7:Xifo&amp;diff=41604&amp;oldid=prev"/>
				<updated>2010-10-31T13:03:37Z</updated>
		
		<summary type="html">&lt;p&gt;以内容&amp;#039;Chapter 10. Code Organization  Table of Contents Overview Encapsulation Managing Dependencies Exercises Overview  When you move beyond adding simple enhancements to your we...&amp;#039;创建新页面&lt;/p&gt;
&lt;p&gt;&lt;b&gt;新页面&lt;/b&gt;&lt;/p&gt;&lt;div&gt;Chapter 10. Code Organization&lt;br /&gt;
&lt;br /&gt;
Table of Contents&lt;br /&gt;
Overview&lt;br /&gt;
Encapsulation&lt;br /&gt;
Managing Dependencies&lt;br /&gt;
Exercises&lt;br /&gt;
Overview&lt;br /&gt;
&lt;br /&gt;
When you move beyond adding simple enhancements to your website with jQuery and start developing full-blown client-side applications, you need to consider how to organize your code. In this chapter, we'll take a look at various code organization patterns you can use in your jQuery application and explore the RequireJS dependency management and build system.&lt;br /&gt;
&lt;br /&gt;
Key Concepts&lt;br /&gt;
&lt;br /&gt;
Before we jump into code organization patterns, it's important to understand some concepts that are common to all good code organization patterns.&lt;br /&gt;
&lt;br /&gt;
Your code should be divided into units of functionality — modules, services, etc. Avoid the temptation to have all of your code in one huge $(document).ready() block. This concept, loosely, is known as encapsulation.&lt;br /&gt;
&lt;br /&gt;
Don't repeat yourself. Identify similarities among pieces of functionality, and use inheritance techniques to avoid repetitive code.&lt;br /&gt;
&lt;br /&gt;
Despite jQuery's DOM-centric nature, JavaScript applications are not all about the DOM. Remember that not all pieces of functionality need to — or should — have a DOM representation.&lt;br /&gt;
&lt;br /&gt;
Units of functionality should be loosely coupled — a unit of functionality should be able to exist on its own, and communication between units should be handled via a messaging system such as custom events or pub/sub. Stay away from direct communication between units of functionality whenever possible.&lt;br /&gt;
&lt;br /&gt;
The concept of loose coupling can be especially troublesome to developers making their first foray into complex applications, so be mindful of this as you're getting started.&lt;/div&gt;</summary>
		<author><name>Xifo</name></author>	</entry>

	</feed>