6
Introduction to Gateways and Database Access
No comments · Posted by admin in Design Patterns
A Gateway is a design pattern that describes an object whose purpose is to encapsulates access to an external system or resource. With CFML this pattern is ideally suited to describe an object that provides all access to our relational databases.
Specifically, gateways are the objects designated as the holders of all SQL in a system. They represent the gatekeepers to your relational data. This is a good starting point but there are a number of further questions that are useful to discuss:
- What exactly is a Gateway and what are it’s responsibilities?
- How should Gateways be created?
- How to choose which Gateway your SQL code should be placed in?
- How to handle special data such as dates, times and dynamic form field data?
- How to minimise duplicate SQL code and support sort ordering?
- How to handle access to multiple datasources?
- How to handle dynamically generated SQL?
Continued here: Introduction to Gateways and Database Access
Feedback is always welcome, so if you see any problems or if something is not clear feel free to leave a comment on how these entries could be corrected or improved. Thanks!
Database · Design Patterns · Gateway
