Path: news.net.uni-c.dk!not-for-mail From: "Peter Andersen" Newsgroups: comp.lang.beta Subject: Re: Please, some critique! Date: Mon, 6 May 2002 13:19:43 +0200 Organization: UNI-C Lines: 65 Message-ID: References: NNTP-Posting-Host: isdn-2-175.cs.au.dk X-Trace: news.net.uni-c.dk 1020683986 12108 130.225.2.175 (6 May 2002 11:19:46 GMT) X-Complaints-To: usenet@news.net.uni-c.dk NNTP-Posting-Date: Mon, 6 May 2002 11:19:46 +0000 (UTC) X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2600.0000 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2600.0000 Xref: news.net.uni-c.dk comp.lang.beta:13231 "Jan Atle Ramsli" wrote in message news:a9k2oj$apc$1@news.net.uni-c.dk... .... [snip] ... > But I need to know that I am doing things right from a Beta perspective. > I do not want to pick up bad habits that will be had to kick later. > > THe tables are instantiated on the root level, together with the window, > there is no 'table functionality' in > any window-subpattern and vice versa. > I have learned that this is good Model-View-Controller design, and hope > this is still valid :-) I think your code below looks good! Whether you prefer to have the TableReaders declared inside the windows (which is possible in BETA unlike many other languages without general block structure) or whether you prefer the old MVC style is a matter of personal preference, I think. Sincerely, Peter Andersen > > So, here it is, I am for safety's sake keeping the Fire Brigade on > alert: > > > tablefile: file > (# > NoSuchFileError::< > (# do name->putLine; ' not found'->putLine; false->continue #) > #); > TableReader: > (# > t: @TableFile; > tn: ^text; > open:< (# do INNER ; t.openRead; #); > read: > (# txt: ^text > do (if t.eos then none ->txt[]; leave read else t.getLine->txt[] > if) > exit txt[] > #); > close: (# do t.close #) > #); > TowerTableReader: TableReader > (# open::< (# do 'towers.txt'->t.name #) #); > PrinterTableReader: TableReader > (# open::< (# do 'printers.txt'->t.name #) #); > ScreenTableReader: TableReader > (# open::< (# do 'screens.txt'->t.name; #); #) > > -- All done with the mjolner tool, from designing the screens to laying > out patterns!!!! > It still doesn't like me to do too many very stupid things, but is much > more forgiving that previous. > Now I can do 10-20 stupid things, before I could do 0-3. > > Atle > > (PS Hope I'm not being a total nuisance! > PS)