Path: news.cs.au.dk!noatun.mjolner.dk!mail-to-news From: Atle Newsgroups: comp.lang.beta Subject: Help on general design issues Date: Sat, 02 Dec 2000 17:23:34 +0100 Organization: Posted to comp.lang.beta by a mailtonews script Lines: 90 Sender: lbr@mjolner.dk Approved: mailtonews@cs.au.dk Message-ID: <90i8ev$7s9sv$1@gjallar.cs.au.dk> NNTP-Posting-Host: bifrost.mjolner.dk Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Trace: gjallar.cs.au.dk 976004383 8267679 130.225.4.254 (5 Dec 2000 08:19:43 GMT) X-Complaints-To: usenet@cs.au.dk NNTP-Posting-Date: Tue, 5 Dec 2000 08:19:43 +0000 (UTC) Mailing-List: contact usergroup-help@mjolner.dk; run by ezmlm X-No-Archive: yes X-Mailer: Mozilla 4.72 [en] (X11; U; Linux 2.2.14 i686) X-Accept-Language: en X-Original-Message-ID: <3A292206.7A19FD46@skynet.be> X-Original-Sender: atle@skynet.be Xref: news.cs.au.dk comp.lang.beta:12663 Hello, honorable Beta developers. I know some of this may be a bit off topic, but I can't ask about the rest bfore having ask about that. Also, very little is about how to express things Beta, but Beta is why I'm doing what I do, and asking these questions, and since according to the Beta philosophy (which I subscribe to) 'everything' is programming, so in a way that makes it all relevant. I want to express the process of diagnosis calculation mathematically. To me, this is the only way to provide insight into what is going on in the system. I have now built up the acupuncture database completely with the help of small Beta programs like the one I submitted to you for comments, and it contains Symptoms, with an ID and a descriptive string. Diagnoses, with ID and descriptions. Acupuncture Points, with ID and descriptions. Then there are tables called SAR and DAR (Symptoms Analysis Reference, Diagnosis Analysis Reference) that contain tuples of symptom ID and Diagnosis ID for SAR, and tuples of Diagnosis ID and Point ID for DAR. There are a couple of more things, like a 'frequency' table with statistics (calculated probabilities of a symptom indicating a diagnosis for men, women and children, respectively) but once I get the basis right, this is easily added. An SQL example --------------- To get a list of possible diagnoses for symptom X, one now proceeds (roughly) as follows in SQL: SELECT Diagnoses.Name FROM Symptoms,Sar,Diagnoses WHERE Symptoms.Id=X AND Symptoms.Id=Sar.Sid AND Diagnoses.Id=Sar.Did ; Describing the basic data -------------------------- Now, I want to define the basic data structures mathematically, so it is easier to see how these tables relate to one another. I want to specify that a string, I call it S, is a subset of sets of C. To specify that order is significant (a string is a sequence) I say that if T and V are subsets of S, then S=T if for all x,y in S,T x(i)=y(i) To specify that duplicates are allowed, I say that there exists an x,y in T,V such that x(i)=y(j) and i<>j Q1: Have I now specified a string? ********************************** I am not very good at this (yet) but improving :-) Describing the diagnosis calculation ------------------------------------- When a string is specified, then I can specify ID as subset of it, and SID,DID and PID as subsets of ID. Then I can try to express things like Diagnosis(x)->D defined as x in SYMPT D subset DIAG forall r in SAR | sid(r)=x ^ forall d in DIAG | id(d)=diag(r) ^ id(d) in D or something like that ... How to proceed ... ------------------- Now, the reason I am writing this here, is because the feedback I have gotten so far ranges from: 'Totally useless' via 'Why waste your time with this? Write the program instead' from young, otherwise brilliant programmers, to 'Sorry, this is over my head' from older, more experienced, and otherwise brilliant programmers. Q2a:What is wrong? Q2b:Am I wasting my time? *************************** I feel I gain an insight into this system that I never had before ... but lately I have not been doing much programming, since the design got somewhat out of hand: MVC gone berserk ----------------- The Model-View-Controller sort of exploded into SymptomView,DiagView,PointView,SymptomStore,DiagStore,PointStore and I lost track of where the 'current selection' was stored. It looked 'well structured', but messages like 'selectSymptom', 'generateDiagnosis' or 'viewPoints' were being passed from the DiagView to the View, to the Controller, to the Model, to the SymptomStore where the first 'thing' happened, and instead of losing track of the code and structure, which was really clear, I lost track of where the 'action' was. Getting back on track ---------------------- I hope that my change of approach eventually will lead me to a complete list of messages that have to come from the views and trigger actions in the controller, which will get the relevant data from the model, if appropriate. I also hope to generalize the views, so I don't need one kind of view for each of Symptom, Diagnosis and Point. That way, everything can happen in the controller, instead of it acting as a 'phone central' that just dispatches messages to the appropriate receiver. The controller will have all the knowledge of all data and functions. So, now I wonder if I had gotten too 'object-happy' like some C++ programmers do when they write graphics libraries. It shouldn't be necessary to learn more about objects that do nothing than about objects that do. Q3: Does this all make sense? ***************************** Thanks, Atle