in reply to Eliminating conditional code for GUI and text-mode operation
This is a concern as I am considering an incremental move over to a OO style and higher levels of abstraction. How might OO design or some other abstraction help me support this dual-interface ability?
Easily
{ package UI; ... sub refresh_track_display {} ... } { package UI::Graphical; our @ISA = 'UI'; ... sub refresh_track_display { ... } ... } { package UI::Text; our @ISA = 'UI'; ... # Inherit no-op refresh_track_display. ... } ... $ui->refresh_track_display(); ...
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Eliminating conditional code for GUI and text-mode operation
by gnosti (Chaplain) on Dec 07, 2007 at 09:50 UTC | |
|
Re^2: Eliminating conditional code for GUI and text-mode operation
by gnosti (Chaplain) on Dec 08, 2007 at 09:09 UTC | |
by ikegami (Patriarch) on Dec 08, 2007 at 14:06 UTC |