digitalmars.D.learn - any framework or tips for multi-tier applications
- Qian Xu (6/6) Mar 28 2009 Hi All,
- Christopher Wright (25/33) Mar 28 2009 At times like this, I think of this blog post:
Hi All, We are redesigning a system (previously was written in C) using D. We use Boundary-Controll-Entity-Pattern. To wrap db table to entities is a very time consuming work. Is there any framework or tips for multi-tier applications in D? --Qian
Mar 28 2009
Qian Xu wrote:Hi All, We are redesigning a system (previously was written in C) using D. We use Boundary-Controll-Entity-Pattern. To wrap db table to entities is a very time consuming work. Is there any framework or tips for multi-tier applications in D? --QianAt times like this, I think of this blog post: http://ayende.com/Blog/archive/2008/03/11/Field-Expedients-or-why-I-dont-have-the-tools-is.aspx You can likely write some mixins to ease the use of Active Record. That would be the first thing I'd try. The simplest version I can imagine would either not work for relations: template Member(T, char[] name) { enum Member = T.stringof ~ ` ` ~ name ~ `() { return row.get!(` ~ T.stringof ~ `)(` ~ name ~ `); }`; } /* table Foo a INT, b BIT, c TEXT */ class Foo { private Row row; this (Row row) { this.row = row; } mixin (Member!(int, "a")); mixin (Member!(bool, "b")); mixin (Member!(char[], "c")); }
Mar 28 2009