Mocking objects

This week I have been working on writing a new module for an year old Flash-based system. At the time of creating the system I had written modules which now need to be replaced. In this context modules are secondary Flash movies who can get loaded on-demand. Because the modules had to be multilingual I had written a communication bus between the child and main movies using delegation. Every module has a property “delegate” of the type IModuleDelegate. The module then can do things like: delegate.getConfig() or delegate.getTranslation(). Quite common but useful.

Only during the development of such modules you don’t want to run the main movie and get go through the different dependencies which need to be met before it all running. For this reason, last I created class which implemented this IModuleDelegate like:

Of course, it’s not really handy that you need to implement every method of the interface. Especially, if you don’t need to use most of the methods. In this weeks module I only was interested in retrieving the appropriate resource string in the right language.

One year of progressing knowledge about development and test driven development learned me about mocking objects. Allowing you to simulate a complex object such as the IModuleDelegate interface without the need to manually implement all the methods to meet this interface contract.

In Flash you have the lovely Mockolate library which allows to mock objects. This meant I was able to limit the complexity of module code base. Now by using Mockolate the mock module delegate is down from 75 lines of code to the following:

Lovely ain’t it? Easier to maintain and makes the code base easier to read.

Posted in Flash, Technology | Leave a comment

Book Review: Open Source Flash Development

The Flash community is one of those community where you get flooded with open source projects. In the book “The Essential Guide to Open Source Flash Development” the most popular projects are getting discussed. The book discusses projects such as AMFPHP, Papervision3D and Red5. The initial chapters 1-4 of the book explain how to get up-and-running with an open source development environment. This means that projects as MTASC, swfmill and the Adobe compilers are getting discussed in these chapters. Especially, how to prepare IDE such as FDT and FlashDevelop to leverage these solutions. After this you are ready to start working on your ActionScript2 or 3 project.

As you might know every Flash project is nothing without the right testing and debugging tools. In Chapter 5 several open source solutions for unit testing (AsUnit and FlexUnit), debugging (more logging, XRay) are discussed. Of course, other activities as debugging using breakpoints, watches are not spoken about, but these are already discussed in Adobe’s own documentation.
The more interesting chapters start after Chapter 6, which discusses deploying Flash projects using SWFObject.

In the chapters 7-8 opens source alternatives for remote communication are discussed using AMFPHP and SWX where is shown how you can make a products catalogue. Chapter 8 which about SWX also discusses how to make a Flash Lite version. At the end of the book a different solution called RED5 is discussed. Spread over two chapters a short introduction is given how to use Red5 and how you can use it to connect MIDI instruments together with your Flash project. This means you can create your own version of Guitar Hero!

In chapter 9 an alternative language called haXe is explained. haXe is computer language where the compiler can output to ActionScript byte-code. In the chapter is shown how it can be used to create Flash projects. Not only that but also the benefits (such as better optimised bytecode meaning your Flash project gets faster) of using the haXe compiler instead of the Adobe compilers. After reading this chapter you have the haXe IDE going and a good understanding of the differences between haXe and ActionScript.

Chapter 10 discusses two animation toolkits for tweening, Fuse and GoASAP. If you are looking for more information about how to do tweening, then you can better read one of Keith Peters’ book about movement and animation.

The Open Source Flash Development book is a nice introduction in several open source projects within the Flash Community while I think some chapters could discuss its chapter more thorough. The final result of the book is great and helps you getting started with these projects. Especially, the chapter about PaperVision 3D could be more in depth about the camera and its connection with the objects in the scene. Beside of that the book is packed with useful information to get your started.

Book Details
Published: 14th July 2008
ISBN-10: 1-4302-0993-3
ISBN-13: 978-1-4302-0993-5
RRP: $46.99 (USD)
350 Pages

Posted in Technology, Uncategorized | Leave a comment

Book Review: Real World ASP.NET: Building a Content Management System

In Real-World ASP.NET: Building a Content Management System, Stephen R.G. Fraser presents an overview of the elements of a Content Management System, and builds a Content Management System in ASP.NET using C#. In short the book covers basic information about Content Management Systems, Workflows, Version Control and Personalization, but also introduces the reader with ASP.NET, Database Development, and XML.

The book is divided in fifteen chapters which consist of the following major subjects:

