A short while back I was asked if I would be interested in reviewing Packt Publishing's ASP.NET MVC 2 Cookbook and since it was right up my alley, I accepted. So over the past 6 weeks or so, I've been reading the book as I've gotten a chance. While the book covers ASP.NET MVC 2, most of it is still quite relevant to MVC 3. If you have already gotten started with ASP.NET MVC, but are not a power user, this book is a must have in your collection. I've been using ASP.NET MVC since Guthrie first announced it and I learned a few tricks as well.

Review

It can be said that Cookbook formatted  books are becoming more popular with readers, especially those already semi-familiar with a subject. I'm a fan of them also as I feel they cut out the basic bits that a true beginner would need and start off at an intermediate level. The book covers the following:

  • Working with Views
  • Working with Actions
  • Routing
  • Master Pages
  • Working with Data in your View
  • Forms
  • Simplification of Complex Applications
  • Validation
  • Data Access
  • Application, Session, Cookies, and Caching

What I liked about the book was the use of a Dependency Injection framework, in this case StructureMap, to help ease testibility. The authors were even careful to point out that they were using it for testibility, not to switch out implementation later. What I did not like was the heavy use of ViewData within the book. Personally I try to avoid the use of ViewData unless absolutely necessary, preferring to use Strongly Typed views instead. Another thing I would've liked to seen is the use of ViewModels and FormModels. ViewModels are used to send only the data needed to the view. This does not mean sending a fully populated object graph, only the pieces of the graph that are needed. FormModels are used to deliver the data back from the view. You use this to populate new entities, load and modify existing entities, and for Validation.

Hidden Gem

The hidden gem of this book is a little known project named NBuilder. I had not heard of this project until shortly before reading the book, thanks to a tweet from a friend. The book makes heavy use of NBuilder in it's samples, especially in mocking. If you are not using NBuilder in your current testing, I would highly suggest you take a look at it. It makes adding sample data extremely simple.

Overall I really liked the book and thinks it is worthy of a spot on your bookshelf if you are working with ASP.NET MVC. Hopefully the authors will update the book to reflect changes in MVC 3.

 One request we received when NuGet first came out (as NuPack) was for Sharp Architecture to release a package. We all agreed that this would be a good way to deliver updates in the future as it meant the end user did not have to download either the source or a template just to extract the assemblies.

Well the wait is over, today we released a NuGet package for Sharp Architecture 1.9.6. The package has the following dependencies:

 

Don't worry about all of those dependencies, when you install the package, you can choose to use the -IgnoreDependencies command-line argument to only reference SharpArchitecture. 

You can find the project by using the package manager console:

And install it using the following command:

Once everything is installed, you will notice that a new folder has been created at the solution root of your Sharp Architecture folder structure.

This folder will contain the following packages in it:

I do have a couple of other packages installed, MvcScaffolding for one, so you will see some packages that are not referenced by Sharp Architecture. Please let us know if you have any problems with the package. It is very much a work in progress.

 I was recently given the opportunity to review the latest NHibernate book, NHibernate 3.0 Cookbook by Jason Dentler. If you do any NHibernate development, you need to have this book in your collection. The content is well thought out as well as organized.

I started out with NHibernate in January 2008,  kicking and screaming. Part of my issue was the use of XML everywhere, coupled with seemingly little to no documentation. Look at us now, oh have the times changed. We now have six books dedicated to nothing but NHibernate, as well as a very active mailing list. The latest book on NHibernate is NHibernate 3.0 Cookbook by Jason Dentler, published by Packt Publishing. The book includes 70 Recipes which generally build on previous recipes or earlier boiler-plate code.

 Jason does a great job with explaining what the recipe is going to do, showing the code needed for the recipe, then explaining in detail what each piece is doing. This style of writing helps users of all skill level understand easily what is happening and gets new users up and running quickly. The book starts off with the basics, but as I later found out, if your an experienced NHibernate user, you should still read these chapters as code from them will be used in later recipes. You start by creating mappings with several different technologies, ranging from Nhibernate XML files to using ConfORM. Once you've mastered mapping, you are introduced to Configuration and Schema. This again is another chapter every user should read, no matter what your experience level is with NHibernate.

 Chapters 3 through 8 cover the meat and potatoes of the NHibernate. They cover everything from Sessions and Transactions, Testing, Extending NHibernate, and using various NHibernate Contrib projects. One section I found particularly was that on Sharding Databases for performance.

 I would recommend this book for NHibernate beginners as well as experienced NHibernate users. There is enough information in the book to thoroughly cover NHibernate across all experience levels and not feel like it was targeted at only one group or the other.

The S#arp Architecture team is proud to announce the release of version 1.9.6. This version is a maintenance release to address a few short comings of the 1.9.5 release. These include:

  • Added Component registration for the Default Session Key Provider to help with multi-tenancy
  • Addressed some bad references within the Templified solution
  • Updated MvcContrib dependencies to the official release (3.0.51.0)
  • Added missing *.debug.js files to *.Web/Scripts folder 
If you've downloaded 1.9.5, please download this latest version instead. You can download the files from github: https://github.com/sharparchitecture/Sharp-Architecture/downloads
If you only need the binaries, you can download those from the location just mentioned.

 The S#arp Architecture team is proud to announce the release of version 1.9.5. This version has had the following changes:

  • Upgraded to MVC 3 RTM
  • Solution upgraded to .NET 4
  • Implementation of IDependencyResolver provided, but not implemented

This marks the last scheduled release of 1.X for S#arp Architecture. The team is working hard to get the 2.0 release out the door and we hope to have a preview of that coming soon.

