售 价:¥
温馨提示:数字商品不支持退换货,不提供源文件,不支持导出打印
为你推荐
Object-Oriented Programming in ColdFusion
Table of Contents
Object-Oriented Programming in ColdFusion
Credits
Foreword
About the Author
Acknowledgement
About the Reviewer
Preface
Who this book is for
What this book covers
What you need for this book
Conventions
Reader feedback
Customer support
Errata
Piracy
Questions
1. Introducing ColdFusion Components
Why use CFCs?
Grouping your functions
Organizing your components
The ColdFusion component tags
Our first component
Defining a method
Returning the data
ColdFusion 9 scripted components
Creating your object
Restricting your functions to scopes
Using arguments within your methods
The Arguments scope
Redefine the function parameters
Combining your methods
Protecting your local variables
Using the Var scope
Placing your Var scoped variables
Naming your Var scoped variables
Accessing your CFC
Instantiating the object
Using the createObject function
Using the cfobject tag
Using the NEW operator
Using cfinvoke
The cfinvoke tag
Using cfinvokeargument
Using attributes as arguments
Using an argument collection
Passing arguments into an instance method call
As a list
As named values
As an argumentCollection
Arguments in action
Merging your functions into one
Using cfargument to combine your methods
Creating an object constructor
Creating an init() function
The Variables scope
Calling your init() function
The This scope
Summary
2. Effective Component Development
Pseudo-constructors
Using the pseudo method
Suppressing whitespace
Output attribute
Pseudo-constructor or init() method
Returning values and variables
returnType
Access properties
Private
Package
Public
Remote
Getting information about your CFC
Introspection
CFC Explorer
Component Doc
Document your code
Benefits of documentation
Displayname attribute
Hint attribute
Description attribute
User-defined metadata
Obtaining CFC metadata
getMetaData
getComponentMetaData
Returning metadata
Detailed introspection
Summary
3. Building Your First Bean
What is a Bean?
But what is it really?
The benefit of using beans
Creating our first Bean
An introduction to UML
Person object in UML
What makes a Bean a Bean
A default/no-argument constructor
Easily accessible for introspection
Setters/Mutators
Getters/Accessors
Completing our Projects Bean
Calling our project Bean
Populating the Bean
Read/Write Bean
Read-only Bean
Helpful objects
Implicit accessors
Summary
4. Inheritance and Object-Oriented Concepts
What is Inheritance?
Avoiding code duplication
Inheriting our products
The Super keyword
Overriding methods
Instantiating our products
The inheritance hierarchy
Specialization
The "IS A" relationship
Polymorphism
Composition
The "HAS A" Relationship
Implied ownership
Aggregation
Summary
5. Data Access Objects
What is a Data Access Object?
Creating a Data Access Object
The create method
Storing a new user
The read method
Handling select results
The update method
The delete method
An alternative save method
The save method
The exists method
Caching the Data Access Objects
Dependency Injection
Summary
6. Gateways
What is a Gateway?
A typical ColdFusion Gateway
Creating a Gateway object
Naming conventions
Adding gateway methods
Minimising code duplication
Revising the gateway object
Caching the Gateway object
The Gateway discussion
No hard and fast rules
Table Data Gateway
Similarities to Data Access Objects
Combining the two patterns
Which option is best?
Summary
7. Creating a Service Layer
What is a Service Layer?
Facade patterns in a nutshell
Creating a service
Defining the User Service
Adding the CRUD methods
Adding the Gateway methods
Adding an abstract class
Defining the address service
onApplicationStart (revisited)
Summary
Index
买过这本书的人还买过
读了这本书的人还在读
同类图书排行榜