Castle

Optimizing Windsor

Recently we got a bug report about the performance of Windsor when registering large number of components (thousands). I decided to sit down and investigate this, and found out something that was troublesome. Internally, registering a component would trigger a check for all registered components that are waiting for a dependency. If you had a lot of components that were waiting for dependency, registering a new component degenerated to an O(N^2) operation, where N was the number of components with waiting dependencies. Luckily, there was no real requirement for an O(N^2) operation, and I was able to...

posted @ Friday, September 18, 2009 10:06 AM | Feedback (18)

Castle Windsor 2.0 RTM Released

Some would say that it is about time, I would agree. Windsor might not be the OSS project in pre release state for the longest time (I think that the honor belong to Hurd), but it spent enough time at that state to at least deserve a honorary mention. That was mostly because, although Windsor was production ready for the last three or four years or so, most of the people making use of it were happy to make use of the trunk version. If you will look, you won’t find Windsor 1.0, only release candidates for...

posted @ Tuesday, May 05, 2009 1:22 AM | Feedback (33)

Logging - the AOP way

Logging is probably the most mentioned sweet spot of AOP. Probably because it is the simplest and most straightforward example most people can think of. I remember going over a piece of code that handles billions of transactions a day(that is for you, Jdn), and seeing something like this: public void DoSomethingInteresting(string arg1, int arg2) { LogGateway.Enter("DoSomethingInteresting", arg1, arg2); try { // actual method code LogGateway.Success("DoSomethingInteresting", arg1, arg2); } catch(Exception e) { LogGateway.Error(e, "DoSomethingInteresting", arg1, arg2); throw e; } finally { LogGateway.Exit("DoSomethingInteresting", arg1, arg2); } } That was repeated for each and every method in the system. It was horrible. I don't care how you do it, but there are at least 7...

posted @ Thursday, July 31, 2008 9:40 PM | Feedback (15)

Integrating NHibernate and Active Record

On the face of it, this is a nonsense post. What do I mean, integrating NHibernate and Active Record? Active Record is based on NHibernate, after all. What kind of integration you need? Well, sometimes you want to be able to use NHibernate entities in an Active Record project. And that tended to be very hard. (The other way was extremely easy, just tell Active Record to generate the mapping and move from there.) A week or so ago I added support for doing it the other way around, of adding POCO NHibernate entities into the ActiveRecord model. ...

posted @ Sunday, July 13, 2008 12:06 PM | Feedback (1)

Pain reduction: creating ductile tests

Take a look at this test: [Test] public void When_asking_for_latest_webcast_will_not_consider_webcasts_published_in_the_future() { var webcast = new Webcast { Name = "test", PublishDate = DateTime.Now.AddDays(-2) }; With.Transaction(() => webcastRepository.Save(webcast)); var webcast2 = new Webcast { Name = "test", PublishDate = DateTime.Now.AddDays(2) }; With.Transaction(() => webcastRepository.Save(webcast2)); Assert.AreEqual(webcast.Id, webcastRepository.GetLatest().Id); } It looks like a valid test, doesn't it? It has a huge problem. It is brittle. I just added a new non null property, and all the tests broke. I started to add the new property value to the test, before I realize what I was doing. I run into a friction point, and I was trying to cover it...

posted @ Friday, June 13, 2008 2:07 AM | Feedback (4)

The test of fire: Rhino Mocks 3.5 in the real world

I have been waiting on the release for Rhino Mocks 3.5, seeing what kind of feedback I can get from users. I also had another reason, I hadn't had the chance to really give it a good testing, in the only manner that matter, using it to develop production ready software. Here is my latest test, which I am fairly pleased with. [TestFixture] public class WebcastControllerTest { private WebcastController controller; private IRepository<Webcast> repositoryStub; private StubEngineContext engineContext; private IUnitOfWork unitOfWorkStub; private IDisposable disposeGlobalUnitOfWorkRegistration; [SetUp] public void Setup() { repositoryStub = MockRepository.GenerateStub<IRepository<Webcast>>(); unitOfWorkStub = MockRepository.GenerateStub<IUnitOfWork>(); controller = new WebcastController(repositoryStub) ...

posted @ Friday, June 13, 2008 12:49 AM | Feedback (7)

Painless Persistence with Castle Active Record

About a year ago me and Hammett gave a few talks about Castle in JAOO. I am not sure why the recording of the talk came up now, but it have. You can watch this presentation here: http://www.infoq.com/presentations/eini-verissimo-castle-active-record For all the people who wanted to see a video of one of my presentation, there you go.

posted @ Tuesday, June 03, 2008 2:43 AM | Feedback (2)

Donjon - Hammett's Teasing

Hammett has just posted teaser image on his blog. Go check it out. I have some idea about how long ago it started, and to get to this point is amazing (and no, I don't have any extra knowledge about what it does otherwise, except maybe free us from OutOfMemoryError s and manual restarts).

posted @ Sunday, January 20, 2008 10:08 PM | Feedback (1)

Active Record: Mapping Rewriting

One of the really nice things about using the NHibernate / Active Record stack is that there are so many extensions points. One of the more fun things is the ability to do runtime modifications of the mapping. Here is a simple example:ActiveRecordStarter.ModelsCreated+=delegate(ActiveRecordModelCollection models, IConfigurationSource source) { foreach (ActiveRecordModel model in models) { if(model.Type == typeof(User)) { model.ActiveRecordAtt.Table = "MyUsers"; } ...

posted @ Friday, January 11, 2008 4:38 PM | Feedback (3)

Castle Style Errors

I had to compare different styles of error handling approaches, and I automatically compared the ideal, Castle Style errors, to the nasty, Mystery HRESUTL of the Week. But what does Castle Style errors means? Let us take a look at a few of them. When an module that was registered before the MonoRail http module had thrown an exception: throw new Exception( "An exception happened on Global application or on a module that run before MonoRail's module. " + "MonoRail will not be initialized and further requests are going to fail. " + "Fix the cause of the error reported below.",...

posted @ Monday, November 05, 2007 12:06 AM | Feedback (10)

Model View Action

Adam has an interesting discussion here about handling common actions in MonoRail. This has sparked some discussion in the MonoRail mailing list. I wanted to take the chance to discuss the idea in more detail here. Basically, he is talking about doing this: public class IndexAction : SmartDispatcherAction { private ISearchableRepository repos; private string indexView; public IndexAction( ISearchableRepository repos, string indexView) { this.repos = repos; this.indexView = indexView; } public...

posted @ Friday, October 26, 2007 11:52 PM | Feedback (0)

Template Controllers

Sharing common functionality across controllers is something that I have run into several times in the past. It is basically needing to offer the same functionality across different elements in the application. Let us take for a moment a search page. In my current application, a search page has to offer rich search functionality for the user, the ability to do pattern matching, so given a certain entity, match all the relevant related entities that can fit this entity. Match all openings for a candidate. Match all candidates for an opening. That is unique, mostly, but then we have a...

posted @ Friday, October 26, 2007 8:44 PM | Feedback (2)

Trusting the benchmark

I was scanning this article when I read noticed this bit.  A benchmark showing superior performance to another dynamic proxy implementation.   I should mention in advance that I am impressed. I have built one from scratch, and am an active member of DP2 (and DP1, when it was relevant). That is not something that you approach easily. It is hard, damn hard. And the edge cases will kill you there. But there are two problems that I have with this benchmark. They are mostly universal for benchmarks, actually. First, it tests unrealistic scenario, you never use a proxy generation framework with...

posted @ Tuesday, October 16, 2007 10:39 PM | Feedback (5)

Commercial support for Castle Windsor, Castle MonoRail, NHibernate, etc

This post by Ben Scheirman is interesting. He points out that the MS.MVC stuff is targeted toward a different crowd than the one who is using MonoRail, it is targeted toward the corporate developers and the All-Microsoft Shops. The question of support has been raised again, and it prompted this post. It seems that there isn't a lot of awareness that there are commercial support options for those tools. Castle Stronghold is the obvious place for commercial support for Castle. JBoss / RedHat are offering commercial support for NHibernate. JBoss no longer support NHibernate. ...

posted @ Monday, October 15, 2007 10:43 PM | Feedback (5)

Multiple parents in Cascading Drop Downs in MonoRail

Apparently I am suffering from the Bug Duplication Syndrom. Shortly after posting about cascading drop downs in MonoRail, I realized that I have actually duplicated a bug that I have run into while using the cascading drop down extender in the ASP.Net Ajax toolkit. That is not a fixable bug, btw, and has to do with what happens when you have more than a single parent. You can see my post about this scenario here, but be aware that the solution in that post is vulnerable to race conditions, and I have finally declared that unpracticle to use. At any rate,...

posted @ Monday, October 08, 2007 2:39 PM | Feedback (0)

Cascading Drop Downs in MonoRail

I just had this need, and I decided to explore what I could do without referring to what other people has already done. There are probably better ways, but this one has tickled my fancy. Anyway, the idea here is to display three levels of hierarchy in a profression. Here is the HTML: <table> <tr> <td> ${res.PrimaryProfession} </td> <td> ${Form.Select("primaries",PrimaryProfessions, {@value: @Id, @text: @Name, @firstoption: res.Select}) } </td> <td> ${res.SecondaryProfession} </td> <td> ${Form.Select("secondaries",SecondaryProfessions, ...

posted @ Monday, October 08, 2007 1:29 PM | Feedback (15)

Handling javascript localization in Mono Rail

I run into the issue of having to alert the user of some error, and it brought home the fact that English & Hebrew are not easy to mix. In fact, code such as this is consider a very bad sign, usually code that you don't really want to touch, see or believe in: So, we need some sort of a way to externalize those strings, even if the only language that this application is going to use is Hebrew, simply because of the pain of mixing the two together. After thinking about it for a while, I...

posted @ Sunday, October 07, 2007 6:10 PM | Feedback (5)

And now THAT is flattering

Take a look at this Object Builder Bug, and David Hayden coverage of that bug. Extremely flattering, and a real credit to Hammett. When the criteria is: "It ain't Windsor", it says quite a bit. :-)

posted @ Saturday, October 06, 2007 12:46 AM | Feedback (1)

Open Source & Forking

Joe raises an interesting question as a result of my post about Dunn & Churchill forking a commercial version of Active Record. I mentioned that I am alright, personally, with this behavior, and he asks: Why would you be alright with that? Hammett, yourself and others have put countless hours in to the project and then these two dopes repackage and sell your work. I understand that legally it may be OK, but it doesn't pass muster in any way at all ethically. We have two different things going on here at once. I certainly don't like it, I...

posted @ Friday, October 05, 2007 12:59 PM | Feedback (13)

Imitation is the sincerest form of flattery

Well, I guess that Castle Active Record just a whole shower of flattery. This was just posted to the Castle Forums, apparently Dunn & Churchill have a product called Diamond Binding that looks very much like Castle Active Record. There is a code project article about it here, and from the API and the license files, it looks like they have taken the Castle Active Record source and repackaged it.  Now, this is allowed by the license, and this is something that I am perfectly fine at. It looks like they did some nice things with VS integration, but that is...

posted @ Friday, October 05, 2007 4:29 AM | Feedback (5)

Active Record & MonoRail web casts

Here are the rehearsal sessions for Hammett & me at JAOO. Hammett has just published them. Not anything really new, frankly, and the quality is all over the spectrum. I was having a nasty case of the flu, especially on the MR screen cast, and that one was recorded close to midnight. You can see me recording the screen cast, that is a weird movie, I tend to move a lot when I talk, but I don't think Hammett's laptop was very impressed. Ten points if you can find the part when I kicked it.

posted @ Thursday, October 04, 2007 9:48 PM | Feedback (1)

Random Impressions from JAOO: Web Forms on the Enterprise

When Hamilton and me gave the MonoRail talk to the Enterprise Application track, we asked how many people were .NET vs JAVA vs Ruby. The results where roughly 43%, 43% and 4%, respectively. The interesting part was when I asked how many of the .NET guys used Web Forms, almost all of them said that they do. Then I asked how many enjoyed using Web Forms. No one raised their hands.

posted @ Friday, September 28, 2007 7:24 AM | Feedback (2)

MonoRail.HotSwap in Action

Colin Ramsay has a short screen cast showing the advantages of using MonoRail HotSwap. I should mention that the startup times that you see in the screen cast are for empty projects, for real world projects they are much longer. And yes, that is how I say Ayende. :-)

posted @ Sunday, September 23, 2007 4:30 PM | Feedback (2)

Refactoring MonoRail Views

As I mentioned, I build a very quick & dirty solution to display a collection of scheduled task descriptions. The end result looked like this: This works, and it should start producing value as of next week, but I didn't really like the way I built it. Here is the original view code: <table cellspacing="0" cellpadding="0"> <thead> <tr> <th> Name:</th> <th> Occurances</th> <th> &nbsp;</th> </tr> </thead> <tbody> <% for task in tasks: %> <tr> <td> ${Text.PascalCaseToWord(task.Name)} </td> <td> Every ${task.OccuranceEvery} </td> <td> ${Html.LinkTo("Execute", "ScheduledTasks", "Execute", task.FullName)} </td> </tr> <% end %> </tbody> </table> This work, it is simple and easy to understand, but it still bothered me. So I replaced it with this: <% component SmartGrid, {@source: tasks} %> Well, that was much shorter, but the result...

posted @ Thursday, September 20, 2007 11:13 PM | Feedback (3)

Convention over configuration: Structured approach

Hammett has a post that made me think. He is talking about configuring Spring for Java and has this to comment: I can’t understand this uncontrolled passion that java programmers carry for xml. I can certainly agree with him about that, but I got to the same point a long time ago with Windsor. I had an application which was rife with components. I am talking about many dozens of generic (as in MyComponent<T>) components, all of which required registration in the config file, which got to be fairly annoying very fast. I solved that by creating Binsor, a...

posted @ Thursday, September 20, 2007 10:51 PM | Feedback (1)

DevTech session: Storming Castle Windsor & NHibernate

I am announcing this a bit late, but I am going to give a talk about the Castle Winsdor & NHibernate on Thursday next week (03 July 2007).The anouncement has an amusing typo, I am afraid, which bring to mind some horrifying options The talk will be at DevTech, a conference that my company is arranging, so a lot of the people that I work with are going to give interesting talks. You can get more details here. Oh, and apparently I...

posted @ Thursday, June 28, 2007 7:00 PM | Feedback (1)

DSL Support for Brail

First things first, Harris Boyce III has done all the work, my sum contribution to this feature has included some wild cheering from the side lines. That said, this is one cool feature. Let us explore it. There are a lot of people who consider anything resembling <html> tags to be a mess, associate them with ASP Classic mistakes, and reject them out of hand. I think that this is a mistake, but I gave up changing the whole world overnight, now I have busy formulating three steps plans that takes a week... At any rate, consider this output: <html> <body> <table> <tr> <th>Names</th> </tr> <tr> <td>Ayende</td> </tr> <tr> <td>Rahien</td> </tr> </table> </body> </html> How...

posted @ Tuesday, June 26, 2007 8:33 AM | Feedback (10)

Navigating large code bases

I just needed to find an answer to a question in MonoRail. MonoRail code base is over 75,000 lines of code, including all the supporting projects and tests. Castle.MonoRail.Framework has about 37,700 lines of code. The question was something that I never really thought about, and had no idea where to start looking at. I opened the solution and started hunting. It took about five or six minutes to find the correct spot, another two to verify my assumption and be shocked that there is a private method there :-) and then I was done. Under ten minutes, to find...

posted @ Tuesday, June 19, 2007 2:10 AM | Feedback (5)

The Forum Sample Application

So, it looks like the vote goes decidefully for MonoRail, so that is what I am going to build it with. I have setup a project here: https://rhino-tools.svn.sourceforge.net/svnroot/rhino-tools/trunk/SampleApplications/Hibernating.Forums I have decided to take advantage of this series and show some other cool stuff that I have used, from the Repository<T> & NHQG to Binsor and MonoRail Windsor Integration. The application is basically just UI and configuration right now. I did some very rough strcuturing of the UI in a way that should...

posted @ Thursday, June 14, 2007 12:40 AM | Feedback (3)

WCF Windsor Integration

Last night I commited WCF Integration to the Castle trunk. This is based in part on the work described here by Orand. The main idea here is that WCF should get the service instances from Windsor, which gives us all the usual advantages of IoC plus Windsor's interceptors capabilities. It isn't a lot of code, but it makes it much easier to work with WCF services. Using it on a web application: Call this in the beginning of the application (Global.Application_Start): WindsorServiceHostFactory.RegisterContainer(container); Create a MyService.svc file and put this in it:<%@ ServiceHost Service="component name in windsor" Factory="Castle.Facilities.WcfIntegration.WindsorServiceHostFactory, Castle.Facilities.WcfIntegration" %> Have...

posted @ Tuesday, June 12, 2007 8:09 AM | Feedback (7)

Castle.MonoRail.ViewComponents

So I finally found the time to build the project and put it on castle contrib. The main idea is that this is the place where community contributed view components can be aggregated, including documentation and sample code. You can get the initial stub here, it includes the Grid Component and Smart Grid Component, as well as (hopefully) thorough documentation about their usage.

posted @ Saturday, June 02, 2007 5:28 PM | Feedback (0)

Proxying Castle

From Joel Spolsky:“Google uses Bayesian filtering the way Microsoft uses the if statement,” It just occured to me that the same can be said about Castle and Dynamic Proxy. We use that from everything from AoP to strongly typed parameters support.

posted @ Wednesday, May 23, 2007 9:47 AM | Feedback (5)

MonoRail and Update Panel

It seems like a MonoRail implementation of the UpdatePanel is fairly high for people coming to MonoRail from the WebForms world. I am doing a project that uses Update Panel fairly extensively, and I can see why, it is really nice way to add Ajax capabilities to your web form. I started to look into what it would take to implement it with MonoRail, and I came to two conclusions: The technical challanges on the server side are minor, on the client side it is...

posted @ Friday, May 11, 2007 10:35 AM | Feedback (7)

What lurks in the dark corners of the Castle

I had a chat with a pal of mine recently, about why he would recommend working with Web Forms over MonoRail. The short answer was that he didn't want to end up with an ungooglable exception. The reasoning is that there isn't any nook or crany in Web Forms that hasn't been discovered, talked about, solved, and most importantly than all, indexed by Google. I don't agree with this approach, but I recognize that this is a valid way of operating. The major reason that I don't agree with this...

posted @ Tuesday, May 08, 2007 8:56 AM | Feedback (18)

Windsor Patterns

I have no idea how I missed it so far, but Alex has a set of posts showing all sorts of interesting usage patterns (and design patterns) that can be used with Windsor. Part 1 - Simple Configuration Part 2 - More Configuration (Arrays) Part 3 - Still More Configuration (Dictionaries) ...

posted @ Thursday, May 03, 2007 12:46 AM | Feedback (8)

Dynamic Proxy 2: Mixins

I needed a rest from dealing with SSIS and data migrations issues, so I decided to put some time in real code. I just finished adding support for Mixins to Dynamic Proxy 2. Here is the first test that passed, the name should tell you quite a bit about what is required to make it work. [Test] ...

posted @ Saturday, April 14, 2007 3:37 AM | Feedback (0)

Hibernating Rhinos - Episode #2 - Select * From MonoRail.Customers

I have just finished putting together the second episode of Hibernating Rhinos. This one tooks several days and a lot of effort to produce. The download page is here, where you can also download the first episode, talking about Rhino Mocks. The screencast is basically taking implementing similar functionality in both Web Forms and MonoRail, while I talk about the differences between the two approaches. I spent quite a bit of time explaining most of what I do when I am writing MonoRail code, so I hope it would be clear. This episode...

posted @ Monday, April 09, 2007 1:48 AM | Feedback (24)

Building View Components For MonoRail

While WebForms and MonoRail share the ability to refactor common UI elements into reusable components, the design decisions that should be considered for each of those is quite different. Build view components for MonoRail is much simpler than building controls for web forms, for one :-) I talked in the past about the mechanics of implementing View Components, now I want to talk about several best practices that may be useful for developers building view components for MonoRail. For this discussion, I am going to give examples from the grid component for MonoRail, whose implementation...

posted @ Sunday, April 08, 2007 5:50 AM | Feedback (10)

Brail: Complex Expressions

The technical details are going to be of interest to a limited number of people, but it comes down to a design choice that I made when I first wrote Brail. It has to do with how the text is outputted into the compiler, and some tricky bits that can happen there because Boo's compiler understand that "this is ${code}" and can turn it into the correct string, based on the value of the variable "code". That was fine until I realized that I can do more than a simple variable substitution in...

posted @ Friday, April 06, 2007 10:30 PM | Feedback (2)

Having Fun with SmartGridComponent

I am preparing to my Dev Teach talks, and I wanted to show a cool view component. Here is a sample of how it looks like now: <% component SmartGridComponent, { ...

posted @ Thursday, April 05, 2007 8:32 AM | Feedback (21)

MonoRail With SubSonic

In the Castle forums, it was asked if it is possible to use SubSonic as the DAL for a MonoRail application. The answer is absolutely yes. You will usually see MonoRail samples with either Active Record or NHibernate, simply beacuse this is what most of the users of MonoRail are using, but MonoRail has no data access preference. (There are extention to MonoRail that make it work better with Active Record and NHibernate, but those are just that, extentions, the core is completely data layer agnostic). So, how would you...

posted @ Friday, March 30, 2007 12:19 PM | Feedback (5)

Visual Studio Designer for Active Record & NHibernate

Gökhan Altınören has just updated Active Writer, a designer for Active Record, and now for NHibernate as well. The bits are on Castle Contrib trunk

posted @ Thursday, March 29, 2007 11:31 AM | Feedback (2)

Recommended approaches to AOP with Windsor

In my Policy Injection With Windsor (in 40 minutes), I mentioned that things like the Policy Injection Block are not a really good approach to doing AOP using Windsor. What I meant that I wouldn't build something like the Policy Application Block, simply because it doesn't really gives me anything special. The use cases for simple interception AOP are quite limited. Mostly logging, performance monitor, and that about it. But its very nature, AOP is an infrastructure entity, and will generally not take part of any meaningful business logic. Can someone think about an interesting...

posted @ Tuesday, March 13, 2007 11:05 PM | Feedback (0)

Asp.net on steroids

Eber Irigoyen replied to Jeremy's and my testability posts: Jeremy Miller started a conversation on .NET testability (or the lack there of), Ayende agrees with him. I can definitely see this, I have suffered from this... but! I don't think the problem is with the tools, in any case the problem would be of the TDD community, Ruby on Rails is open source, why can't we create asp.net on steroids? seems like we know exactly what we want, the concept is there, the code is there,...

posted @ Thursday, March 08, 2007 11:04 PM | Feedback (4)

Brail Update: Fixing AmbigiousMatchException for lazy loaded classes

There is probably a bug in Dynamic Proxy that causes it to output overrides to methods in such a way that when you reflect over the generated types, you get two methods for each overriden methods, instead of a single overriden method. I looked into it in detail a while ago, and I couldn't figure out how to make it work like I expect it to. The code that it generate is verifable, so this is something that the CLR supports, but I am not quite sure that I understand what the semantics for this is....

posted @ Sunday, February 25, 2007 1:20 AM | Feedback (3)

Serialization Hurts Me

I am now adding serialization support to Dynamic Proxy 2, and it is painful. It is painful because: I never did much with serialization, and there seem to be a lot of black magic there with regard to whatever you implement ISerializable, has [Serializable] or use any of the special hooks. I am working with serializaztion by directly manipulating the IL generation. This makes for fun debugging. ...

posted @ Friday, February 16, 2007 3:04 PM | Feedback (3)

Test First Web Development

Dan Bunea had published a very good tutorial about how to do Test First development on the web. Go visit here

posted @ Wednesday, January 24, 2007 7:40 PM | Feedback (0)

MonoRail Views to the uninitiated

It looks like a lot of the people working on MonoRail has at least some RubyOnRails experiance, this means that there usualy a way for people coming from mostly WebForms background to map the concepts they know to the MonoRail lingo. Just to set the record straight, MonoRail is runing on ASP.Net platform, no perl involved. Here is a mostly random attempt to map some of those concepts, note that I am talking about views only here; Master Page...

posted @ Sunday, December 31, 2006 2:57 AM | Feedback (0)

The reason for Ajax Generators

In my last post, I show how to use the Ajax Generators, but I didn't really explain why it is good to learn yet another way to do Ajax. Here is the example that I used:page.ReplaceHtml('paginatedGrid', {@partial : 'faq/grid' }) page.VisualEffect('Highlight', 'paginatedGrid') This will send the following to the client:try  {  Element.update("paginatedGrid","gridContent");  new Effect.Highlight('paginatedGrid', {}); } catch(e) {  alert('JS error ' + e.toString());  alert('Generated content: \nElement.update(\"paginatedGrid\",\"gridContent\");\nnew Effect.Highlight(\'paginatedGrid\', {});\n'); } (Replace...

posted @ Friday, December 29, 2006 3:17 PM | Feedback (0)

MonoRail & Ajax Generators

I mentioned that MonoRail recently aquired Ajax Generators. The generators a are different from normal templates, because they do not generate html, but rather modify the page that was already rendered. It will be easier to exaplain with an example. Let us take the simple example of paging a grid without a full post back, shall we?  By the way, this turned out to be a lot more focused at the WebForms than I intended, more on that later. Here is the backend of this demo: ...

posted @ Friday, December 29, 2006 12:22 PM | Feedback (2)

MonoRail, Active Record & Repository<T> Sample Application

Since I was asked, here is a demo application for using Active Record and Repository<T>.  Please note that this is an internal application that I use to merely test some ideas, so it is a bit rough, and there isn't any real functionality. The more interesting stuff for ActiveRecord & Repository<T> can be found in the FaqController. The entities are in Exesto.Model assembly, with all the usual attributes. ...

posted @ Wednesday, December 27, 2006 11:31 PM | Feedback (3)

MonoRail Applications: Testability Expectations

Scott's has suggested that I post about the different approaches to testability in MonoRail vs. other MVC implementations. Specifically, this was caused by Scott's post about MonoRail, and a concern he raised about MonoRail and testability:I haven't seen much Model-View-Presenter framework stuff in MonoRail, but I might have missed it.  I'd prefer to not have to loose the testability that comes with the pattern At first, I really couldn't see how he got to this conclution, but after a short email discussion, I think that I can see how he got this idea. And...

posted @ Monday, December 11, 2006 8:36 PM | Feedback (7)

Building Reusable UI Components In MonoRail

I have talked recently about the problems with 3rd party controls and I made the statement that most of the time, I would want to do this on my own, since figuring out how to get to where I want with a 3rd party control often takes as much time as developing the functionality myself. Scott Bellware commented on this post, asking how to get this functionality in MonoRail. Here is a simple implementation of a grid ViewComponent in MonoRail. It supports header / footer (which the GridView doesn't), empty template, alternating rows schemes,...

posted @ Sunday, December 10, 2006 12:03 AM | Feedback (3)

Brail "new" feature, component sections...

I call it a "new" feature because it is something that the NVelocity view engine supports for quite some time. The basic idea is to allow this type of code: <?brail component BasicGridComponent, {"source": contacts}: ...

posted @ Saturday, December 09, 2006 10:37 PM | Feedback (0)

Pitching Castle

As I mentioned, there is not a very interesting discussion on the Castle Developer mailing list. One of the topics that just came up is evangelizing Castle to the community. I think that the main problem of Castle is that it help solves the problems that you have after you finished 30% of the project. That is when you start discoverring the limits of the stuff that MS is preaching. It takes prior experiance with this pain to make the trade off visible. I know that in the past I have talked about...

posted @ Friday, December 08, 2006 6:48 PM | Feedback (5)

NHibernate Query Analayzer 1.2 Beta: Now With Active Record Support

There is a new build of NQA out, this time it works against (and only against, sorry) NHibernate 1.2 Beta 2. This time I also added support for Active Record. All you need to do is add the Active Record assembly to your project, add the app.config, and you are set. The only requirement is that the Active Record configuration section will be named "activerecord". Now you should be able to execute queries against your objects directly. This release is marked as beta, since I have not yet been able...

posted @ Thursday, November 23, 2006 4:45 AM | Feedback (2)

Demo Code for Castle Forums Demo App

I figured that no one would find the link to the code if I just put it in the end (11 pages for a single post, wow!), so here it is. You can get the sources here. Have fun!

posted @ Saturday, November 04, 2006 5:10 PM | Feedback (2)

Building Applications Using Castle RC2: Part II

Last time I left we had a working data access layer, based on Active Record, as well as a scaffolding for editing users. We used TDD to drive the functionality of the application, and I intend to keep doing it this way while developing the functionality of the site itself. Before we start by building the initial list of tests, let us consider what we want to achieve... We want to have a forum system, so diplaying the forums, adding and browsing messages is very important, but managing users...

posted @ Saturday, November 04, 2006 5:02 PM | Feedback (2)

What I find exciting, part II

I am not sure if I should feel this way, but I just finished writing a paged table in MonoRail, and that brought a complete sense of satisfaction. No, it isn't a major techincal challange. :-) It is just that I know,all the up and all the way down, what is going on, and I wholly approve. More and more I find how important it is to control as much as possible of the stack as possible. If I try to constract the code required to handle the full "get from the database,...

posted @ Saturday, November 04, 2006 3:29 AM | Feedback (0)

What should I use, NHiberante or Active Record?!

I was asked this several times lately, and it is time to try to make a more coherent statement about my thought in this matter. Active Record is a wrapper around NHibernate, which aims to make it easier to work with. The main benefit, in my opinon, is the time it takes to get a working entity from each. In NHibernate, you need to create the XML file (sorry Pierre, if I write attributes, they are the ActiveRecord ones :-) ), which can take more time than just slapping an...

posted @ Thursday, November 02, 2006 6:34 AM | Feedback (11)

Building Applications Using Castle RC2: Part I

Well, now that Castle RC2 is out, let us see what this release can do for us, shall we? After my recent talk, I got forums heavy on my mind, so let us build one. You can get the release here. I suggest that you would get the MSI installer. After installing the MSI, open Visual Studio and create a new project, you should see this screen: Choose Castle ActiveRecord Project and name the project "Castle.Forums.Model", name the solution (last text box) "Castle.Forums". Note:...

posted @ Wednesday, November 01, 2006 10:29 PM | Feedback (15)

Castle Release Candidate 2 & the new Castle Stronghold

This release is not so much about new features (although there are quite a few of those there) but about making the whole project a whole lot more mature. This include stuff like: An MSI installer for Castle, so you just point & click your way through it. Project templates for Visual Studio, make it much easier to start a new project. ...

posted @ Wednesday, November 01, 2006 8:07 PM | Feedback (0)

Code and Presentation from my lecture yesterday...

Can be found here. The code include all the dependencies that you need to build the project and start playing. Have fun...

posted @ Tuesday, October 31, 2006 6:03 PM | Feedback (1)

Bringing it all together: Even More Magic,

So, I had done a couple of fairly cool stuff recently, but it is all in seperated pieces, let us try to bring them together and see what we get, shall we? ProjectionQuery<User> query =        new ProjectionQuery<User>(Where.User.Name.Like("Ayende", MatchMode.Start), ...

posted @ Monday, October 30, 2006 7:11 AM | Feedback (6)

Projections Support In Active Record

Ken, this post if for you... So, I have been a busy implementing crazy generics stuff and I can show you this: public class ProjectionQuery<ARType> : ProjectionQuery<ARType, object[]> Neat class, isn't it?Please not that this is not the same class that I shows here, that class has been renamed ScalarProjectionQuery, since it better fits its duy. What can you do with it? Well, things like this: ...

posted @ Monday, October 30, 2006 12:28 AM | Feedback (0)

NHibernate Query Generator 1.7

Well, it is certainly an interesting release. This release contains very little code of mine, mainly minor adaptations of two wonderful patches that were sent to me. The first by Bas Jansen - which added inheritance detection from the mapping files. The second by Adam Tybor - which added support for projections and group by. Me, I just fixed a stupid bug by yours truly that would refuse to recognize exe...

posted @ Sunday, October 29, 2006 11:42 PM | Feedback (3)

Projections and Imports in Active Record

Ken Egozi talks about Projections and Imports in Active Record and he asks a couple of questions about it. Imports attribute poorly named: The Imports attribute is used to let NHibernate knows that it should recognize this class with a different name. Considerring the Java heritage of NHibernate, it is not surprising that it is using "import" to do this. In may be better if you could think about it as the eqiulent of: ...

posted @ Monday, October 09, 2006 7:12 AM | Feedback (0)

Bringing Active Record and NHibernate Query Generator Together

This time, I am going to try to do it without commentry. The next post is where all the fun will begin. NHibernate Query Generator has been updated so it could work with Active Record as well. The way it works is simple, point it at an Active Record assembly, and it will spit out the generated query files. Usage: NHibernate.Query.Generator <cs or vb> asssembly.dll <output-dir> It supports generating C#...

posted @ Saturday, October 07, 2006 5:55 PM | Feedback (0)

Active Record Rocks!

I have been head down in NHibernate for the last several months, and as a result, I think that I started to miss just how enabling Active Record really is. This weekend I have been working on with it with a venegance, and I love it. The NHibernate 1.2 integration is really important, because it allows to infer even more stuff! Allow me to present, in all its glory, the amount of stuff needed to make a class persistent: The collapsed properties merely hide the get/set...

posted @ Saturday, October 07, 2006 4:52 PM | Feedback (3)

Reviewing Active Writer (Preview)

Active Writer is a DSL to design / generate Active Record classes. It is still a preview, but I have to say that after I played with it a bit, I am very impressed. Not stoned cold stunned, mind you, but the potential is definately there. I just emailed Gokhan my detailed impressions, and my #1 complaint was "I can do bulk data entry with this easily". When such a techincal product gets to the point that accessibility issue is the first thing that comes to mind, I know that quite a bit...

posted @ Thursday, October 05, 2006 9:59 PM | Feedback (0)

For the adventerous sort: Active Record + NHibernate 1.2

I branched Active Record to move it to NHibernate 1.2, because of some needed features from NHibernate 1.2 that simply do not exist in NHibernate 1.0.2. The branch at the moment should handle generics natively and easily, so you should be able to do this: [ HasMany] public ISet<Post> Posts { ... } And Active Record would figure out all the rest. (Although it is probably recommended to give it at least...

posted @ Tuesday, October 03, 2006 6:24 AM | Feedback (2)

Brail Breaking Change: Removing the code markers

Just read this post, talking about a problem with generating valid XML for IE using Brail. The issue is that Brail considers <? ?> as code blocks markers, thus completely disabling support for xml processing instructions. This is a breaking change in Brail, but I feel that the reason for removing them is strong enough to do so. If you have got Brail code that uses <? ?>, you need to replace it to either <% %> (not recommended) or <?brail ?> (recommended, valid XML). If this is a really big issue...

posted @ Wednesday, September 20, 2006 10:27 PM | Feedback (2)

More On Binsor: Natrual Component References

Well, I just added the last piece in what I consider the major features to Binsor, which is component references. I'm a big fan of decorators and chains of responsabilities, which mean that I tend to create a lot of references between objects. In Binsor, it is as natural as this: import Rhino.Commons ...

posted @ Saturday, September 16, 2006 6:07 AM | Feedback (2)

Introducting Binsor: The Boo DSL For Windsor

On the on-going battle between yours truly and XML, there has been a score on the good side! I just finished implementing most of the usable functionality in Binsor, which is a Boo DSL* that is directed at configuring Windsor. Before I get into the details, take a look at the most minimal xml configuration possible for Windsor: <?xml version="1.0" encoding="utf-8" ?> ...

posted @ Saturday, September 16, 2006 5:09 AM | Feedback (2)

I want one of those: Active Writer - VS Designer for Active Record

Check out the pretty pictures! Even better information at the source. Gokhan Altinoren has done some tremendous work there. Can't wait to get the bits.

posted @ Saturday, August 19, 2006 1:54 PM | Feedback (0)

Bill Pierce On Windsor

Bill has a couple of interesting posts about using Windsor as the basis for an MVP framework for ASP.Net MVP Framework UserControl Component Activation in Castle MicroKernel

posted @ Friday, August 18, 2006 11:03 AM | Feedback (0)

Castle And The Open/Close principal

Recently I have been trying to use Castle Windsor to make me a cup of coffee. So far I managed to gray screen the coffee machine, but I am okay with this limitation, since it is just about the only thing that I can't do with it. The scenario, I have a set of similar services that I want to load from configuration. They all implement the same class, but have different configuration, here is a sample:public WebService(string url, DateTime start, DateTime end) My first attempt to solve this issue was with this configuration: ...

posted @ Sunday, August 13, 2006 8:41 PM | Feedback (0)

Sanity Checks: The Active Record Version

Following my NHibernate Sanity Check, here is the Active Record version: public class AR_Sanity_Checks : ActiveRecordModel {     public static void DoSanityCheck() ...

posted @ Wednesday, August 09, 2006 7:46 PM | Feedback (1)

If a tree falls in a forest and there is no one there to hear it fall does it make a noise?

According to my code, it doesn't. Here is the scenario, the scenario is supporting on the fly view updates for Brail. Recent changes in MonoRail meant that loading the view is now the responsability of the framework, and not the responsability of the view engine. This, however, presented a problem. Brail's view are compiled classes, but I want to allow edit & refresh cycles, so I can't force the develop to restart the application every time a view change. So far, I handled it with a FileSystemWatcher that took care of...

posted @ Saturday, June 17, 2006 7:19 PM | Feedback (3)

Castle's Continious Integration

In due time, and after some difficulities due to annoying mail servers, Castle now has a Continious Integration process that works. :-) You can see the daily builds here: http://castleproject.org/~ayende/

posted @ Tuesday, June 13, 2006 5:29 AM | Feedback (0)

Castle And Bicycle Riding

A while ago I was trying to explain the benefits of Castle to developers, and I just couldn't get through. It is pretty easy to explain the benefits of using Active Record, but I had a hard time explaining MonoRail and Inversion Of Control. Here is my elevator speach for MonoRail:MonoRail is RAD MVC framework built on ASP.Net that supports the Front Controller pattern and force strict seperation between UI and Business Logic. I got into a lot of problems with this, since it doesn't convey the benefits to the people I am...

posted @ Friday, March 31, 2006 10:21 PM | Feedback (1)

The Value Of Reuse

Hammet has posted a comment from his article about Castle. The comment basically talks about reuse in NVelocity, one of the MonoRail's View Engines. NVelocity is not a full fledge programming language, and that means that you can't do some things that you can do with a full langauge (at least not easily). The end result is that you really don't want to write TheUberGrid in NVelocity, so you may end up writing a one-off, per scenario template, instead of a general control that can accept anything you throws at it and...

posted @ Monday, March 13, 2006 10:40 PM | Feedback (0)

Casle Demo App: Midway Summary

I tried to get an overview of all the posts I wrote so far about Castle Demo App, and I got a little lost, and I guess that this isn't only my problem, so I put up a list of all the posts in the subject. I must say that I was very surprised to see that I posted so much about this (and I can think of several more topics that I want to post about). So, without much further ado, here is the list as of right now: ...

posted @ Sunday, March 05, 2006 6:26 AM | Feedback (3)

MonoRail, MVC and ASP.Net

I run into this post, comparing MonoRail and ASP.Net 2.0, which I thought was interesting. I'll start by saying that I mostly disagree with the conclutions. Rodel is making a mistake by comparing the feature sets. The difference between ASP.Net & MonoRail is not something that you can break down by features. They are mostly comparable anyway. The issue are with the level of control, the amount of abstraction you have and the programming model you are working with. The problem with ASP.Net is when you start to deal with complexity. For simple...

posted @ Friday, March 03, 2006 9:57 AM | Feedback (1)

Castle Demo App: ViewComponents, Security, Filters and Friends

In this post, I'm going to explain how to secure the administration section of the site. Since the pages in our application do not map to a directory structure on the server, the ASP.Net default security isn't going to help us (I'm not entirely sure about this, though). Because of the way that the MonoRail is built, we often can make security decisions about the all the actions in a controller. Such is the case with the AdminController, only administrators should be able to access this page. Currently, we don't have the...

posted @ Friday, March 03, 2006 2:16 AM | Feedback (1)

Castle Demo App: Code Update

I've updated the code that is avialable. Now I also bundle the parts of Castle that you need in order to run it, so you will have easier time build and testing this code. All the binaries you need can be found in the Deps directory, you'll need to change the references to point to that directory. You will also need SQL Server or SQL Express for the database, as well as .Net 2.0. You can get the new release here (1.2Mb).

posted @ Wednesday, March 01, 2006 2:27 AM | Feedback (0)

Castle Demo App: Queries and Foreign Keys

Okay, one thing that I'm sure that you have noticed is that we have a bug in the DeleteUser method. The problem is that we don't check for foreign keys violations, and that will cause problems down the road (someone tries to delete a user that is assigned to a project, and he suddenly stares at an error page asking "But what did I do?" Let's try to prevent it before we get a bug report about it. First, we need to make a couple of policy decsisions. There are two ways that...

posted @ Wednesday, March 01, 2006 2:12 AM | Feedback (1)

Castle Demo App: Complex Interactions

Castle Demo App: Complex Interactions We have CRUD operations for users and projects. The next step is to add a way to assign / remove users from a project. We can do it both for users and projects, but this is just overly complex. We're going to allow a project edit page to add or remove users, and that is all. I'll be the first to admit that I'm not very good with JavaScript, and I've practically no knowledge in the Ajax capabilities of MonoRail (which are based on Prototype library). I'm just going to...

posted @ Tuesday, February 28, 2006 11:39 PM | Feedback (1)

Castle Demo App: CRUD Operations on Projects

I thought about leaving the CRUD for Projects for the readers, but when I started to implement it myself, I realized that there were several things here that I hand't explained. As a quick note, I made some modifications to the code, to structure it better, there shouldn't be any changes to functionality, but I added a few utility functions and made some of the views more generalized. In general, those changes are from having NoSuchUser and NoSuchProject views to having a single NoSuchObject view, nothing more. Okay, let's talk about projects. A project...

posted @ Saturday, February 25, 2006 11:23 PM | Feedback (1)

Brail Update: Nullable Parameters

Okay, so I run into a couple of problems with NUnit versioning, but it's here. I added support for nullable parameters in Brail, so now you can do:${?user} And if the user has not been set, it'll return null. You can get the latest bits here. I won't publish a Castle Demo App today, but I'll certainly attempt to use the new feature tomorrow in the Ajax part.

posted @ Friday, February 24, 2006 2:02 AM | Feedback (0)

Castle Demo App: Let There Be A New User

Before we start with our regular content, a couple of bug fixes, the ValidateLength on the Name and Email properties of the User class should looks like this:  [ ValidateLength(0,50)] Specifying just one number means the exact length of the string. Okay, so far we have seen how to edit users and then save them to the database, but we haven't seen yet how to actually create the users. For myself, I think...

posted @ Wednesday, February 22, 2006 10:59 PM | Feedback (1)

Brail Update

Okay, I got around (finally!) to work a little with Brail, and the end result is that there were a plenty of improvements: Removed useless error handling from Brail, now you'll get the noraml ASP.Net Yellow Screen Of Death on errors. More consistent with the rest of the framework. I can't really understand what I was thinking when I added this. Added support for <?brail ?> tags for Brail, so it can be valid XML...

posted @ Wednesday, February 22, 2006 12:22 AM | Feedback (0)

Castle Demo App: Updating our Users

Okay, here we go again. One thing that I forgot to mention in the last post is how you access the pages you created. You simply need to use the following URLs: http://localhost:8080/admin/users.rails http://localhost:8080/admin/projects.rails Before we continue, a couple of words. When I started this series, I had the intention to make it possible to use this with the latest...

posted @ Wednesday, February 22, 2006 12:13 AM | Feedback (1)

Castle Demo App: Getting serious, the first real page

Okay, so far we played around with MonoRail, and I, at least, has quite a bit of fun. Just to point something out before we carry on: While MonoRail has strong scaffolding capabilities (the ability to generate pages for CRUD operations automatically), I don't like the idea of using them, we're going to build everything from scratch. The first thing that we need to do is to add is some wrapper HTML so our pages will not be HTML fragements (like the previous one). We do it by specifying a layout. Layouts...

posted @ Monday, February 20, 2006 10:22 PM | Feedback (1)

Castle Demo App: MonoRail At A Glance

Okay, so far we saw that MonoRail can be used to serve static files just as well as a 1993 Gopher Server. Considerring that Gopher is dead, we might want to add some stuff to our application. But allow me to give you a very short overview of the way MonoRail works. MonoRail has Controllers and Views. A controller is a normal class that inherit from the Castle.MonoRail.Framework.Controller class. When a request comes in, MonoRail analyze the URL and dispatch the request to the proper controller method. This is important, unlike in...

posted @ Monday, February 20, 2006 7:57 PM | Feedback (2)

Castle Demo App: The First MonoRail Page

So we finally made it to actually talk about MonoRail. :-) Just to set the expectations straight, we are going to create a web site for to the Mythical Bug Tracker application, using MonoRail and Brail. It's going be functional, but it is not going to look pretty. I'm not a designer, and I'm not going to waste my time talking about CSS and color coordination when you can go to someone who actually knows something about them and learn something useful. In two sentences, what is MonoRail? MonoRail...

posted @ Monday, February 20, 2006 7:56 PM | Feedback (5)

Found VS.Net & FileSystemWatcher problem

Like I said, I had a problem with the FileSystemWatcher not picking up the changes that VS.Net was doing. Justin suggested playing with the NotifyFilter property, and it worked! The issue turned out to be that VS.Net doesn't write to the file, but rather copy a temporary file that it keeps on the side over the file. All I had to do was to add the NotifyFilters.CreationTime and it worked. I noticed the problem while working with Brail, and I'll commit the stuff tonight. It does mean that to be able to really play with my Castle Demo App, you'll need to use...

posted @ Monday, February 20, 2006 3:36 PM | Feedback (0)

Castle Demo App: Many To Many Relations

We have users and we have bugs, but it is still not enough to create a good application, we need to group the bugs to projects, and we need to be able to assign users to projects. So, without further ado, let’s write the Project class. What do we need to have in a project? The project name, the default assignee (remember that all bugs are assigned always.), the bugs in the project and the users working on it. With that said, let’s start with building a simple Project class. ...

posted @ Sunday, February 19, 2006 11:29 PM | Feedback (1)

Castle Demo App: Lazy Loading and Scopes

First, a bug correction, in an earlier post I said that the user's OpenBugs property should be initalized exactly the same as AssignedBugs, this is a mistake, it should be initialized like this: _openBugs = new EntitySet<Bug>(); The reason for this is that addition/removal to the OpenBugs shouldn't affect the AssignedBugs collection, which is what I accidently did. Okay, so now we have Users and Bugs (they...

posted @ Sunday, February 19, 2006 8:21 AM | Feedback (1)

Castle Demo App: Active Record Relations

For this part, I'm going to use NHibernate.Generics, which is an extention to NHibernate that allows to use generic collections for relationship between classes. You need to download it from here and add a reference to: NHibernate.Generics.dll Iesi.Collections.dll Okay, so we have a User, now we need a Bug class, so we can store the information about our bugs. I'm going to skip the parts that I've already covered and move to...

posted @ Friday, February 17, 2006 11:17 PM | Feedback (4)

Castle Demo App: Getting Started With Active Record

A few words about Active Record: Active Record is a wrapper around NHibernate, which is an Object Relational Mapping for .Net. I'm not going to explain how things works in this post, just how to use them. If you're going to be a serious Active Record user, I'm strongly recommend that you'll learn how to use NHibernate. You'll appriciate how much Active Record does for you much more afterward. Setting The Environment: Assuming that you already have the Castle's binaries on your machine, let's start by creating a class...

posted @ Friday, February 17, 2006 9:40 PM | Feedback (6)

Building a full blown application with Castle

Recently I'd a couple of IM conversations with people who wants to build applications with MonoRail & Brail, but there isn't any useful sample application for that. There is Castle's Samples, but they don't cover Brail, and there doesn't seem to be a step-by-step tutorial for creating a full application using Castle. The Pet Store example covers most of Castle, and it certainly helps, but some people like to read tutorials better than look at the code. I'm going to try to...

posted @ Friday, February 17, 2006 9:05 PM | Feedback (1)

Castle Samples

I just realized that there is a wealth of sample applications for all the parts of Castle. You can view those sample applications online here (or by just downloading the source and looking in the Samples directory). I tend to just read the Castle source until I find the right answer, I never thought about looking at the samples :-) There is quite a lot of information there.

posted @ Friday, February 17, 2006 8:04 PM | Feedback (0)

Castle has a new home page

My favoriate open source projects just got a new design for the web site.It's looking cool!  

posted @ Monday, January 02, 2006 6:16 AM | Feedback (0)

Brail is Kicking one more :-)

For the last 20 days or so, Brail wasn't part of the Castle's build, beause of the changes in how testing is done. It took me some time, mainly because I couldn't really devote any real length time to this. So now Brail's tests support the Castle.MonoRail.TestSupport, and I can investigate some interesting changes that were made in both Boo and the view engine for MonoRail.

posted @ Friday, October 28, 2005 11:43 PM | Feedback (0)

Correnting My Mistake: Static Methods & Child Classes

In a previous post I said that you can't "inherit" static methods from your parent class. Apperantly I was mistaken. The following code works on both 1.1 & 2.0: public class Parent {  public static void Static()  {  } } public class Child : Parent { ...

posted @ Friday, October 07, 2005 3:32 PM | Feedback (1)

Static Generic Class

Now this is a cool feature I just discovered. I don't think that this is the true name, but it describe what it does. I'm currently trying to give ActiveRecord a more .Net 2.0 interface, and I'm currently concentrating on the static methods of the ActiveRecordBase class. The current best practice for ActiveRecord is to create a type safe wrapper on your class when you're inheriting from ActiveRecordBase. The reasoning is very simple: Blog []blogs = Blog.FindAll(); ...

posted @ Wednesday, October 05, 2005 2:26 PM | Feedback (3)

Brail Beta 2

I’m very pleased to announce that Brail now uses the white space agnostic derivative of Boo, which makes for much better syntax when mixing with the web. Check out this syntax to use a block component:   <% component MyViewComponentWithBody: %> html content <% end %> A lot of thanks to Rodrigo, for creating Boo in the first...

posted @ Saturday, October 01, 2005 9:58 PM | Feedback (0)

MonoRail makes life boring...

How can I take pride of solving hard problems when MonoRail takes them all away? I'm trying to build a sample bug tracking system. The problem is that I'm using MonoRail, which means that I'm in either of two states: The explorer state - where I just surf MonoRail code and discover all sorts of cool things it can do for me. This is the fun part. The implementation state - where I try...

posted @ Saturday, September 03, 2005 10:12 PM | Feedback (3)

Boo & Active Record makes for strange bedfellows

Just check out the syntax to declare a property that is also a primary key: [Boo.Lang.Property(UserId, Attributes:[PrimaryKey(PrimaryKeyType.Native, "id")])] userId as int The probably proper way to do it would be to ignore the magic Boo.Lang.Property attribute and do it the old fashion way: userId as int ...

posted @ Friday, September 02, 2005 5:44 PM | Feedback (4)

Brail & Castle Project

Brail is now officially a part of the Castle Project :-) I added it to the source repositoy yesterday and today I've finished (with a lot of help from the Castle community). The documentation is now located here. The source repository is here.  One interesting thing about the Castle community, they really do practice shared source and collective ownership. I still need to get used to it, I think.

posted @ Thursday, September 01, 2005 10:07 PM | Feedback (0)

I'm a Castle Commiter!

I've been voted as a commiter for the Castle Project. You might recall how excited how I was when a patch I made was accepted for Catle, so you can imagine how I feel right now about it. :-D Along with this there is another big issue: Brail has been accepted into Castle's MonoRail and will now be available as part of their services. So I would finally have a public Subversion server that I can point people to. I'm going to update everything in the site and upload the repository tomorrow. I...

posted @ Tuesday, August 30, 2005 9:11 PM | Feedback (3)