Archive for 'microsoft'

ASP.NET on Rails

A friend at work alerted me to the new MVC framework that’s in beta for .NET and I was really excited to see what they had come up with. He showed me some code samples and I immediately recognized some very Rails-ish stuff in there. So lets take a look and see what they have going on because so far its looking pretty awesome.

Disclaimer: Obviously Rails isn’t the worlds first MVC implementation, its just a really nice one and I think MS has definitely taken a few cues here.

Directory Structure (courtesy of Scott Guthrie’s blog):

A logical directory structure for an MVC app to be sure. I would kill to have this on some of my current projects where locating things you are looking for is a nightmare. It may not be Rails’s “Convention Over Configuration” but its a nice step in the right direction from my perspective.

Routing:

Routes! Routes! I loves me some Routes! Making your web apps RESTful has many advantages (see here, and here for some examples) and in any case the flexibility that custom routes provides is enormous. Think of how much nicer SharePoint url’s could be :), and, as ScottGu mentions, it helps in optimizing SEO.

Backward Compatibility:

If you were a good little software architect/engineer and built decoupled user controls and master pages there’s no reason why you can’t re-use that code again on your new shiny MVC pages!

Plug and Play:

Again from Scott’s blog, “… it’s highly extensible and pluggable…”, which is music to my ears. One of the great things about Rails, and one of the reasons I really believe in it as a long term technology is that while it is opinionated software, you can swap out its main pieces like ActiveRecord < => Datamapper . This means that if you think Datamapper will serve your project better then you’re free to use it, and anyone with a better idea for an ORM can jump right in and write one. If ASP.NET MVC can live up to this not only will it be a better framework for it, but I wouldn’t be surprised to see a bunch of custom pieces from hackers who want something better or just different.

Looking forward:

If you are a web developer and you’re main expertise is with .NET then this is something to be very excited about. Not just as a tool for building websites but also because MS can recognize a better way to get things done for developer’s and they are willing to throw money at making our lives easier. Good stuff all around!

XMLViewer Silverlight Control

So instead of rolling happenings into a gem, I got bored and decided to hack together some Silverlight and see what it was like. I’ve often said that C# is awesome for development, but that ASP.NET is not the best. The event driven model makes me want to gouge my eyes out (Page_Load, After_Load, Post_Pre_After_Load), but that’s another blog post that I’ve been meaning to write.

Anyhow! I wanted to try Silverlight out because your basically building a GUI app, which .NET is great for, but deploying it with the browser. Cross Platform no less! So please try it out, post what you think, and I’ll get the code up on codeplex or something tomorrow if I can find the time.

XMLViewer Silverlight Control

[UPDATE] Source available at codeplex.

Microsoft and Devs: marriage counseling needed

Since I started posting on this blog again I have been thinking a lot about Windows 7 and how MS could make it developer friendly. A lot of these ideas have come from discussions with colleagues (I work for a Microsoft consulting firm) and also from articles I’ve read that I agree with.

There are two or three main problems with how Microsoft treats its development community that I take issue with. I’ll decide whether its two or three as this post continues but the point is: Good developer’s want access to the best tools (ide & api), good developer’s make good applications (elegant inside and out), and good applications make a good platform.

1. Cost of entry

This probably doesn’t need much explanation, but I doesn’t have to be an all or nothing proposition. I don’t think many weekend devs will care about the Business Analysis tools for Visual Studio, but I think the MS development community would explode if they would release the full version of Visual Studio for free. Something simple like, “free developer tools for use with free software.” It would give college students, kids, and virtually anyone who wants to tinker with software a reason to look at the Windows platform. As it is right now, the cost is prohibitive at 250 for Standard Edition and 690 for Professional Edition.

Good devs are born from the desire to program for fun, but if you make it so the only people with access to your tools are people working at large corporations, its no longer fun its work.

2. API/Widget availability

Windows 7 is seeing the release of the “Ribbon” to developers. Currently you have to license it from Microsoft, which I didn’t even know was possible until I saw a quick presentation from Knowledge Lake at the NY Sharepoint User’s Group about how they had to do just that.

This also goes back to an article I read on Arstechnica where Peter Bright points out that the UI widgets aren’t released/standardized for the Windows platform. Not only does this mean we don’t get to use the ribbon but it also means that Windows turns into a hodgepodge.

I’m not quite sure what drives this mentality but I would like access to everything that I can get my hands on to make my apps as nice as possible. Microsoft can only benefit from awesome third party applications.

3. The community

I run a SharePoint Developer’s user group. The people who show up are really great, and I’ve had some awesome talks with guys like Paul Galvin, Michael Lotter, and Bob Fox about community development and software development.

But the feeling around these groups is just not as enthusiastic as I’ve seen elsewhere and I think its based on the simple fact that NONE of the people who show up hack in their spare time. They come for their professional betterment, not for fun, and it shows. The broader view of .NET is worse still. With the exception of the folks who work on the unadulterated awesomeness that is The Mono Project, there are very few in the community that can match the enthusiasm of the people that work on something like Rails/Gnome/KDE/etc.

This is a much tougher issue to address since a lot of the problem may stem from Microsoft’s image and where they spend their time/money. Lord knows they have plenty of the last to hold hackfests, competitions, and other community events geared toward bringing people together who are excited about the technology. It needs to be about developing for fun, instead of developing for your boss.


The great hope

