[haiku-development] Rename BControlLook to BFacade

  • From: John Scipione <jscipione@xxxxxxxxx>
  • To: "haiku-development@xxxxxxxxxxxxx" <haiku-development@xxxxxxxxxxxxx>
  • Date: Wed, 25 Aug 2021 18:32:32 -0400

Dear Haiku core developers and anybody else who wishes to respond to this email,

I would like to rename BControlLook to BFacade.

It is not too late for us to change this class name, we could make it
a Beta 4 item to give everyone time to switch over. I'd also like to
add a lot more padding to BControlLook/BFacade.

Here is my reasoning for the name change:

The Decorator name comes from Design Patterns: Elements of Reusable
Object-Oriented Software [0]. This is a seminal book for any
mid-1990's C++ programmer so I'm sure the BeOS developers were
familiar with it.

page 196

"Attach additional responsibilities to an object dynamically.
Decorators provide a flexible alternative to subclassing for extending
functionality. Also Known As Wrapper"

While BDecorator may not strictly follow that definition literally in
terms of how it is implemented it does at least in spirit follow the
idea of a wrapper around a BWindow.

What is now Control Look should be called Facade from Design Patterns [0].

page 208

"Provide a unified interface to a set of interfaces in a subsystem.
Facade defines a higher-level interface that makes the subsystem
easier to use."

BControlLook perhaps not literally but spiritually it implements the
design pattern abstractually by being a higher level interface between
UI control and the way they are drawn.

BFacade is also shorter and easier to type and it is familiar to
English and French speakers at least while ControlLook isn't actually
a real word.


Thanks for listening,
John Scipione

[0] http://www.uml.org.cn/c++/pdf/DesignPatterns.pdf

Other related posts: