Monday, August 08, 2005

Eco on Rails

I've successfully tested ECO with EcoAccess on MonoRail Web application framework.
It worked great, and I have some codes to show here.

/// EcoController.cs
using Castle.MonoRail.Framework;
using Centillex.EcoAccess;
using User;

namespace EcoRailsSample
{
public class EcoController : SmartDispatcherController {

UserEcoSpace eco = new UserEcoSpace();

public void List() {
}

public void Edit(int id) {
}

public void View(int id) {
if(eco.Active == false) eco.Active = true;
ISystemUserEA si;
si = (ISystemUserEA) AccessFactory.Create(eco, typeof(ISystemUserEA));
PropertyBag["system_user"] = si.FindById(id);
}
}
}


I set a simple HTML in View.vm (NVelocity template) like this:

## View.vm
<h3>System User</h3>

Name : $system_user.FirstName <br/>
Last Name: $system_user.LastName <br/>



Here is the screenshot of the above codes:

Tuesday, August 02, 2005

EcoAccess v.1.0 M1 Released

EcoAccess is now available to download from Centillex.com
This is very early access version. However, you can use many exciting features of it.

Please download it from this page.

Sunday, July 31, 2005

EcoAccess: A Declarative DAO for ECO

I'd like to introduce my work for Borland ECO.
It was inspired by many Java projects such as Beehive and Hibernate.
This project "EcoAccess" is based on Dynamic Proxy from Castle to enable a declarative programming model to Borland ECO.
Obviously, it utilise many ECO services and let you easy to have OCL access methods.
I'd like to thank many articles from ECO section of HowToDoThings.com that guide me on ECO.

The most intesting concept I implemented into EcoAccess is that it provides a pure interface programming model like this:

[AccessEcoSpace(typeof (UserEcoSpace))]
public interface ISystemUserDAO {

[Ocl("SystemUser.allInstances->select(s|s.id = id)->first")]
SystemUser FindById(int id);
}


You can read the first tutorial here.

Wednesday, April 13, 2005

First get in touch with Comega

Test.cw


using System;

public class Test {

class Address {
struct {
string text;
};
}

static void Main() {
Address a = <Address><text>test</text></Address>;
Console.WriteLine("Comega says hello!");
Console.WriteLine(a.text);
Console.ReadLine();
}
}


The above code results:

Comega says hello!
test