Review: S#arp Lite, a Lightweight Framework for Delivering ASP.NET MVC Solutions (Part 1)
Join the DZone community and get the full member experience.
Join For Freethis is a review of the s#arp lite project , the version from nov 4, 2011.
i was asked to review this project a long time ago, but i never got around to it. i had some time and i decided that i might take a look and see how it goes. i don’t like the s#arp arch project, because it seems too complex and heavy weight for the purpose.
the project comes with a sample application, which is good, because it is easy to see how the framework is intended to be used. unfortunately, it is yet another online store example, i am getting heartily sick of that. on the other hand, it is a fairly simple model and easy to understand, so i grok why this keeps getting chosen.
review rule, i look at the code . if i wanted to deal with documentation, i would write some for our products. i am doing this because i find it fun to look at other people’s code. so skip any comments about “if you read the docs…”.
we start from the project structure:
i am not sure if i like it, i don’t know if i agree that all of those splits are needed, but this is well within reasonable limits, so i am willing to let it slide on the grounds that this is personal taste more than anything else. looking at the dependencies, we see:
the init project contains two files, which are responsible for… well, starting up, it seems. again, i don’t see any reason why this would be a separate project, but that is about it so far.
next in line is the nhibernateprovider project, in this case, we have the following:
so far, i am cautiously optimistic. all of the files / folders marked with red are actually all about setting nhibernate up , not about hiding it. but then we get to the read me file, which reads in part:
this folder contains any concrete, nhibernate-specific query classes.
there should only be classes in here for any respective query *interfaces* found in
/mystore.domain/queries/this folder will usually be empty except for very exceptive cases.
this is… interesting. can’t say whatever i agree or not yet. looking at the queryforproductordersummaries, we see:
note the comment, there are better ways to do it, but we demonstrate an ugly way, and how to nicely encapsulate it.
that is enough for now, i think, next post, i’ll touch on the actual model…
Published at DZone with permission of Oren Eini, DZone MVB. See the original article here.
Opinions expressed by DZone contributors are their own.
Comments