App Architecture - Nonmenclature

Sannyasin Brahmanathaswami brahma at hindu.org
Sat Jan 5 18:55:38 EST 2019


More strategy thoughts about app architure.....

I am using Andre book, (which he says is a guideline and your app may differ) but, wow, it has helped a lot to make "models" encapsulated.

 Since they know nothing  about the UI, it is easy to debug, because you just expected a list  file from disk, at a list image path or a list of quotes, or JSON from the date base. So you are not debugging the UI at the same time.  I use to mix the two together …what a relief!

Ok, so far so good. 

Now there is a "new man on the block" which I  will call the UI utilities. 

They are not a  traditional "model" - which access the disk and return data and write data - they are things you do in the UI all the time, in different cards and stacks. 

The "UI utilities" (perhaps have a different name)  are naturally classed by control type:
 
Fields:
  -- get formattedtext rect
  -- change a position, say you want it centered
  -- change to the rect of bkgnd grp unlay (a fld "group")

Text: 
  -- truncation 
  
Images:
  -- get the ratio of width to height
 -- thereby determining if in portrait or landscape
 -- set the image to the card rect - 50 pixel for the bottom tool bar


Button
   -- a style sheet of how buttons  look on all card on all stacks

Etc.

So,  in a "levure" style framework, we find ourselves doing the same thing, in stack "behaviors"  over and over again...

So, what do you do? Create a library and call it "ui_utilities"?

Or create of one each for kind of control 

UiUtilitiesFields.livecodescript
UiUtilitiesImages.livecodescript
 
Currently have  1 one library called "lib_SivaSivaMedia.livecodescript" 

Which is half a "model" and has "section" of handler which a UI utilities.

I think I should break out the UI Utilities. So the question is: do you want more and more files? 

Probably not, maybe just one File: 

uiUtilities.livecodescript
 
What do you do?

 Brahmanathaswami



More information about the use-livecode mailing list