While searching for design pattern开发者_Python百科 to help improve a C# application performance, I came across the fast lane reader pattern which is based on data access object pattern. It is however mentioned about performance improvement in Java sun website only.
Can someone please tell if the performance benefit applies to C# too, and if there is example?
The essence of the pattern appears to be:
A fast lane reader component directly accesses persistent data using JDBCTM components, instead of using entity beans.
Since C# doesn't use entity beans, this would seem like a Java only optimization.
In general, however, accessing the database (or other persistence store) directly would be faster than using an intermediary object (or set of objects).
Seing that the article you are linking to ends with
Copyright © 2002 Sun Microsystems, Inc. All Rights Reserved.
I have my doubts this information still applies, it appears more like a workaround for limitations of the then-standard approach to persistence in Java enterprise applications. Java enterprise frameworks have changed a lot during these 9 years, and it may very well be that whatever limitation justified this approach has long disappeared.
If you have an actual performance problem to solve, I recommend the time-honoured approach of
- pinpointing your performance bottleneck by means of profiling,
- understanding why it's slow
- making it fast
In my experience, this is more efficient than googling and trying to follow outdated documentation written for another programming language and framework.
All this is saying is that instead of using entity beans for read only data selection use plain old JDBC direct access methods.
By using the Fast Lane Reader pattern, CatalogHelper can improve performance by avoiding using enterprise beans.
So for read only selects use the native database methods in your C# code. I am not sure if c# has concepts of entity beans.
精彩评论