I do not understand how we use reflection to the minimum in Server Side DataPortal.
Is it not true that we use "CreateBusinessObject" to create the enclosing business object for the Criteria object and then use "CallMethod" to invoke the methods.
Both these methods use reflection. And both these methods are called pretty frequently.
There are two reflection calls. Consider that each one is a method call that would take perhaps 5 nanoseconds. Due to the overhead of reflection they each now take 100 ns - maybe less.
Now consider how often, in a typical application, the DataPortal is called. It is called to retrieve data, then the user interacts with the data for some time (seconds if not minutes) and eventually saves the data. Here's an article spelling out how server interactions work.
Over a multi-second, if not multi-minute window of time you have made two DataPortal calls, and thus 4 reflection calls. Say your average user operation takes 60 seconds. So in a 60 second window you have reflection overhead of 380 ns. The overhead is .0006%, which I view as pretty inconsequential.
You can probably switch from a For..Each statement to a For..Next statement in a couple spots in your code and recover these 380 ns plus some… After all, For..Each uses reflection (or late binding – but that’s the same thing) and no one really thinks about that at all.
A better way to do this is to run a web load tester tool against a site that has the CSLA .NET DataPortal implemented with interfaces, and one without. See what difference you get in terms of page throughput. You won't find a difference. The reason is that compared to everything else going on in a typical application, the addition of 4 reflection calls is totally immaterial.
It is this latter test that I performed when doing research for the book, and is ultimately why I used reflection. No measurable performance difference meant that I was able to opt for what I think is the better design. If there'd been a substantial performance penalty I'd have gone a different way.
When I did this same test using a reflection-based data access layer (where I loaded the object's data via reflection) there was a ~15% performance hit, so I opted to embed the ADO.NET code directly into the DataPortal_xyz methods. Perhaps not the ideal design, but performance trumped design purity in that case.
But you should feel free to do the testing yourself. Everyone's requirements are different, and perhaps your performance requirements can't be met by the current implementation.