Home Page Icon
Home Page
Table of Contents for
Developing Large Web Applications
Close
Developing Large Web Applications
by Kyle Loudon
Developing Large Web Applications
A Note Regarding Supplemental Files
Foreword
Preface
Audience
Organization of This Book
Conventions Used in This Book
Using Code Examples
We’d Like to Hear From You
Safari® Books Online
Acknowledgments
1. The Tenets
Managing Complexity
Modular Components
Achieving Modularity
Encapsulation
Abstraction
Loose coupling
Benefits of Modularity
Ten Tenets for Large Web Applications
2. Object Orientation
The Fundamentals of OOP
Why Object Orientation?
UML Class Diagrams
Generalization
Association
Modeling a Web Page
Defining Page Types
Defining Module Types
Writing the Code
Achieving Modularity
Object-Oriented PHP
Classes and Interfaces
Declaring a class
Using objects
Constructors
Information hiding
Class data members
Class methods
Declaring an interface
Inheritance in PHP
Extending classes
Implementing interfaces
Abstract classes
Final methods
Object-Oriented JavaScript
Objects
Creating an object
Using objects
Constructors
Information hiding
Class data members
Class methods
Inheritance in JavaScript
Prototype-based inheritance
3. Large-Scale HTML
Modular HTML
A Bad Example: Using a Table and Presentation Markup
A Better Example: Using CSS
The Best Example: Semantically Meaningful HTML
Benefits of Good HTML
HTML Tags
Bad HTML Tags
Good HTML Tags
IDs, Classes, and Names
Conventions for Naming
XHTML
Benefits of XHTML
XHTML Guidelines
Proper nesting of tags
End tags and empty tags
Case sensitivity
Attribute values
JavaScript, CSS, and special characters
RDFa
RDFa Triples
Applying RDFa
HTML 5
4. Large-Scale CSS
Modular CSS
Including CSS
Linking
Embedding
Inlining
Applying CSS
IDs
Classes
Descendants
Elements
Grouping
Specificity and Importance
Scoping with CSS
Scoping within a module
Scoping at the page level
Presentation switching
Standard Module Formats
Positioning Techniques
CSS Box Model
Document Flow
Relative Positioning
Absolute Positioning
Floating
Layouts and Containers
Example Layouts
Example Containers
Other Practices
Browser Reset CSS
Font Normalization
5. Large-Scale JavaScript
Modular JavaScript
Including JavaScript
Linking
Embedding
Inlining
Scoping with JavaScript
Namespaces with JavaScript
Accessing a module by ID
Working with the DOM
Common DOM Methods
Accessing elements by tag name
Creating an element
Inserting or removing an element
Changing the text in an element
Popular DOM Libraries
DOM methods in Dojo
DOM methods in jQuery
DOM methods in Prototype
DOM methods in YUI
Working with Events
Event Handling Normalization
A Bad Example: Global Data in Event Handlers
A Good Example: Object Data in Event Handlers
Event-Driven Applications
Working with Animation
Motion Animation
Sizing Animation
Color Transition
An Example: Chained Selection Lists
6. Data Management
Dynamic Modules
Data Managers
Creating Data Managers
Defining get_data
Defining set_data
Extending Data Managers
Extending via inheritance
Extending via aggregation
Data Using SQL As a Source
An SQL Example
Data Using XML As a Source
An XML Example
Data from Web Services
Data in the JSON Format
Cookies and Forms
Managing Data in Cookies
Managing Data from Forms
7. Large-Scale PHP
Modular Web Pages
Generating Pages in PHP
Working with Pages
Public Interface for the Page Class
Structure and assembly
CSS management
JavaScript management
Abstract Interface for the Page Class
CSS management
JavaScript management
Dynamic data management
Headers, footers, and content
General page information
Implementation of the Page Class
Extending the Page Class
Defining a sitewide page class
Defining sectional page classes
Defining page-specific classes
Working with Modules
Public Interface for the Module Class
Abstract Interface for the Module Class
CSS management
JavaScript management
Content for the module
Implementation of the Module Class
Extending the Module Class
An Example Module: Slideshow
Layouts and Containers
Special Considerations
Handling Module Variations
Multiple Instances of a Module
Dynamic JavaScript and CSS
Implementing Nested Modules
8. Large-Scale Ajax
In the Browser
Managing Connections
Using Ajax Libraries
Ajax with Dojo
Ajax with jQuery
Ajax with Prototype
Ajax with YUI
On the Server
Exchange Formats
Plain text
XML
JSON
Server Proxies
Modular Ajax
MVC and Ajax
Using Ajax with MVC
Public Interface for the Model Object
Implementation of the Model Object
Public Interface for the View Object
Abstract Interface for the View Object
View Object Implementation
Public Interface for the Connect Object
Abstract Interface for the Connect Object
Implementation of the Connect Object
Controllers
An Example of Ajax with MVC: Accordion Lists
9. Performance
Caching Opportunities
Caching CSS and JavaScript
Versioning CSS and JavaScript files
Combining CSS and JavaScript files
Caching Modules
Caching for Pages
Caching with Ajax
Using Expires Headers
Managing JavaScript
JavaScript Placement
JavaScript Minification
Removing Duplicates
Distribution of Assets
Content Delivery Networks
Minimizing DNS Lookups
Minimizing HTTP Requests
Guidelines for CSS files
Guidelines for JavaScript files
Guidelines for image files
Control Over Site Metrics
Modular Testing
Using Test Data
Creating Test Data
10. Application Architecture
Thinking Modularly
Organizing Components
Sitewide Architecture
Pages and modules
Layouts and containers
CSS and JavaScript
Data management
Images and other resources
Section Architecture
Pages specific to one section
Other types of section files
Architecture for Pages
Files for implementing pages
Page-specific modules
Modules on multiple pages
Pages of a similar type
Architecture and Maintenance
Reorganizing Module Uses
Adding Module Variations
Making Widespread Changes
Changes in Data Sources
Exposing Modules Externally
Index
About the Author
Colophon
Copyright
Search in book...
Toggle Font Controls
Playlists
Add To
Create new playlist
Name your new playlist
Playlist description (optional)
Cancel
Create playlist
Sign In
Email address
Password
Forgot Password?
Create account
Login
or
Continue with Facebook
Continue with Google
Sign Up
Full Name
Email address
Confirm Email Address
Password
Login
Create account
or
Continue with Facebook
Continue with Google
Prev
Previous Chapter
Cover
Next
Next Chapter
A Note Regarding Supplemental Files
Developing Large Web Applications
Kyle Loudon
Published by
Yahoo Press
Beijing • Cambridge • Farnham • Köln • Sebastopol • Tokyo
Add Highlight
No Comment
..................Content has been hidden....................
You can't read the all page of ebook, please click
here
login for view all page.
Day Mode
Cloud Mode
Night Mode
Reset