Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister
 
PerlMonks  

Re: Eliminating conditional code for GUI and text-mode operation

by graff (Chancellor)
on Dec 08, 2007 at 02:25 UTC ( #655793=note: print w/ replies, xml ) Need Help??


in reply to Eliminating conditional code for GUI and text-mode operation

Another aspect of OO design you might find helpful would be to separate purely UI (or purely GUI) logic from "back-end" processing logic. For example, if you have a module (or a few) to implement a set of methods for audio file manipulation, those methods could be invoked by either a command-line style app or a windowing app -- these two UI approaches could (perhaps should?) be separate scripts, but they both invoke the same set of processing methods for audio data, which simply means that they both use the same processing module(s).

As ikegami indicated above, one and/or the other UI approach could make use of functions that are available only for that particular UI, but since these are UI differences, they would have no impact on the back-end data processing module(s).


Comment on Re: Eliminating conditional code for GUI and text-mode operation
Re^2: Eliminating conditional code for GUI and text-mode operation
by gnosti (Friar) on Dec 08, 2007 at 09:13 UTC
    Thanks for the hints, graff

    My display and back-end functions are mostly separate as procedural code. I can see that once I get over the cusp of using the OO features (getting them to work in the module build/testing framework) my code base is going to become much more solid.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://655793]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others lurking in the Monastery: (10)
As of 2014-07-30 19:26 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My favorite superfluous repetitious redundant duplicative phrase is:









    Results (240 votes), past polls