E-book details

Object-Oriented Programming in ColdFusion. Break free from procedural programming and learn how to optimize your applications and enhance your skills using objects and design patterns

Object-Oriented Programming in ColdFusion. Break free from procedural programming and learn how to optimize your applications and enhance your skills using objects and design patterns

Matt Gifford, Matthew Gifford

Ebook
Are you tired of procedural programming or is your extensive code base starting to become un-manageable? Breathe some new life into your code and improve your development skills with the basic concepts of object-oriented programming. Utilize objects, modular components, and design patterns to expand your skills and improve your ColdFusion applications. Packed with example code, and written in a friendly, easy-to-read style, this book is just what you need if you are serious about ColdFusion.This book is a fast-paced tutorial to important ColdFusion object-oriented programming topics. It will give you clear, concise, and practical guidance to take you from the basics of ColdFusion to the skills that will make you a ColdFusion developer to be reckoned with. Don't be put off by jargon or complex diagrams; read and see how you can benefit from this book and extend your development skills in the process.Using the practical examples within this guide, you will learn how to structure your applications and code, applying the fundamental basics of object-oriented programming to develop modular, reusable components that will scale easily with your application. You will learn the basic fundamental practices of object-oriented programming, from object creation and re-use, to Bean objects, service layers, Data Access objects, and sample design patterns to gain a better understanding of OOP using examples that can be altered and applied in your application. Complete with detailed code samples and snippets, and written in a friendly easy-to-follow style, you will be able to break free from writing purely procedural code and enhance your applications by building structured applications utilizing basic design patterns and object-oriented principles.
  • 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
  • Title: Object-Oriented Programming in ColdFusion. Break free from procedural programming and learn how to optimize your applications and enhance your skills using objects and design patterns
  • Author: Matt Gifford, Matthew Gifford
  • Original title: Object-Oriented Programming in ColdFusion. Break free from procedural programming and learn how to optimize your applications and enhance your skills using objects and design patterns
  • ISBN: 9781847196330, 9781847196330
  • Date of issue: 2010-10-13
  • Format: Ebook
  • Item ID: e_3ce2
  • Publisher: Packt Publishing