OpenRasta status update
This entry may be outdated. For the latest updates on openrasta, see www.openrasta.com.
I’ll be adding the proper headers tomorrow and release this version. It’s getting to a point where it can start marching to beta status openly. Here’s the change log since the last status update.
IO
- new stream chain infrastructure for accurate content length discovery
Codecs don’t have to deal with knowing the content-length anymore, it’s all done by wrapping the stream with one that tracks the Content-Length accurately. - Multipart support
Support is in, and for the most part there is no more issues with asp.net taking over. The next step is to completely bypass asp.net and use the IHttpWorkerRequest directly. There’s preliminary support for that, but I want to have a clean-cut separation between streamed and buffered modes, which means implementing bulk transfer. Support is only buffered at the moment.
At the IO level, you’ll find the goods in BoundaryStreamReader and BoundaryStreamWriter, as well as the new HistoryStream class. The problem with potentially non-seekable streams when reading boundaries is that you may read past the end of the boundary and need to go back… But It’s not seekable! HistoryStream keeps a fixed buffer of the last couple of reads and let you seek within that.
One level up, the MultipartReader and MultipartWriter classes are the ones able to give you IHttpEntity objects from / to your streams.
Configuration
- new configuration syntax
Everything is now on ResourceSpace. I didn’t like the focus on URIs the previous versions had. Furthermore, they’re all attached to an IHas singleton, so you can add your own configuration language from the top-level ResourceSpace.Has.new demo site
This should hopefully be used in the future to run some Watin automated tests. - Configuration auto-wireup
You can either do the configuration in your global.asax or use a class at the root of your app. You used to need IRastaConfiguration (how confusing), it’s now called IConfigurationSource
Infrastructure
- new dependency resolver flow
No more direct access to the IDependencyResolver. The framework treats the internal one and any external one you may want to use (aka your favourite container) equally. Fixed a bunch of bugs when registering singleton instances in the internal container. - Error infrastructure
The pipeline has been modified to be able to go back and restart the processing. That means that your error page will be subject to content-type negotiation. - Resource matching
By default, resource instances you return from your handlers are seeked as an exact match you registered. There’s an opt-out by registering a resource as AnyChildOf<Customer>, which will then match Customer and any class inheriting from it. Feedback welcome.
Refactoring
- Heavy renaming
Folders now have the proper names, there should not be anything left with the Rasta moniker. Lot of interfaces and classes have been updated to reflect the http spec a bit better (IHttpEntity, IHttpMessage…) or to be more meaningful (ICommunicationContext replaces IRastaContext, IRequest and IResponse are shorter than the previous interface names). All the asp.net specific implementations have been renamed to AspNetXxx. - Http handlers and modules
The http handler is now OpenRastaHandler. It may be changed to optimize the code path for IIS7 integrated mode when available. The module is now OpenRastaModule.
Bug fixes
- Integration tests
Just fixed the infrastrucutre to copy web.config automatically to the correct folder. The default destination is now in a separate folder. Other projects will follow soon. - Removing god objects
RastaConfiguration used to be a big mammoth with way too much happening on it. It’s been split between DependencyManager (a service locator for the few repositories being used) and OpenRastaConfiguration (that exposes only the Manual property).
All the same, IRequest and IResponse are much leaner than they used to be, with all the implementation details moved to the PipelineData object. TODO: Auto-register IRequest and IResponse in the container so you don’t need the dependency on ICommunicationContext.
Codecs
- Content negotiation and media types
I thought I had this one fairly nailed-out, turned-out I was wrong. The mime types are now prioritized on the server, so that when the client asks for */* (<cough>IE<cough>), the mime type with the highest quality is selected. Reprioritized both the webforms codec and the html error page codec to prefer text/html over application/xhtml+xml.
HttpContentType is now called MediaType, which should solve the confusion between the ContentType header and what a media type is.
TODO: Write the tests to ensure the Vary header is appended correctly.
TODO: Have a way for the codec to get involved during the selection of the correct mime type. This would let the webforms engine detect the doctype and set the content-type appropriately. - Error codes
There’s some new properties on OperationResult to detect client and server errors. This is used to automatically pad the returned representation, as IE (again) hides anything returned with a size less than 512 bytes.
Webforms engine
- Webforms url rewriting
I’ve now re-enabled the capability to register a webforms page at a fixed Uri with new extension methods, associated with a behind-the-scene handler and some changes to the codec. - Markup
I’ve started refactoring the extension methods used for generating html content, which you’ll find in OpenRasta.Markup. There should be much more tomorrow. - Uri creation
IUriResolver has been simplified, and a lot of noise implementation is now done with extension methods. Also a work in progress so expect more unit tests in the next few days. And you can now automatically generate URIs from any object by using myCustomer.CreateUri(); Sweet. - Plain text codec
I thought it was more than time to bring plain-text back on the scene. So now you have a text/plain codec out of the box. - Silverlight
Work on this is suspended for now until we reach beta 1.
What’s missing
- For both the MultipartFormDataCodec and the ApplicationXWwwUrlFormEncodedCodec, we still haven’t gained back the support for complex types. This is coming back tomorrow, with a common code-base. That should be the end of ReflectionHelper, as the code gets migrated (and unit-tested).
- The license header files, which will also be there tomorrow. Once it’s done I’ll give the svn and trac addresses, and open the mailing list to the public :)
There you go, there’s probably a lot missing as I didn’t log everything in svn, but we’re approaching the end of the tunnel. Aim is to be feature-complete for beta 1 in a month time. Patches are welcome :)