With regards to IDependencyResolver, we have provided an implementation, but have not implemented it in the MVC project. There is a fatal flaw with the IDependencyResolver that makes using it with Castle Windsor not recommended. This stems from the fact that while it implements a Create method, it does not implment a Release method. While the MVC teams states the dependency resolver with call Dispose on any object that implements IDisposable that it is tracking, it does not call this on any children of that object that might have been create also. This can lead to memory leaks and poor performance. While there are ways to program around this, we do not feel that it is worth HACKING a solution to a problem that should not exist in the first place. It is our sincere hope that the MVC team will address this issue in the near future, but given the fact they have know about it since MVC 3 Preview 1, we are not holding out breath. You can read more about the issue here and here.

To download the latest version, please get it from https://github.com/sharparchitecture/Sharp-Architecture/downloads.

Packtpub has released 6 new Microsoft books and is celebrating it with Microsoft Monday. Find out more details by going to https://www.packtpub.com/article/microsoft-books

Sharp Architecture 1.9 has been released. This version upgrades Sharp Architecture to use the latest.... [Read More

 I was recently contacted by Packt Publishing in regards to reviewing their new NHibernate 3.0 cookbook written by Jason Dentler. Over the next few weeks I will begin reading and evaluating the book. My plan will be to make several posts about parts of the book as I get to them, along with one final post giving the overall review.

 I would like to thank Likesh Bhambhwani for reaching out to me and extending this offer. I look forward to reading the book and learning about the great new features in NHibernate 3.0. As most of you have heard, the next version of S#arp Architecture will be based on NHibernate 3.0.

As with most open source projects, S#arp Architecture relies on its user base to for support, ideas, bug fixes, etc. We've been very fortunate to have a passionate user base that really fosters a sense of sharing. In the past few months 3 community members in particular have stepped up to help out with code, answering questions on the group and on StackOverflow, and documentation. We have decided to offer these gents positions on the S# team.

Please join us in welcoming Geoffrey Smith, Seif Attar, and Dan Smith to the S# team.

 Geoffrey Smith

 Geoffrey offered to help out with documentation and UI. He will be joining the main S#arp Architecture team and lending a hand with the 2.0 rewrite. One of his first tasks will be to spice up the Northwind sample. If you have ideas of items you would like to see in a Kitchen sink type sample, let him know. Geoffrey is relatively new to the .NET / C# world, coming from a Java / Python background. He most recently used S#arp Architecture and Lucene.net to index and search a large document repository. As a guilty pleasure, he enjoys working with the Arduino-based ArduPilot to create fully autonomous drones.

Seif Attar

Seif will be joining us in the role of the S#arp Architecture Contrib project lead. He has been developing software for 8 years, mainly using C#. Being a Linux user and free software advocate, he was very happy to find out about the Alt.Net movement as he could finally combine his work with his sense of community. He has been using S#arp Architecture and learning from its community since early 2009. He is active on the mailing list as well as StackOverflow.

Dan Smith

Dan is joining us on the S#arp Architecture Contrib team. He is currently the lead programmer for a medical device sales and training company in Connecticut. He uses S# day to day at work along with techniques he has learned from the WCHM project using AutoMapper and MEF.

 

Both Seif and Dan will be involved with the 2.0 rewrite on the Contrib as well as the main project. We know the community will join us in welcoming them

Now that we have published our 2.0 road map, several people have asked us how are we going to get there. Simple, one step at a time.

One step at a time

We have previously blogged about Templify (here and here) being the way we are going to deliver a S#arp Architecture solution. That was step one for us, so you could say that we are already starting to deliver 2.0. Our next steps will be as follows (subject to change)

  1. Create an initial 2.0 release that includes (v1.7.X)
    1. Convert solution and projects to Visual Studio 2010
    2. Convert all projects to .NET 4.0
    3. Reorganize the solution structure for the solution template (moving to a Who Can Help Me based folder structure)
    4. Solution to use new MSBUILD based build system
    5. Package for Templify
    6. Document new Build process
    7. Add documents for Templify
  2. Create next release that includes (v1.8.X)
    1. LINQ Specifications
    2. Component composition
    3. Component registration
    4. Isolate NHibernate
  3. Create the next release (v1.8.5.X)
    1. Support for Castle 2.5
    2. Support for NH 3.0 (whether it is a GA release or not)
    3. Fluent NHiberate compiled against NH 3.0
    4. Support for MVC 3
    5. Change Validation (Data Annotations for UI, NHibernate.Validator for Model)
  4. Create the next release (v1.9.X)
    1. Convert Default Package to use Spark as its default view engine
    2. Add documentation (blogs and wiki) on how to properly setup the Spark environment
    3. Include the new Plugin architecture
    4. Add documentation (blogs and wiki) on the new Plugin architecture
    5. Support for NoRM / MongoDb
    6. Support for Azure
  5. Create the 2.0 release (v2.0.X)
    1. Final bug fixes
    2. Update all documentation
    3. Add samples via Blog posts
    4. Update Northwind
    5. Update Who Can Help Me
    6. Start creation of 3rd sample

All of this is subject to change based on the needs of the community / the team.

Conclusion

As you can see, we have an ambitious schedule a head of us. The team and I are really excited about what we have planned and cannot wait to share it with everyone. Some of it is very exciting, like the Plugin architecture and alternate data store support.

S#arp Architecture 1.6.5 will be the last stable release until 2.0 is released. The interim releases will all be listed as Alphas or Betas and should only be used in production if YOU are comfortable with it. If you are not or need to wait for a stable release, please wait for 2.0. For each release, we will also provide another Templify package. If you want the full source, you can download it from GitHub.

More Posts Next page »