Posts tagged packt
Book Review: Learning Drupal 6 Module Development
Sep 4th
Last autumn’s release of Pro Drupal Development was a significant moment in the history of the popular CMS, providing for the first time a relatively comprehensive guide for those wanting to do more than simply manage and skin a drupal site. A number of books have followed it but few have delved as deeply or been such a definitive guide.
Like most of the more recent books, Learning Drupal 6 Module Development focusses on a quite specific area of drupal development, but its a key one for any serious developer and touches every other area of the system. Experienced PHP developers may find that this book (in conjunction with some time for experimentation) will serve as a solid introduction to how they might build applications on top of drupal.
The book focusses on a single project—a website providing biographies of philosophers—and builds the modules it needs, introducing the various available tools and techniques along the way. Much of the time is devoted to generating custom content types, but there’s very solid coverage of the hooks, filters, and actions that let modules really take integrate with the rest of the framework. Theming your output, using AJAX, and working with web services all get some time and illustrate how your app can be part of the wider web and keep up with its prevailing trends. A number of times I found myself reaching for code I’d written over the past few months to make amendments based on examples in the book.
I’ve been quite critical of books from packt lately and some of my criticisms apply here—he book itself feels flimsy and the print quality is poor—but this is also evidence that if an author and editor put the work in they do occasionally produce quality material despite the publisher. There are a number of asides that clarify language which demonstrate an attention to detail too often missing. It would have been good to see clearer signposts as to which features are new in Drupal 6 and which were available previously, but the online API docs can provide most of that.
When I reviewed Pro Drupal Development I noted some disappointment that the book didn’t devote any time to automated testing of drupal code, and that criticism applies here too. Along with staged deployments, automated testing remains one of the least considered aspects of drupal and that’s a serious concern for those looking to build robust well-managed applications on top of it. There are a few good articles online about how to test drupal code, but it would be good to see it taken more seriously as a core part of the module development process.
This book is likely to sit alongside Pro Drupal Development on my desk whenever I’m working on a drupal project and is a worthwhile investment for anyone who spends much time building drupal modules. There are clear areas for improved coverage, but it is as comprehensive an account as you’ll find of how to build modules that take full advantage of the facilities Drupal provides.
Disclaimer: I was sent a copy of this book for review by the publisher. You can find it at amazon US, amazon UK and all sorts of other places.
Book Review: Building Powerful and Robust Websites with Drupal 6
May 9th
An update to David Mercer’s now two year old Drupal: Creating Blogs, Forums, Portals and Community Websites, this version has been revised for the CMS’ latest version and guides the user through from setting up a development environment and installing drupal through to building custom themes and deploying a fully built site.
The book is designed to be read sequentially and assumes very little prior Drupal knowledge, though a little familiarity with the interface would be helpful, and a lot of willingness to explore and experiment are going to be necessary for complete newcomers. The first few chapters–focussed on explaining the benefits of using drupal and guide the user through the initial setup–are a little clunky and may deter those not comfortable with installing databases and scripting languages. The style improves as the book progresses and Mercer covers his topics well, with a considerably better structure than several Packt publications I’ve seen lately. (sadly the book retains Packt’s )
Some of those topics are fairly complex and it might have been good to have a few more directions for exploring the power of taxonomies and getting to grip with best practices in designing them. Given the range of documentation (on blogs and elsewhere) available online, more references to resources outside the book would have been a useful addition. But the fact that Mercer takes users beyond the very basics is to his credit, and it’s very good to see coverage of jquery, CCK, caching, and other topics that are key to recent versions of drupal but which could easily have been glossed over.
This is not a book for the seasoned developer coming from another platform or for those who have already have ample drupal experience (others have that covered) and it’s not really the “user manual” I’d like to find to hand on to drupal-using clients. But for those with an itch to build their own site and a sense that drupal might be the right tool, this volume is well worth a look.
Disclaimer: I was sent a copy of this book for review by the publisher. You can find it at packt, amazon US, amazon UK and all sorts of other places.
Book Review: Drupal 5 Themes
Feb 5th
Aimed at those with a knowledge of HTML and CSS but with no prior experience of programming, Drupal 5 Themes sets out to show you how you can quickly and easily get a drupal site up and running with a highly customised look and feel.
Drupal is highly themeable, with most aspects of the user interface being accessible purely in the theme layer without needing to dip into module development or the CMS’ core. The book takes the user through the various theme hooks and introduces the simple PHP code needed to override them, add new ‘regions’ (in which blocks can be displayed), customise existing themes and create your own (almost) from scratch. The primary focus is on the default theme engine, PHPTemplate, but others are referenced and a little time is spent on the options for building your own theme using raw PHP (without the extra layer of a theme engine).
For the most part the content is straightforward, and the reader should quickly get a feel for the naming conventions that drive the PHPTemplate approach. While not much programming knowledge is needed, it would be helpful for the reader to have a basic grasp of PHP and introductory programming constructs such as loops and conditionals. I was also surprised to find recommendations to name functions phptemplate_* within theme-specific template.php files, where they could instead be prefixed with the theme’s name rather than ‘phptemplate’. PHP’s not fond of functions that share names within the same context, and it is best to give those functions the most specific name available to you in order to avoid errors.
Given the fact that only HTML and CSS are listed as pre-requisites I was a little surprised that the PHP code wasn’t introduced in a more focussed section. Given its simplicity it’s to be hoped that anyone intending to spend much time building drupal sites would be able to figure it out, but while time is spent picking apart example code little time is spent actually giving a conceptual introduction or, for that matter, on explaining how to install drupal in the first place. Surprisingly, space was given to explaining how cascades work in CSS, which you would think is a fundamental part of a knowledge of CSS and unnecessary in this context.
This is the second book in a row that Packt has sent me for review where it has seemed that reference material is scattered too freely amongst the tutorial-style chapters. Significant chunks of space are given over to listing off functions, the locations of stylesheets, and so on, which is useful information but breaks up the flow of the book unhelpfully. It’s surprising that that content wasn’t moved to an appendix or, as with their jQuery books, a separate volume. Sitting in the middle of the book it feels like unnecessary filler (just one or two examples would do, along with a reference to an appendix, other volume, or online source) and the space could helpfully be given to more detailed tutorial material. That coupled with poor print quality and light paper stock (both also an issue with that previous book) gives the book a lightweight feel and reinforce its weaknesses.
This book should get an HTML/CSS developer who’s not afraid to dip their toes into some PHP up to speed with customising a drupal site, and its worth considering if you’ve been mostly building static sites or customising wordpress and need a content management system with a wider range of features. Unfortunately it’s still fairly weak structurally, and you may well find yourself needing to combine it with quite a bit of online documentation to properly cover the topics under discussion.
Disclaimer: I was sent a copy of this book for review by the publisher. You can find it at packt publishing, amazon US, amazon UK and all sorts of other places.
Book Review: Ruby on Rails Enterprise Application Development
Dec 29th
It’s very clear from posts on the rails email list that there’s space for books that take the novice developer beyond what they learn in beginners’ books like Agile Web Development With Ruby on Rails. Those books will help you build your first app and get a sense of the structure of Rails but before long you’ll want to write code that needs to be reusable between models, or across projects, or to interface with services other than databases. The beginners’ books, by definition, don’t deal with intermediate topics. That’s the niche Ruby on Rails Enterprise Application Development sets out to fill, but sadly it doesn’t offer much beyond those beginners’ guides.
Based on the title, I had expected going in that the book would be mostly focussed on cross-systems integration such as the use of LDAP, web services (particularly SOAP), connecting to multiple and/or legacy databases and other topics often lumped together as “enterprisey” which push at the rails conventions or require them to be abandoned. In fact the book would be better titled along the lines of “Up and running on Ruby on Rails in a small business” as the application developed through the course of its chapters is very simple and doesn’t demonstrate much about Rails itself that couldn’t be gleaned from AWDwRoR or one of its competitors.
Where some may find this book most useful is in the attention paid to windows-based development and to deployment (where it focusses on unix-based systems). Most of the books currently on the market do touch on using windows, but the authors of this one clearly use it themselves and actually advocate the use of an IDE for windows development. If your tastes run to Eclipse on Windows, that may draw you to this.
Though the book references Rails 1.2.3, the application built inside could just as easily have been built on Rails 1.1. The app is CRUD-based, but there is no mention of REST or map.resources, despite the fact that they could have simplified it. Authors don’t have to buy into the prevailing wisdom in the rails community, but it’s a shame when strategies that can simplify apps aren’t covered.
Perhaps more worrying given that Rails 2.0 is now out the door and will be the default for anyone starting out with this book now is the use of deprecated techniques such as dynamic scaffolds (the scaffold keyword was removed 10 months ago in changeset 6306) and old-style pagination (which left in changeset 6992 back in June)
There certainly aren’t as many books out there for newcomers to Rails as there are for some other languages/frameworks, so its inevitable that more are to come. It’s a shame that already at least two such books have been pitched at intermediate developers rather than their more correct audience, and hopefully that trend won’t continue. It would also be very helpful if packt would publish an addendum to this volume detailing the aspects that no longer work in Rails 2.0. Missing some great new feature in Edge Rails is one thing, but it’s quite another to rely on features that were scheduled for removal over six months before a book goes to press.
Disclaimer: I was sent a copy of this book for review by the publisher. You can find it at packt, amazon US, amazon UK and all sorts of other places.
Book Review: Object-Oriented Programming with PHP5
Dec 27th
With PHP 5.3 looking very close to release, bringing with it significant changes such as namespaces, this is an awkward time to release a PHP book of any generality. Within a few months it will be clearer how well the new features are taking hold and there is almost certainly going to be a clamour for books that show how new features affect development practices and how to make use of them. Even without that, it is hard to recommend this book as it fails to live up to its promise and provides a poor introduction to Object-Oriented programming.
The book’s first problem is the poor quality of the English contained. The author does not appear to be a native English speaker and the publisher has apparently done little to clean up the language. For the most part that simply makes for some curious rhythm and phrasing but there are a number of places where it contributes to inaccuracies, such as constant confusion between objects and classes. Finding such inaccuracies alongside mistakes such as confusing polymorphism and inheritance I’m left wondering how well the authors really know their subject. Packt would do well to employ another reviewer to clean up the syntax and definitions before any reprints.
The structure of the book is curious. Rather than approaching topics through the use of an example project or projects, the author gives disconnected samples, often offering little beyond that which can be found in the online PHP documentation and generally failing to explain how techniques would be useful. While he insists that PHP5’s Reflection API is an important tool, there is little to back up that assertion. There’s a large code sample and a list of the methods and attributes of a reflection object, but no real substance. The database section covers some key examples, such as PDO, ADODB and MDB2, and touches on the ActiveRecord pattern, but uses four pages to list the RDBMSs that ADODB supports and then only spends a page and a half on ActiveRecord, failing to explain either its concepts or advantages in any detail.
The high point of the book is the half chapter on unit testing. A few well chosen examples provide a demonstration of how code can be tested and how that allows for refactoring without fear of regressions. The reasons for unit testing are clear as is basic usage of PHPUnit. I’d have liked to see further examples rather than several pages listing all the default assertions PHPUnit provides, and I disagree with the claim that there should never be more than one assertion per test (individual tests should focus on a single concern, but can use multiple assertions to do so) but by that point in the book it was good just to see a section that made its point clearly.
Fundamentally, I came away from this book feeling it had failed to communicate clearly the core principles or reasons for object oriented programming. By trying to cram in too much reference material, not offering clear contexts for each technique, and not lingering on ideas like encapsulation the book fails to instill OO techniques.
Disclaimer: I was sent a copy of this book for review by the publisher. You can find it at packt, amazon US, amazon UK and all sorts of other places.