I was just browsing around, looking up patterns to see which ones my system qualifies as, when I happened upon the Poltergeist anti-pattern.
In my homemade CMS software my classes typically have a lone method for performing database lookups. I wanted to limit how many methods actually touch the DB, so that seemed like a good idea.
But as such, there are a lot of variables you can pass into this method. Pagination, sorting up to the fourth degree, and searching are just a few of the instructions that can be provided to these methods. The query is then dynamically built based on those instructions.
So rather than have a huge number of optional variables in the function declaration, and rather than have an uncontrolled associative array passed, I opted to create classes tailored to each of these methods.
There are a couple methods within these request classes to set a few things in bulk, but fundamentally these classes just serve to pass data into another class.
But I guess that's a bad thing?
I thought I was doing good by facilitating the request data in a uniform, contractual structure...