Definition of a Content Management System — explains the elements of a Content Management System;
Basics of Web Architecture — explains the basics of Web Architecture, the presentation, application and database layers;
ASP.NET, C#, and Visual Basic .NET — introduction to the .NET framework and it’s Web scripting languages;
ADO.NET — explains the database basics and objects;
Authentication — authorization, and encryption of content and the system;
Personalization — defines Personalization and how to use it;
The book also has a website, at www.contentmgr.com, were you can see the Content Management System you will build live-in-action. Also you can download the companion source code of the Content Management System that will be built through out the book at the publisher’s web-site: www.apress.com, go to Downloads and choose “Real-World ASP.NET: Building a Content Management System” to download it.

Analysis
The first five chapters of the book start with explaining the elements of a Content Management System, so it’s told that a Content Management System consists of a minimum of three elements: the content manager application (CMA), the metacontent management application (MCMA), and the content delivery application (CDA). After the writer explains the basis of a Content Management System and its terminology, the writer continues with explaining the aspects of version control and workflows.

The next chapter is about the basics of Web Architecture, it will explain the reader about the classic n-tier client/server architectures which consist of the following layers: Presentation Layer, Application Layer, and Database Layer. As mentioned in the book the only difference with the classic n-tier client/server and the Web architecture is the presentation layer which will be via a web browser instead of an operation system specific executable.

The next three chapters make space for an introduction to the .NET Framework , ASP.NET and the language C# but also Visual Studio .NET. In a tutorial kind of way you will build a Dynamic Content Viewer. Once you are done with this viewer you will step in the world of database development, in the chapter “Database Development and ADO.NET”. In this chapter you will learn how to use the database functionality available in Visual Studio .NET and ADO.NET. You will also build some examples were you read data from a database and showing it in a Data Grid, and last you will be altering the Content Viewer you made in the previous chapter to work with ADO.NET.

After all this information has been thrown at you it’s time to really start building the Content Management System (“CMS”). The first thirty pages of the second half of the book are spent explaining how to install the included source code. The next chapters in the book will guide you how to make the several parts of the CMS. From implementing Authentication or a control panel where you can add or remove your stories. Of course there is information how to display dynamic content and how to implement support for Workflows in your CMS.

Verdict
When you have finished reading Real-World ASP.NET: Building a Content Management System, you have all the information you need to build your own CMS successfully. If you build a CMS for the first time this is the book you want. Very well explained it implements the theory you learned in the first chapters into a nice ASP.NET based CMS that you can use a kick-start for your own CMS. The book is really meant for the Web developer. After the first five chapters the content of the book will get too technical for your editor or designer. In short it’s a great book, together with a book like Content Management Bible which you in my opinion you already should have on your desk, you have perfect combination to start building your own CMS.

Posted in Reviews | Leave a comment

Book Review “Maya 5 Killer Tips!”

In most books you can find little boxes with Tips and Truces, in my opinion it is the most interesting subtexts available in books.

This “Killer Tips!” (An idea of Scott Kelly) series consists of a little book with around 180-200pages with wide collection of useful tips. “Maya 5 Killer Tips!” includes tips and trucks for Alias|Wavefront Maya 5. The book is written by Eric Hanson visual effects artist worked on movies like Spider-Man, Hollow Man and Fantasia 2000.

The book consists of several chapters who are:

  1. Deciphering the Hieroglyphics;
  2. Taming the Beast;
  3. The Glamorous World Of Modelling;
  4. Embracing the Revolution;
  5. Rags to Rendering
  6. From Home Movies to Hollywood;
  7. Building Character (Animation That is)
  8. Dangerous Effects Animation;
  9. Getting Under the Hood;
  10. Real World Production Methods

Maya 5 Killer Tips! Is a great book of resources to enhance and pepper up your knowledge about Alias|Wavefront Maya in general, a book from the beginner and the experts.The book includes tips and trucks you might never have found, if you had to find it yourself. It’s a great resource for saving time when working with Maya 5. Especially the tips about (speeding) rendering and modelling were of big value for me.

This book should be on every desk who is serious Maya 5 user. The Killer Tips! Editions for other 3d applications are also in the works for example Lightwave Killer Tips!

Posted in Reviews | Leave a comment