Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7047897
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T02:49:37+00:00 2026-05-28T02:49:37+00:00

My Question: What are some good examples of design patterns used in CakePHP? Why

  • 0

My Question:
What are some good examples of design patterns used in CakePHP?

Why Use CakePHP As My Context
I’ve been using CakePHP for about a year so I think it’s easier for me to think in that context. CakePHP is also rich in design pattern use (I’m confident of that)–I just don’t know what patterns are being used other than a few obvious ones.

Example Books I’ve been Reading On the Subject:
I’m reading the following books which all cover design patterns to one extent or another; unfortunately they mostly use Java and C++ code examples which makes it harder for me to get a grip on the design patterns on a practical level (I’m a PHP developer so its hard for me to absorb it):
“Patterns of Enterprise Application Architecture”, by Martin Fowler
“Head First Design Patterns”, by Gang of Four (Eric Freeman, Elisabeth Freeman, Kathy Sierra & Bert Bates) (2004)
“Design Patterns: Elements of Resuable Object Oriented Software)”, by Erich Gamma, Richard Helm, Ralph Johnson, John Vlissides)

Examples of Patterns I Can Observe in CakePHP
-I’m guessing the config file uses something akin to the factory pattern
-maybe $this->params is using something related to the observer pattern? I’m not sure on that…
-MVC (obvious! since Cake PHP uses the MVC file structure)
-ORM (another very obvious one)
-Maybe the HTML helper is using the decorator pattern?

Summary
I don’t expect anyone to go down the line and identify all the patterns used in CakePHP–I’m just looking for a few examples of design patterns that should be obvious that I’m missing.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-28T02:49:37+00:00Added an answer on May 28, 2026 at 2:49 am

    One that comes to mind is the concept of mixins. Not exactly a pattern but actually a language feature available in some languages (ie. modules in Ruby) but not in others (ie. Java). It will be coming to PHP when 5.4 goes stable and we get traits, but CakePHP’s model behaviours are a good example of mimicking this kind of multiple inheritance where it normally isn’t possible.

    class Post extends AppModel { // we can only inherit from one class
    
        public $actsAs = array('This', 'That', 'Other'); // but we can do this instead
    
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Question: What are some good libraries that've been written in VB.NET? The best would
This is a general software design question. Is it a good idea to use
I asked a similar question before, and got some good answers, but I think
first of all, my main question: What are some good troubleshooting techniques when you
Question What would be a good (ideally, technical) reason to ever program some non-trivial
i want ask some question about asp.net mvc Is static constructor will init every
I have a question about some functionality I'm trying to add to my jQuery
I'm looking for some good documentation/examples on how to temporarily pass control to an
Perhaps my question is similar in nature to this one: Do you use design
I recently answered this question: What are good reasons to use static methods in

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.