About two years ago, I created a sample project that demonstrates Presenter First in the context of GTK+ and C. I recently went ahead and updated the project to work with the latest and greatest versions of the tools it is built upon. Find it here!
My example builds upon several tools and technologies – primarily Presenter First, Ceedling, the GTK+ GUI toolkit, and C.
Presenter First is a design pattern that emphasizes self-descriptiveness, separation of concerns, and testability. Ceedling provides a suite of tools for building, running, and testing a C or C++ application. Throughout the example I use Unity for unit testing and CMock for mocking components in a C environment. And, of course, C and GTK+ provide the context of the application.
Over the last two years the technologies, tools, and environments have changed, so I’ve updated the example to ensure it now runs well under:
- Ubuntu 12.04
- Ubuntu packages for GTK+ and PCRE:
- libgtk2.0-dev
- libpcre3-dev
- bstring, which is embedded with the application
- The newest Ceedling from its source repository
- Ruby 1.8.7, 1.9.2, and 1.9.3
Check it out if you’re new to Presenter First! I hope it helps in understanding the concepts, especially in an environment that isn’t as friendly to testing as we’d prefer.
Resources:
- pf_gtk on GitHub
- Presenter First discussion at Atomic Object
- Throw The Switch, the embedded developer’s workbench.
- Throw The Switch’s tooling at Github, which includes Ceedling, Unity, CMock, and CException.