Computer ScienceTextbook

The Spec UI framework

Not rated yetRate this book

The Spec UI framework explains how to build reusable graphical interfaces in Pharo. Johan Fabry and Stéphane Ducasse introduce composition, presenters, layouts and widget interaction through examples and reference chapters. This edition focuses on Pharo 5 and 6.

FormatPDF
LanguageEnglish
SubjectComputer Science
LevelUndergraduate
No. of pages84
Published2017
Read free online →

The Spec UI frameworkFree

About this book

This developer-oriented textbook treats a user interface as a composition of smaller interfaces. Buttons and labels are themselves reusable components, and larger combinations can become components for another application. The introduction connects this approach with the Model–View–Presenter pattern and distinguishes Spec from Morphic and the GT Tools. The book recommends reading its introductory examples before using the later chapters as a reference. Its version context matters: the authors explicitly focus on Pharo 5 and 6, so the examples should be read in that environment rather than assumed to describe every later release.

The attached edition contains 84 PDF pages, including front matter. Cover: source edition title page rendered from the PDF. The textbook and its original notices are retained; Academic Master’s study material is separate from the source text.

Book summary

Johan Fabry and Stéphane Ducasse’s The Spec UI Framework explains interface construction through reusable models, composition, layouts, and window behavior. The first edition dates to January 2017 and addresses the Pharo 5 and 6 setting. Its nine chapters are a guide to the framework described in that source, rather than interchangeable instructions for every later Spec release. The durable design question is how to separate interface responsibilities and compose them coherently.

Chapter-by-chapter summaries

Chapter 1: Introduction

The introduction locates Spec among the interface tools available in Pharo and explains its focus on reuse. An interface is described through models rather than only the concrete widgets eventually shown. This distinction supports composition and separates parts of interface logic from the underlying rendering framework. The chapter gives the reader a reason to examine responsibilities and boundaries before treating the framework as merely another way to place buttons in a window.

Chapter 2: First Contact with Examples

The early examples introduce the construction process through small working interfaces. Their value lies in tracing how an element is declared, configured, connected, and opened. A working example should be read as an explanation of relationships, not only a snippet to paste. Changing a small property or action and predicting the result helps reveal which part of the model controls behavior and which part specifies arrangement.

Chapter 3: Reusing and Composing Elements

Spec treats existing interfaces as elements that can be reused within a larger one. The chapter connects this capability with design: the interface must be partitioned into meaningful responsibilities if reuse is to be useful. Composition is more than putting widgets side by side. The parts need a defined way to coordinate, and unnecessary knowledge of a parent or sibling can weaken the independence that makes a component reusable.

Chapter 4: Fundamentals

The fundamentals revisit the building process and its customization points. Interface models and layout descriptions contribute different parts of the resulting UI, while Spec creates the concrete elements through the underlying framework. Understanding that process helps explain where a customization belongs. A change that appears visual may require a model decision, and a behavior should not be assumed to arise automatically from a layout that merely places the relevant elements together.

Chapter 5: Layout Construction

A useful layout specifies relationships and resizing behavior rather than relying only on absolute coordinates. The chapter compares ways to express placement and available space. This makes adaptability part of interface design: a configuration that looks correct at one size may become unusable when the container changes. Readers should explain which dimensions remain fixed, which grow, and how the chosen arrangement preserves the intended relationships among elements.

Chapter 6: Managing Windows

Opening a window is only one part of its behavior. The chapter examines closing, dialogs, sizing, and other aspects of managing the container in which an interface appears. These choices affect the relationship between the interface and its user. A reusable component's responsibilities should also be distinguished from the window's responsibilities, so that a component does not become unnecessarily tied to one way of presenting or controlling it.

Chapter 7: Advanced Widgets

Text input, radio buttons, tabs, toolbars, and popup menus require more configuration than a simple label. The chapter explains how their models support the relevant interaction. A meaningful setup connects the displayed state, the user's action, and the resulting application behavior. Readers should distinguish configuring a widget's appearance from specifying the information or action it represents, especially when several controls must remain consistent with one another.

Chapter 8: Dynamic Spec

Dynamic interfaces change their widgets or layout according to information available at runtime. The source's examples motivate cases such as a preview that depends on the selected file. The chapter extends composition beyond a fixed set of elements known in advance. Correct behavior requires considering how the model and layout are rebuilt or changed and whether the current visible state still corresponds to the underlying application information.

Chapter 9: Tips and Tricks

The final chapter collects focused examples, including cooperation among Pharo's UI frameworks and other useful customizations. These examples are most informative when connected with the earlier construction model. A short technique should be evaluated through the problem it solves and the dependency it introduces, rather than adopted only because it produces an immediate visible result. The chapter also encourages experimentation with small, understandable changes.

Study instructions

  1. Run the examples in an edition-appropriate Pharo image and keep its version with your notes.
  2. Trace one control from model creation through configuration, layout, action, and window opening.
  3. Extract a reusable sub-interface and explain how it communicates without knowing unnecessary details about its parent.
  4. Resize a layout and test its assumptions about fixed and flexible space.
  5. Build a small dynamic interface and check that a change in content produces a consistent model and visible result.

Questions for reflection

  • Which responsibility belongs to the UI model and which belongs to its layout or window?
  • What makes an interface component reusable beyond the first screen that uses it?
  • How would you distinguish an error in composition from a problem in the underlying widget framework?

Sources and coverage

This original study guide follows the complete linked source edition and all of its substantive chapters or named teaching sections. It condenses their main ideas and relationships; the study tasks are guidance for reading alongside the complete resource. It does not reproduce the source exercises or answer key. Book source; Complete source PDF.

About access & copyright

Check this edition’s source and licence before reusing its files or content. A library listing does not grant additional rights.

Read our Library Access & Copyright policy

Composition

Understand the introduction’s account of interfaces built from reusable interfaces.

Presenters

Distinguish interface logic from concrete widget creation.

Framework choice

Compare the stated scope of Spec, Morphic and GT Tools.

Version context

Interpret examples within Pharo 5 and 6.

Reader ratings & reviews

Be the first to rate

No ratings yet

0%0%
0%0%
0%0%
0%0%
0%0%

Share your thoughts

Your review helps other students choose the right resources.

Rate this book

How helpful was this book?No sign-up needed. Your rating appears instantly.