[Ur] Learning Ur with a SimpleApplication

Artyom Shalkhakov artyom.shalkhakov at gmail.com
Sun Mar 27 23:27:14 EDT 2016


Hello Yves,

This is essentially what I did, and it kinda works (I'm writing an
e-commerce website-- yeah, I'm crazy):

1. Keep database schema (DDL) and "data access layer" in a separate
module (in my case, it's several modules, because I use some
components from the UPO library). The main thing in here is to keep an
interface that doesn't really mention database tables -- just some
CRUD operators, mostly.

2. Keep entry points to the application in the main module -- these
would definitely need to refer to each other, so the best solution I
got so far is to implement them all as a set of mutually recursive
functions. The functions will basically do the following: invoke data
access layer code to fetch some data based on input parameters, then
invoke templating functions to output HTML markup.

3. Keep templates in a separate module -- in my case, it's all just
pure functions that return HTML fragments/pages.

In all, this is plain MVC. Boring, but workable.

Actually, I think you could put some Ur/Web features to good use, but
I left this for future. Have to get something working first.

I'm planning to open source the code sometime in the future. The main
issue is that I use a paid-for design for the template (I ported a
WordPress template to Ur/Web), and I can't just redistribute it.

2016-03-27 23:49 GMT+06:00 Yves Cloutier <yves.cloutier at gmail.com>:
> I had a look at the SQL demo:
>
> http://www.impredicative.com/ur/demo/sql.html
>
> and think this provides a good foundation for what I'm trying to.
>
> I'll start again using this as a foundation.
>
> Sorry for the bother.
>
> yc
>
> _______________________________________________
> Ur mailing list
> Ur at impredicative.com
> http://www.impredicative.com/cgi-bin/mailman/listinfo/ur
>



-- 
Cheers,
Artyom Shalkhakov



More information about the Ur mailing list