Wednesday, April 15, 2009

Did some testing with SharePoint Guidance

I found this out on the MSoft patterns & practices site.

Similar to the MVC thing it is designed [one hopes] to motivate SP programmers to greater productivity levels.

One thing it does for sure is show:
  • how a real application can be integrated into SP
  • how many pieces-and-parts [at the code level] are frequently required to accomplish this
There are some gotchas that I found. For an experienced SP developer, these are easy to work-around. I have not dug in to fix all of these, but for sure fixing some of these would not be easy. They are listed here along with the perceivable symptom:

  • does not work on non-port 80 webapp - instantiating the site just hangs
  • workflow build issue - second project will not build complaining about feature scoping; the fix is straightforward although you also run into some Visual Studio bug fixing it (maybe this is related to the original bug)
  • workflow run-time issue - could not get this to run correctly when set to the original site instantiated for the application; may be related to the fact that it must be instantiated in a site collection
  • theme selection issue - the theme project does not install into the Site Settings location; so the customer cannot test it out with built-in themes
  • install to more than one webapp does not work - this is because of GUID collisions
  • workflow DLLs not installed in the Contoso VPC - so when you open the workflow source code, Visual Studio complains and cannot open it
  • the directions talk about error checking, but when I schedule a course with the end date before the start date it spits out an ugly ASP.NET exception screen

So it is some distance from best practices. Rather than 1.0, I would call this a 0.7 version of guidance. Many of the issues above could be put into the destructions. Then someone does not have to stumble over the problems one-by-one.

Of course, it is more fun that way.

Regards..

Sunday, April 12, 2009

ASP.NET MVC 1.0 free book contains broken code

Hey...what a news flash!

MVC 1.0 is a new application framework for ASP.NET. I wanted to figure out what it is because it, like some other "frameworks" I use are designed to make application development closer to Code Free. This specifically is on my list since:

1) It took me a while to get my head around the ASP.NET 2.0 declarative markup programming model. It is so vast and so powerful that you need to understand at least 30-40% to be productive at all. And a higher knowledge level is needed to debug it. I have had some success using 2.0 and pushing it over to Sharepoint with relatively minimal problems.
2) Now I read about MVC like it is something new. The first time I read about it was in a SmallTalk book in the 80's.
3) Even MSoft had a MVC-type framework called MFC, again from the 80's.

Here is the blog that announces the 1.0 version.

So I loaded the Contoso VPC for SharePoint to test another framework [described in another blog entry]. Then I decided to try this MVC thing in that VPC-image. To install it, nothing more than the usual .Net framework hassles to overcome.

The link above also allows you to download the completed code that is [presumably] built up step-by-step in the book.

I have seen many cases where some group gave a tutorial book and the code and they did not agree. Whether I cared about that or not depended on the subject matter. There have been times in the past where if I really wanted/needed to learn the material and I ran in to the book does-not-equal code case, I would just skip the book and go to the documentation for the code.

In this case although I was ready for it, now that we know this is the case again, I am a little more disappointed because:

1) frameworks are big entities to learn
2) the stated goal of this book is to help someone learn
3) I have read this Scott Guthries blog in the past and he seemed like a stand-up guy
4) After reading the chapter before trying the code, almost none of the ASP.NET 2.0 decalrative framework carries over; even more reason for this think to work
5) I guarantee you these guys know the [lack of] pedagogical value of having a how-to book that is incorrect and the final code; of course, it is better than just having the book!
6) MSoft usually treats programmers better; I have seen lots of cases where they give not-quite-ready stuff to users, but they usually understand the developers have a bigger hill to climb
7)the purpose of a framework is to let the developer think big-picture; having to dig into the guts of MVC routing on your first trip to nirvana with this thing is not what the doctor ordered

So again I am naive; again the industry chucks one huge framework to move to a slightly better one that is just as hard for developers to learn.

I guess that this is another one of the benefits of open source. I guess if anybody could do it, they wouldn't need programmers, right?

Finally, there is a tweet out there somewhere found by Google when I type in "errata" about this mess. Wanna guess the fixes will be printed at the back-of-the-newspaper?

Ohh, I got up to page 45...and the code will not breakpoint in DinnerController...must be a user error!?!

Regards..