If MS started to work some of these angles I think we could start to see the same vibrant open source development community around .NET apps that you see now with OS X and Cocoa. Oh, and give me a real command line too :D.

I welcome comments, and I hope that bit about the community wasn’t too harsh, but .NET is pretty awesome and everyone could benefit from a few small changes.

SharePoint Site permissions STSADM extension

For the SharePoint developer’s group I run in NYC I created a quick STSADM extension that outputs all of site, subsite, list, and list item permissions for a given SharePoint site.

By piping this output into a file you can create a baseline to compare to at a later date with something like winmerge. Thus you have a simply way to verify your site permissions should you need to. The idea was to illustrate how easy it is to create extension for STSADM, but I ended up with a useful utility in the process.

Code here.

Also, if you look at the code you’ll see that there is in fact an interface that all of the “Permissionable” objects implement (ISecurableObject) and as a result the methods for retrieving their Roles and Rights can be generic. Contrary to my earlier post here.

If you have any questions or are interested in attending the next meeting of the New York SharePoint Developer’s Group send me an email at john.bender at hensongroup.com.

Enjoy!

Sharepoint Objects inheriting from System.Object?

UPDATE: All of these objects implement and interface that allows them to be used generically (ISecurableObject). YAY! See here for an example.

In my short time working the the Sharepoint Object Model, I have thoroughly enjoyed the ease with which I am able to access all the bits and pieces that make up Sharepoint. It allows the developer to get creative with what he/she wants to do, and really the only limiting factors are time and money. The only oddity I have come across thus far is that objects like SPList (document libraries, etc) and SPWeb (sites within a site collection) inherit from the System.Object class.

From a high level view of the inheritance hierarchy this could be justifiable, but they do have common elements (roles, groups) that would better serve developers, where they incorporated into a singe parent element. For example, I’ve written a simple extension to stsadm to recursively grab all groups and roles for all webs, lists and list items within a site collection. Because there is not a common “SPObject” or “SPPermissionedObject” class that SPList, SPWeb, and SPListItem inherit from, and that I can cast those objects to, I am stuck writting three different functions to handle the roles and groups for each type of object.

Example:

On a small scale this doesn’t seem like much of an issue, but with large code bases the result of the current inheritance hierarchy is code that will be much more difficult to maintain. The only reason I can see for Microsoft having proceeded this way is that they want to see how developers are using the software before solidifying their inheritance. Providing my suggested solution and then changing it would break code, where as with the current situation code will work even if they were to implement an SPPermissionedObject.

Vista: it’s not so bad

First it should be stated that I have disliked using Windows for some time now. Many of my friends have been the audience to half-hour rants regarding one problem or another with this most ubiquitous of operating systems, but recently I was hired by an IT firm that specializes in MS products. They handed me a laptop, and as luck would have it Vista Ultimate was installed. Over the first couple weeks of use my gag reflex has been extremely calm, but mind you I won’t be comparing this to any other OS. Vista retains many of the problems and quirks (explorer usability, registry) that Redmond’s previous operating systems had while adding some new ones (UAC, driver problems, Hardware reqs etc…), but there is a silver lining.

  1. Gadgets: There was little doubt the Microsoft would add some sort of widget framework to their newest operating system and it has many of the features of similar implementations on other OSs, namely OS X. They don’t necessarily do it better than the other guy, but at least the functionality is represented. Furthermore, as a developer I’ve had some good fun making gadgets like a custom RSS feed for my companies Sharepoint announcements. They are very easy to put together with a little web design experience and the project template I found here. This also represents another trend that I would like to see more of from MS: smoothing out that development learning curve. The easier it is to build apps, or in this case gadgets, for an operating system, the more people you will have making great software for your platform. Gadgets
  2. Eye candy: This is shameless. Aero has ridiculous system requirements but I like eye-candy. On the usability end, it’s obvious that it makes it more difficult to distinguish UI elements (see below), but like I said: I like eye-candy. You can even customize your glass color, I went with a very light limo tint. To go right along with my shaded glass is the black Taskbar, which is a big move in the right direction from the eye searing blue, silver, and _olive_ that we’ve been used to. Did/does anyone use olive?Eye Candy
  3. Keyboard Application Launching: I hit my Windows key and start typing what I want and hit enter. And just like that my app is running. It’s not and end all be all launcher, and it lacks much of the functionality of something as comprehensive as Quicksilver, but for a person who loves to use the keyboard its a great way to get access to indexed files.
  4. Search: Everything, like that aforementioned application launcher, is searchable. Another perfect example of this is when you open up the control panel. Just enter a word or two into the top right searchbox and your presented with the best candidates for where those settings might be. For power users who know where their settings are this may be useless, but it could potentially save a lot of time when grandpa calls up asking why something isn’t working right.Search
  5. Installation: Short and sweet. I wanted to clean up my laptop and I was not looking forward to sitting in front of my computer answering a lot of questions before I got to use it. MS has done a good job of making this process a lot less painful for most home users.

So far that’s what I’ve noticed. I’ve also had some problems but for the most part it isn’t getting in the way. I run the OS on 2ghz Pentium D with 1.5 gb of ram, and I have a resolution of 1920×1200, which makes for plenty of sidebar and gadget room. I think that last spec is extremely important because the UI elements are not nearly as nice at lower resolutions (which I’ve tried). They take up too much space, and serve little purpose. More to come on my Vista experience, and hopefully I’ll be able to find an Opensource project that runs natively in Windows or has some sort of port in the works (Amarok anyone?).