sobota 29. prosince 2007

Boo Castle ASP.NET

OK, so after a help about Global.asax in ASP.NET 2.0 and ActiveRecord initialization, first version is working. Stay tuned :-)

Castle Boo - II

I am trying to write a small project to understand both Boo and Castle Project.
I have already written my first two small rules here.
Today I try to solve the question of inheritance. It may seem silly to ask a question wheather EnteredBill should inherit from Task if EnteredBill is Task in my concept, but as I have written before, I like the generics and it is not yet completelly usable in Boo (read here).


I will update this when I find the suitable way.

úterý 25. prosince 2007

Castle Boo

Using Castle in Boo

Finally I got to write few things about my ongoing work. I am not sure that this is completely correct and how it should be done.

I need to write a really simple tracking application and I decided to use Boo and Castle to both finish the task and to learn those two exciting technologies.

There is a simple inheritance structure in the project and few relationships and so I have finished with these two simple rules to follow:

1. generics is better so do not try to define your own base class. Use

[Castle.ActiveRecord.ActiveRecord]
class Event(Castle.ActiveRecord.ActiveRecordBase of Event):


2. if there is HasMany/BelongsTo relationship, use:


_expenses as IList = ArrayList()
[Castle.ActiveRecord.HasMany(Expense, Table:"Expense", ColumnKey:"accountid", Inverse:true) ]
Expenses as IList:
get: return _expenses
set: _expenses = value

on the "parent" side and


_fromAccount as Account
[Castle.ActiveRecord.BelongsTo("accountid")]
FromAccount as Account:
get: return _fromAccount
set:
_fromAccount = value
_fromAccount.Expenses.Add( self )


on the other. This way it works the way I like: setting Account property but being able to read list members at the same time.

pátek 7. prosince 2007

To get the examples working...

... you need to have Boo dlls registered in GAC or you have to have them in the bin subfolder. I will correct it in the next "release".



On Microsoft Internet Information Services 6.0 you'll also need to create a wildcard mapping to "aspnet_isapi.dll" to mask the .rails extension. It may be done on a virtual directory only; it is on the Directory tab under Configuration button.

čtvrtek 6. prosince 2007

BrailTest3 - layouts and AJAX

Just a little bit of layouts and AJAX to change the design easily and to try to get the date dynamically. Grab it from here.

středa 5. prosince 2007

BrailTest2 - current time at least

Ok, ok, the first sample was a little bit about nothing, so I have created a second one showing a data from controller at least. Download here.



To set it up, just unpack it all on Windows to C:\inetpub\wwwroot so you will have folder C:\inetpub\wwwroot\BrailTest1\. In IIS management console, create a virtual directory from the BrailTest1 folder, set it up to run under ASP.NET 2.0 and corresponding application pool. If you open http://localhost/BrailTest1/, you should get redirected to http://localhost/BrailTest1/home/showtime.rails that is showing your current time. The method is defined in this file C:\inetpub\wwwroot\BrailTest1\controllers\HomeController.boo.

BrailTest1 - downloadable empty sample

I am still very interested in modern programming techniques. I have always liked the MVC concept and disliked the wiring concept in WebForms. I decided to try Castle, Boo, MonoRail and Brail. I will post samples here, the first is just simple empty structure to entend. Download here.