Service Factory [part 1]
Service Factory has been released at the end of July, but only today i had time to have take a decent look at it.
Service is a GAT prescritive guidance, to help people write Web Services (ASMX, there is a separate factory for WCF) quickly and consistently in a manner that is considered a best practice, accordingly to the Microsoft Patterns & Practices Group (PAG)
So far i liked it, not impressive (yet :-)), but very good so far.
The code generated by the factory recipes was not unfamiliar to me, not only had i already seen some similar code & patterns some years ago in Clemens Proseware, as the code pattern is similar to the code in WCF.
This is not only a factory, for services i also has a "sub factory" to help you generate your business and data layers. Haven't tested this part though, for me a service is kind of a facade, the business logic is implemented elsewhere, but if this extra functionality is there, i won't complain.
It might make sense on smaller projects. I only took a peek, but it seems to be able to create CRUD procedures and data classes from business objects for the Data Access Layer; business entities from the database and data repository classes for the Business Entities (a separate project is created for business logic, but it's just an empty project).
The factory, divides the solution into two major blocks (split by several projects):
- Source code
- Service - This is quite big, it is worth a post on it's own. In a few days, i will describe this in another post.
- Business Components - already described it,since I'm not (at least not yet) that interested in this part i won't explored it any further for now.
- Data Access Layer - ditto
- Functional tests and Unit tests (just placeholders to promote TDD practices i guess, since no code is generated whatsoever)
- test client, a winform client to invoke the generated services, haven't tested this, but from what I've seen it allows you to call your services and show the results in a grid. (i guess it works nicely for non hierarchical or complex data types, just guessing never tried it though).
I've been studying the implementation reference in order to understand the recommended naming conventions, the code is very straightforward although it seems to have some inconsistencies between how the three provided services are implemented.
If i had to give to classify it now, i wouldn't have problems in (prematurely) classifying it as highly useful. Three years ago, i did a project where this factory would have been very useful. It would have saved me a lot of time and typing (more on that later too :-))
In a semi related recently, a weekly drop of the Web Client Factory has been recently released.
[Cross posted on www.agilior.pt/blogs/tiago.pascoal/default.aspx]