Commanding Chaos for Coworking, Open Source and Creative Communities

EntityFieldQuery: Let Drupal Do The Heavy Lifting (Pt 2)

Thu, 05/03/2012 - 07:35 -- rprice

wondering why I wouldn't just build this in Views. Indeed, this might look a bit masochistic if you're used to Views. However, there are a few things to consider:
EntityFieldQuery is core. If you are interested in keeping your installation as lean as possible, this is something to consider. Views is a contributed module, and so it automatically adds size and overhead to your Drupal install.
EntityFieldQuery is small. The amount of code required to generate an equivalent listing in Views, compared to what we built above, is much, much greater. To be fair, your Views code will almost certainly be exported and managed via Features, and so in effect you're not writing the Views code anyway. But, that highlights a different point: writing code this way keeps you in code, rather than requiring you to work in a point-and-click interface. For the average developer, this is a very good thing.
EntityFieldQuery is code. You might want to have certain things exposed to change and not others. For e