new level of abstrction for exyus
i've reached a new level of abstraction for the exyus RESTful framework. to this point, i've worked with single-depth-level resource definitions for data handling: /category/{id}
, /weblog/{id}
, etc. but now, i need to move to the next stage - added depth in the data-modeling of URIs: /weblog/{wid}/comments/{cid}
for example. it's simple on the surface, but i want to make it as easy as possible to define nested resources like this. that means minimal coding, and the proper level of abstraction in the code.
i have a number of things to deal with here:
- matching the URI pattern to the proper class instance
- parsing the URI within the code segments for proper validation
- including the properly parsed URI segments in the execution of the HTTP method code
- handling the URI segments in constructing the cache-clearing details of the code
some of this is pretty straight-forward. the URI pattern matching is basic. providing the URI segments to the XML and XSLT engines is also pretty easy. i already have a tokenizer service that can parse placeholders in the XML and provide proper params to the XSLT engine. but handling them properly within the code execution and the cache-clearing portions of the code is a bit trickier.
so far, i've 'hard-coded' the resource handlers to work with a single {id}
. but now i need two. and will quite possibly need three or four in the future. what i need is code that can handle a param array. i probably also need to look into named arguments for regexp. C# has this already and i just need to brush up on their use.
so there's some pretty important stuff here. when i get this done, i'll have a powerful resource-mapping capability built into the exyus framework. and that will be sweet!