Feeds

Prefactoring

Getting it right first time

  • alert
  • submit to reddit

Beginner's guide to SSL certificates

PrefactoringBook review The title of this book should have been "Pre-refactoring", and for a suitable subtitle, "Getting It Right First Time" would have been a bit more informative than "Extreme Abstraction, Extreme Separation, Extreme Readability", which is a bit extreme on the extremes.

Refactoring, for those unfamiliar with the phrase, was coined by Martin Fowler in his influential book of the same name. It describes the process of improving the structure of the code without necessarily changing the functionality. Typically, this means rewriting code, reorganising classes, and redesigning software without breaking any applications that use the code. Think of it as an under the covers exercise that is invisible to consumers of an API or class library.

Prefactoring was successful in both articulating a common practice and also identifying and abstracting a range of refactorings that are generic and useful in many different situations. These days users of heavy-weight IDEs, such as Eclipse or Visual Studio .NET, have refactoring support a mouse click away.

Ken Pugh has taken on board the lessons learned from refactoring and worked them back to the beginning of the design process. Refactoring very often is about decoupling code so that dependencies between classes are minimised – this makes code more flexible, easier to maintain, and far less brittle. Hence the "Extreme Separation".

Another common problem is dependence on primitives (such as int, boolean etc), rather than on abstract data types which have semantics that reflect their contents. By using classes rather than primitives it is easier to add validation rules, enforce constraints, add additional methods and so on. This is the "Extreme Abstraction" from the subtitle. This also links in to "Extreme Readability". Using meaningful levels of abstraction is part of making code that is easy to read and understand. It's an acceptance that code needs to be developed and maintained, and should therefore be designed with that in mind.

Pugh makes his case both through argument and through the use of an extended example (coded in Java) that runs throughout the book. A web application for the rental of CDs provides ample scope for illustrating the value of the prefactoring approach. Developed using a fairly agile process, the sample project expands through a series of prototypes and requirement changes which show the pay-offs of using all those extremes.

Having a worked example gives the book a narrative that drives it along, and there are plenty of side-bars, rules, practices and other information to make it more than just a piece of source code fiction. Additionally, the final two chapters each provide another worked example, a print server and some anti-spam software respectively. For those that learn most from looking at code, these final chapters recapitulate the contents of the rest of the book.

Prefactoring

Verdict: This isn't a particularly long book, and it would have been shorter without the narrative, but it's an easy read. Its core lessons, which are to do with improving the design of software, are certainly worth learning.

Author: Ken Pugh

Publisher: O’Reilly

ISBN: 0596008740

Media: Book

List Price: £20.95

Reg price: £16.76

Beginner's guide to SSL certificates

More from The Register

next story
That dreaded syncing feeling: Will Microsoft EVER fix OneDrive?
Microsoft's long history of broken Windows sync
Mozilla, EFF, Cisco back free-as-in-FREE-BEER SSL cert authority
Let’s Encrypt to give HTTPS-everywhere a boost in 2015
SLURP! Flick your TONGUE around our LOLLIPOP – Google
Android 5 is coming – IF you're lucky enough to have the right gadget
Nokia's N1 fondleslab's HIDDEN BRILLIANCE: The 'Z Launcher'
Sugarcoating Android's Lollipop makes tab easier to swallow
Bug fixes! Get your APPLE BUG FIXES! iOS and OS X updates right here!
Yosemite fixes Wi-Fi hiccup, older iOS devices get performance boost
Facebook, working on Facebook at Work, works on Facebook. At Work
You don't want your cat or drunk pics at the office
Soz, web devs: Google snatches its Wallet off the table
Killing off web service in 3 months... but app-happy bonkers are fine
Meet Windows 10's new UI for OneDrive – also known as File Explorer
New preview build continues Redmond's retreat to the desktop
Microsoft: Your Linux Docker containers are now OURS to command
New tool lets admins wrangle Linux apps from Windows
prev story

Whitepapers

Choosing cloud Backup services
Demystify how you can address your data protection needs in your small- to medium-sized business and select the best online backup service to meet your needs.
Getting started with customer-focused identity management
Learn why identity is a fundamental requirement to digital growth, and how without it there is no way to identify and engage customers in a meaningful way.
Reg Reader Research: SaaS based Email and Office Productivity Tools
Read this Reg reader report which provides advice and guidance for SMBs towards the use of SaaS based email and Office productivity tools.
Simplify SSL certificate management across the enterprise
Simple steps to take control of SSL across the enterprise, and recommendations for a management platform for full visibility and single-point of control for these Certificates.
Saudi Petroleum chooses Tegile storage solution
A storage solution that addresses company growth and performance for business-critical applications of caseware archive and search along with other key operational systems.