[CrackMonkey] I think I'm beginning to work some of this out

Scott Allan scotta at iemedia.ca
Thu Jan 13 17:38:27 PST 2000


any app with "if gar:" in the code can't be too bad.

sA
Scott Allan

On Thu, 13 Jan 2000, Nick Moffitt wrote:

> 	Okay, so I was forced to sit through a meeting at work that
> lasted from 8am to 2 or 3pm.
> 
> 	I had lots of time to scribble notes in my notebook and read
> Internet Programming With Python (a fine book, if I do say so myself).
> 
> 	Here's what I came up with:
> 
> 	I think I finally figured out Deirdre's View/Control/Data
> architecture.  The View has an instance of a Control which in turn has
> an instance of the Data object.	
> 
> 	So then, at load time, you can use logic to decide which type
> of View descendant gets used.  Sort of like...
> 
> if __name__ == "__main__":
> 	if foo:
> 		cit_view = CGIView()
> 	elif bar:
> 		cit_view = NCursesView()
> ...	
> 	if gar:
> 		cit_view.control = CitControl()
> 
> 	And you can keep going for the control and data objects.  This
> allows the user to specify a UI or a database storage method from a
> start-up option dialog or command-line swicth or config file or
> what-have-you.
> 
> 	So you have basically five interfaces: user to view, view to
> control, control to data, and data to hardware.  The reason for this
> is to have the user to view and data to hardware interfaces become
> interchangeable, provided the other two interfaces remain constant.
> 
> 	I thought about the view to control interface, and decided
> that the control methods shuld mimic Citadel+ commands as closely as
> possible.  It's rather easy, really.  Citadel+ uses a single verb
> followed by multiple objects and modifiers.  Hot-keys used sensible
> defaults.
> 
> 	I then thought about the control to data interface, and
> decided that the commands should be mostly bulk fetch and store
> methods.  I have some ideas about how to make some of this nicely
> asynchronous and non-blocking , but again this is mostly a matter of
> implementation.
> 
> 	So here's my rundown:
> 
> Interfaces:
> 
> View -> User:
> 	depends
> Control -> View:
> 	Functions for cit commands using parameters for the command
> 	options, i.e.:
> 		control.Goto(roomname = "Lob") #gets completed!
> 		control.Read(type="message", reverse = 1, old = 1)
> Data -> Control:
> 	large burst and incremental functions to fetch and store en
> 	masse from the database, i.e:
> 		data.KnownRooms(hall="Root")
> 		data.GetMessages(room="Lobby", first=53, last=12)
> 			#presumably the order of first-last would
> 			#define the order in which messages are printed
> 		data.NextKnownRoom(hall="Root") # maybe not
> Hardware -> Data:
> 	depends
> 
> 
> -- 
> CrackMonkey.Org - Non-sequitur arguments and ad-hominem personal attacks
> LinuxCabal.Org  - Co-location facilities and meeting space 
> 
> 
> _______________________________________________
> CrackMonkey: Non-sequitur arguments and ad-hominem personal attacks
> http://crackmonkey.org/mailman/listinfo/crackmonkey
> 







More information about the Crackmonkey mailing list