- Accidental Creative
- Adapting to Web Standards: CSS and Ajax for Big Sites
- Art of Non-Conformity
- Art of Readable Code
- Back to the User: Creating User-Focused Web Sites
- Beginning PHP6, Apache, MySQL Web Development
- Books to Read
- Born For This
- Complete E-Commerce Book
- Content Inc
- Core PHP Programming
- CSS3: Pushing the Limits
- Dealing with Difficult People
- Defensive Design for the Web
- Deliver First Class Web sites
- Design for Hackers: Reverse-Engineering Beauty
- Designing Web Interfaces
- Designing Web sites that Work: Usability for the Web
- Designing with Progressive Enhancement
- Developing Large Web Applications
- Eat That Frog
- Economics of Software Quality
- Elements of User Experience
- Epic Content Marketing
- Extending Bootstrap
- Flexible Web Design
- Flexible Web Layouts
- Inmates Are Running the Asylum
- jQuery Pocket Reference
- Letting Go of the Words
- Making Every Meeting Matter
- Manage Your Day to Day
- Monster Loyalty
- Official Ubuntu Book
- Organized Home
- PHP In a NutShell
- PHP Refactoring
- PHP5 CMS Framework Development
- PHP6 and MySQL Bible
- Privacy Policy
- Responsive Web Design
- Responsive Web Design with HTML and CSS3
- Rules of Thumb
- Saleable Software
- Securing PHP Web Applications
- Simple and Usable Web, Mobile and Interaction Design
- Smart Organizing
- Submit Now: Designing Persuasive Web sites
- The Life-changing Magic of Tidying up
- UI and UX and Design
- Web site Usability
- Web Site Usability: A Designer's Guide
- Web Word Wizardy
- Work for Money, Design for Love
- Blogs
- Checklists I Have Collected or Created
- Color in Web Design
- Crafts To Do
- Database and Data Relations Checklist
- Ecommerce Website Checklist
- My Front End UI Checklist
- New Client Needs Analysis
- Newsletters I Read
- Puzzles
- Style Guides
- User Review Questions
- Web Designer's SEO Checklist
- Web site Review
- Website Code Checklist
- Website Final Approval Form
- Writing Content For Your Website
- Writing Styleguide
- Writing Tips
- Complete Book of Potatoes
- Creating Custom Soil Mixes for Healthy, Happy Plants
- Edible Forest Garden
- Garden Design
- Gardening Tips and Tricks
- Gardens and History
- Herbs
- Houseplants
- Light Candle Levels
- My Garden
- My Garden To Plant
- Organic Fertilizers
- Organic Gardening in Alberta
- Plant Nurseries
- Plant Suggestions
- Planting Tips and Ideas
- Root Cellaring
- Way We Garden Now
- Beautiful No-Mow Lawns
- Beginner's Guide to Heirloom Vegetables
- Best of Lois Hole
- Eradicate Invasive Plants
- Gardening Books to Read
- Gardens West
- Grow Organic
- Guerilla Gardening
- Indoor Gardening: The Organic Way
- Real Gardens Grow Natives
- Seed Underground
- Thrifty Gardening from the Ground Up
- Veggie Garden Remix
- Weeds
- What Grows Here
- Activities for Kids
- Baking & Cooking Tips
- Bertrand Russell
- Can I Get that on Sale?
- Cleaning Tips and Tricks
- Colour Palettes I Like
- Compound Time
- Crafts
- Crafts for Kids
- Household Tips
- Inspiration
- Interesting
- Interior Design
- Latin Phrases
- Laundry Tips
- Learn Something New
- Links, Information, and Cool Videos - Stuff for My Kids
- My Miscellany
- Organizing
- Quotes
- Reading List
- Renovations
- Silly Sites
- Things that Make Me Laugh
- Videos to Watch
- YouTube Hacks
- Accessibility
- CSS Frameworks
- CSS Reading List
- CSS Sticky Footer
- htaccess files
- HTML Tips and Tricks
- Javascript (and jQuery)
- Landing Page Tips
- Making Better Websites
- More Information on CSS
- MySQL and Databases
- Navigation
- Responsive Design
- Robots.txt File
- Security and Secure Websites
- Web Design and Development
- Web Design Tools
- Web Error Codes
- Website Testing Checklist
- Writing for the Web
- Writing Ideas for your website
- Animations and Interactions
- Being a Better Designer
- Bootstrap Resources
- Colour
- CSS Preprocessors: Sass and Less
- CSS Tips Tricks
- Designing User Interfaces
- Font & Typographical Inspiration
- Fonts, Typography, Letters & Symbols
- Icons
- Logo Designs
- Photoshop Tips and Tricks
- Sketch
- UX and UI and Design Reading List
- Web Forms
Relevant Patterns for Construction of a CMS
-
The singleton appears repeatedly, especially for the handler objects described later. In theory, handlers could be implemented as class methods, but in PHP5 a class is not itself a first class object and it is more effective to use singleton objects. Other objects are naturally singletons, such as the session object, since PHP5 handles only a single request at a time.
-
Factories are used to create objects when the circumstances will alter what class is required. For example, a factory is used to create the session object which will be of a different class depending on whether the session belongs to an administrator or an ordinary user.
-
Observer (sometimes called subject-observer or publish-subscribe) pattern is implemented more as an architecture to handle plug ins than as PHP5 classes. This is because the actual process of adding a plug in is an installation that affects the database more than the object structure.
-
The Command pattern is also used to handle plug ins, since the external interface for plug ins must be completely generalized. A Factory is used to create the correct plug in object to handle a particular request.
-
The Bridge and Memento patterns can also be used in the construction of plug ins.
Model, View, Controller
It has long been agreed that it is good to make a separation between the model and views of the model. The model is understood as the set of objects that emulates the problem being solved by a computer application...Views may well change in different ways and at different times from the model...The controller manages the situation by handling input from the user and organizing the required objects, then supplying them to the appropriate view...The role of the controller then includes marshalling data and somehow transferring it into the template system.
Bibliographical Information
PHP5 CMS Framework Development:
Expert insight and practical guidance to creating an efficient, flexible, and robust framework for a PHP5-based content management system
- By: Martin Brampton
- Publisher: Packt Publishing
- Pub. Date: June 06, 2008
- ISBN 978-1-84719-357-5
PHP will not fail if variables are uninitialized, it will assume that they are null and issue a notice to tell you about it.
Declarations are powerful, and it pays to maximize their power. Classes can be declared as abstract when they are not intended to be used on their own to create objects, but used only to build subclasses. Methods can be declared as public, private, or protected and the most suitable options should always be chosen. Variables inside an object should be declared wherever possible, and like methods, their visibility should be stated. In line with the previous comments, it is a good idea to initialize every declared variable in a class with a reasonably safe value.
Efficiency is achieved by good design and avoiding writing unnecessary code. The fastest code is the code that has been factored out of the design and no longer exists!
Bearing this in mind, what I advocate is an approach to object orientation where the classes and objects come naturally from the problem being solved. Arbitrary rules for class building are best avoided in favor of letting the problem show through the code. And although patterns can be immensely valuable, they should also be treated with some caution.
These are notes I made after reading this book. See more book notes
Just to let you know, this page was last updated Sunday, Dec 15 19