Page 1 of 1

MVC - livecode separation of layers

Posted: Sun Jul 21, 2013 7:45 pm
by MrWizard.
Does anyone have any advice on keeping layers separate? I try to use good MVC design and keep as much separated as possible. I am looking to create a clean Design [MVC (Model-View-Controller) MVVM (Model-View-View-Model) and MVP (Model-View-Presenter)].

UI <--> BLL <--> DAL

This 3 layer architecture should allow me to separate presentation for devices (iPhone, iPad, Browser, fat client) from the Business Logic Layer (BLL). The BLL would be able to reside locally or remotely on a internet server.

The Data Access Layer (DAL) which contains only the code needed to read/write from the database
which consumes the DAL, contains business rules, and validation,

This separation should allow for reusable components, flexibility as to placement of the layer, as well as multiple interchangable database types.

Thanks
E

Re: MVC - livecode separation of layers

Posted: Tue Jul 23, 2013 10:12 pm
by MrWizard.
I see that LC has the concept of include files (both locally and remote)

How do I use stacks with LiveCode Server?
http://lessons.runrev.com/s/lessons/m/4 ... ode-server

What is a Library and Why Do I Care?
http://livecode.byu.edu/messages/libraries.php

This is good and should encourage the separation of UI and code. I guess we can enforce a good MVC paradigm through proper discipline.

I understand that Apple restricts bypassing the App store and downloading of code from an internet server. If accurate, then that limits the usefulness of stacks with LiveCode Server. Is that accurate?

Can iOS use local library stacks? Is there any instruction on that?

Thanks
E

Re: MVC - livecode separation of layers

Posted: Tue Jul 23, 2013 10:41 pm
by FourthWorld
MrWizard. wrote:Can iOS use local library stacks? Is there any instruction on that?
A library stack is just a stack with code. It can be included as a substack in the main stack file, or within the app bundle as a separate stack file.

Re: MVC - livecode separation of layers

Posted: Wed Jul 24, 2013 1:32 am
by MrWizard.
Thanks.

Is it created through the client IDE or does one just use a text editor

E

Re: MVC - livecode separation of layers

Posted: Thu Jul 25, 2013 10:19 am
by Klaus
Hi E,

[quote]Is it created through the client IDE or does one just use a text editor[/url]
I guess this is a question, although the question mark is missing...

Since we are talking about library STACKS, what do you think? 8-)


Best

Klaus

Re: MVC - livecode separation of layers

Posted: Thu Jul 25, 2013 10:27 am
by shaosean
Klaus wrote:
Is it created through the client IDE or does one just use a text editor[/url]

Come on Klaus, the lack of a closing quote tag and the lack of a opening url tag.. tsk tsk..

Re: MVC - livecode separation of layers

Posted: Thu Jul 25, 2013 11:36 am
by Klaus
It is very hot over here in sunny germanski! 8-)

Re: MVC - livecode separation of layers

Posted: Thu Jul 25, 2013 11:49 am
by shaosean
Can't beat the blistering 12C over here

Re: MVC - livecode separation of layers

Posted: Thu Jul 25, 2013 12:11 pm
by Klaus
12° celsius?
HA, kids stuff! :-D

It is over 35° celsius and raising here...

Re: MVC - livecode separation of layers

Posted: Thu Jul 25, 2013 12:55 pm
by shaosean
I guess I forgot the sarcasm tags ;-) Yeah, I get to hear another German friend complain about the heat over there, so enjoy it ;-)

Re: MVC - livecode separation of layers

Posted: Thu Jul 25, 2013 1:05 pm
by Klaus
I really do! And that is not sarcastic or something :-)