Hacking SharePoint

I've been working with SharePoint lately, it's a technology of highs and lows... the highs are when you've finally got something to work that should've worked in the first place, the lows are well... all the times in between.

Ok, so that sounds cynical - SharePoint is actually quite a cool product - there's a lot of good in there... stuff that would take you a while to write yourself... but it just tends to drive you a bit crazy, things that look easy from a distance become hard to achieve because of poor documentation, lack of extension points and the difficulty in building testable code.

At any rate, while on this project I've been compiling a list of hacks that other people may find useful, which I used to solve a few of the problems I was hitting while developing... here are the first few:


There are some more coming shortly.
Read More

Architecture Chat 19

So another small turnout - Garreth, David, Murray (From Terabyte) and Myself. Peter gave his apologies, being out of town today.

First off we had a talk around the various issues / challenges facing electronic payment, US dollar merchant accounts, PayPal etc. when selling your products on line.

Part of the discussion focused around the fact that there is no existing product/site out there that can help sell your software products (that has the right features), we're thinking:

  • Distributing licenses from a pool.
  • Calling back to a web service for generating licenses on the fly.
  • License activation over the Internet.
  • License expiration (for yearly licenses) and the required logic around that i.e. automatically adding license renewals to a users shopping cart, sending notifcations.
  • The list goes on...


Even more so, building a community around selling add-ons, templates etc. for your product, and providing a model where micro payments can be collected i.e. buying credits and redeeming them on purchases etc. There are plenty of good ideas in this space.

Last of all, the existing software retail sites need to take a smaller cut - a not uncommon amount is 10-20% of the product cost... that's just crazy, especially for high-cost products, thats no different to giving them a 20% share in your business - you don't need to ship many products before you could've just built your own using PayPal.

Following that we had a long conversation around Garreth's ArchAngel product again, and in particular around the challenges of templates, round-tripping code, interesting usage scenarios i.e. (generating a model, the UI to bind to that model and WatiN classes which make it easy to write tests for the UI) - and also around preferences i.e. strengths and weaknesses of using a statically typed language (C#) embedded in the templates vs. something like IronPython or Boo, and how you can flow compilation errors (line numbers etc.) from the compiler back to the template - something I have trouble with when diagnosing Binsor, brail and my own boo based template engines at the moment, mostly because I haven't invested the time to make the experience better.

At that point we had a discussion around the various CMS's - I've been doing some research to pick one for a few sites I want to port from "other" CMS's.... The three I picked on for .Net were:


i.e. some of the open source ones... I would've liked to have included rainbow cms as well, but I just haven't had the time to review it yet.

Everyone knows about DNN (in fact we complain about it quite regularly ;o) - so it was really put up as a base line for comparing the others... mojoPortal is a bit like DNN, however it supports a wider range of databases - can run on mono and has a few unique/interesting features.  It lacks the same level of community involvement as say DNN or Umbraco, but it does give you the opportunity to avoid shelling out for OS licenses... Alas it uses web parts, and though xhtml compliant it lacks the rendering flexibility of Umbraco - Also the data model is pretty scary... a single class for all core data access, using stored procedures.

Umbraco looks good - has a reasonable template engine, and is a little more content-flexible then the other products which are based on web-parts - Sql server only and the business entities have in-line sql (why haven't any of them been built using a bloody ORM!) - this kind of thing scares the hell out of me - round trip per-property?? why!

 public int MasterTemplate { get{ return _mastertemplate; } set { _mastertemplate = value; SqlHelper.ExecuteNonQuery(_ConnString,CommandType.Text,"Update cmsTemplate set master = " + value + " where NodeId = " + this.Id); } } public string Design { get {return _design;} set { _design = value; SqlHelper.ExecuteNonQuery(_ConnString,CommandType.Text,"Update cmsTemplate set design = '" + value.Replace("'","''") + "' where NodeId = " + this.Id); } } 


Or better still, how about this web control's OnInit method:
 protected override void OnInit(EventArgs e) { base.OnInit (e); SqlDataReader dropdownData = SqlHelper.ExecuteReader(umbraco.GlobalSettings.DbDSN, CommandType.Text, "select id, text from umbracoNode where nodeObjectType = '39EB0F98-B348-42A1-8662-E7EB18487560' order by text"); base.DataValueField = "id"; base.DataTextField = "text"; base.DataSource = dropdownData; base.DataBind(); base.Items.Insert(0, new ListItem(ui.Text("choose") + "...","")); // Iterate on the control items and mark fields by match them with the Text property! foreach(ListItem li in base.Items) { if ((","+Text+",").IndexOf(","+li.Value.ToString()+",") > -1) li.Selected = true; } dropdownData.Close(); } 


The biggest down-side to me however is not the glorious SQL sprinkled everywhere - but the XSLT... I just flat out hate working with XSLT... and nobody at the table seemed to have anything good to say about it either.  It's certainly powerful, but it's just no fun to work with (XSLT that is, not Umbraco).

Still none of these are necessarily reasons to throw the baby out with the bathwater, if it gets the job done (which Umbraco certainly seems to, based on community feedback) then why not use it - the only other thing that puzzles me is the complete absence of a test suite for a project, even an empty test project would be a good sign ;o)

So on that note, Murray is embarking on a Umbraco project over the next couple of weeks - I'll check back with him when it's done and get a post-mortem on how it went, and what his thoughts are on the framework.

On the flip-side... why hasn't a monorail/ActiveRecord based CMS been released yet (that's open-source) ... a few have been written (obviously for commercial projects), but the parties and companies involved never seem to have the initiative to allow their code to escape out into the wild... I can't help but wonder how much stronger Monorails position would be if a CMS had been developed and grown along-side the project, if nothing else I suspect we might have a seen a few more interesting view components developed and made available by now.

Hardly new thoughts though - this has been discussed a few times on the Castle-project-users list, but nothing seems to come of it...

We then had a brief talk about F# becoming a "first class" language for the .Net framework, that will be in VS2008... one of the questions was what F# offered, there is a lot, but things that I can recall.

  • Functional programming, in particular foundational features like lists, tuples (allowing multiple arguments /multiple returns), pattern matching etc.
  • Type inference (which we discussed, i.e. is code using inferred types harder to read/understand as things become more complex, a bit like using var in C# 3.0?)
  • All data is immutable by default (makes multi threading etc. easy - mutable data must be declared explicitly).
  • Linq integration, and some metaprogramming functionality.


I'm pretty sure that list does the language a great injustice :)

What is exciting is that unlike C# vs VB... in this case F# provides features which make it compelling for solving certain types of problem - and as a first-class language you don't miss out the debugging etc. experiences (and your guaranteed a language which isn't going to stall or be thrown away any time soon) - I doubt I would use it for an entire project, but I could certainly see writing specific libraries in it for consumption from C#/VB.Net applications.

Last of all we discussed Recruiting (in a fairly light-hearted manor) - in particular graduates and the state of the industry with regards to finding good/brilliant graduate and intermediate developers who you can throw at interesting jobs that require a real passion and depth of understanding i.e. writing language parsers, building development frameworks etc.

The jobs we would've liked to have had when starting out ourselves no doubt!

In short it seems very hard to find really talented junior and intermediate developers to throw at highly technical work at the moment in the Auckland region (or contract resources for that matter)... And that salaries (which we've discussed are already too low in NZ for "distinguished" engineers) offered for many intermediate positions are too low to attract the right candidates, I still see some intermediate positions being offered for between $50 to $65K .. I had an $50K+ intemediate position 5 years ago!

Some thoughts included:

  • Getting more involved with institutes before the students graduate i.e. offering 3rd year projects etc.
  • Giving up and outsourcing overseas using a service like rentacoder... or maybe looking to a company like Castle stronghold.
  • Luring people away from open source technologies like ruby/python/php with more money.


Not great conclusions I'm afraid!

I also had planned some discussion around Java & .Net (as mentioned in this post) which we didn't get too - we'll discuss those next time if anyones interested (sounds like something that might be of interest to Peter).

And that's it for another Architecture Chat, thanks to all those who attended, and I'll see you in a couple of weeks time (Thursday 15th November).

BTW - If you have any suggestions for topics next time, please feel free to pass them on, and maybe next time we can move the focus back to some broader architectural topics and get some debate going on :)

Announcements


Quick couple of announcements / reminders:
  1. The CodeCamp BootCamp 2007 is on this weekend in Christchurch (where you can watch Ivan put IronRuby through it's paces, among other things)
  2. André Meurer from Olympic software has organised another Ellerslie DNUG meeting next thursday, details are below:




Microsoft PerformancePoint 2007


Ellerslie, Auckland , Thursday 8 November 2007
Gather at 5:45, starting at 6:00

Presented by: Adam Cogan (Chief Architect at SSW, MVP)

Microsoft Office PerformancePoint Server 2007 is an integrated performance management application designed to help improve operational and financial performance across all departments and all levels of your organization.

With Office PerformancePoint Server 2007, you can monitor progress, analyse what is driving variances, and plan your business from budgeting to creating management reports. You can have metrics, key performance indicators (KPIs), and reports delivered to every desktop through intuitive scorecards, dashboards, and the easy-to-use 2007 Microsoft Office system environment. A key component of the Microsoft Business Intelligence (BI) offering, Office PerformancePoint Server 2007 can help you understand how performance can align with personal and departmental.

http://www.microsoft.com/business/performancepoint/

Click Here to Register


Catering: Pizza & Drinks
Door Charge: Free!
Parking: Free, just park in Olympic Software’s car park

Venue:

Olympic Software
10 Cawley St
Ellerslie
Auckland

Map of venue

Read More

Architecture chat this thursday.

Hi All!

The next Architecture chat is on thursday this week, 11:30am at the Sylvia Park in Auckland (at Garrisons).

As always, bring along your thoughts and discussions, and in the mean time here are some possible topics for discussion that have caught my eye over the last two weeks.

  • Java & .Net
    • The IKVM project (Java VM implemented in .Net)


  • Accropolis changes
    • No new previews
    • P&P will provide WPF Composite Client guidance (uh oh)


  • Open source CMS's

  • F# - becoming a first class language in VS.Net
  • PLinq, now GridLinq.
  • Recruiting .Net developers how to/approaches.


And if anyone else has suggestions, feel free to throw me a comment/email etc. and hopefully we can get a few more of the regulars back this week.

See you all thursday!

Read More

Architecture Chat 18

So, another small turnout last week - but good discussions none the less, with 4 of us in total (Peter, David, Gareth and Myself).

First off we had a talk about ArchAngel, the product that Gareth has architected/written, and what it solves, and around the upcoming release of the new site, as the product moves out of beta - a lot of us have given him grief over the existing DNN site, and it should be good to see it get a face lift ;o) - Following that we talked a little about the challenges of round tripping code, and the problems with a lot of the current MDA/MDG implementations, and how ArchAngel can resolve a lot of pain associated with other code generation approaches due to the holistic approach.  It's a very exciting product and hopefully at some point a screen cast or two will be made to demonstrate the various features / advantages of the product (hint hint).

I again voiced my frustrations with SharePoint - or "swearpoint" as David coined it, I think much of my problem has been around lack of good documentation, and finding the right combination of tools for doing the job i.e. not using  VseWSS projects but instead using WSPBuilder, and getting to grips with the various nuances of deployment packages and the SharePoint 12 etc. folder structure - not the mention the diabolical and misleading exceptions you get at some points - I still haven't found a good approach of TDD'ing that works across event receivers, web parts, controls etc. that doesn't introduce a large amount of uncessary complications and abstracts just to make the untestable testable - For the next SharePoint project (if I dare touch another one) I'll definitely take the time to develop a better TDD approach, and probably buy a tool like typemock to assist with it.

I brought up the  ASP.Net MVC framework - with the latest wave of information
coming after the ALT.Net conference where Scott Guthrie did a  presentation... and we discussed how it fits in with web forms, and where it leaves Monorail -based on current observations within the monorail community I believe many would consider moving across to the ASP.Net MVC platform based on what has been presented so far, though the approach and architecture is similar enough that there should be opportunities to easily shim view components etc. To work with both MVC frameworks.

After that we had some rambling discussions about Accessibility (including web browsing for the blind, designing accessible forms, x-forms, tables vs. div's for web forms and how nothing done for local/central government really conforms with their accessibility requirements, or is even tested for accessibility.

Intertwined with that conversation was the rather slow adoption of WPF (I mentioned some of the points brought up in recent panel discussion that was on .Net Rocks!), WPF & Silverlight control suites and the power of filters and binding, also include in that discussion I briefly mentioned that I'd been working on building a web based workflow designer application using the OpenJacob library (the draw2d javascript library to precise) and Monorail with some success, but would like an off-the-shelf WPF or better yet Silver light toolkit to do the same job.

Last of all we discussed Alex James's proposed question around thoughts on POCO (plain old code/c# objects) and how important it was to us (in association with ORM's / Domain Driven Design, or at least thats what we talked about).

The thoughts were basically:

  • Single inheritance makes non-POCO based Orm's a pain to work with in some cases, i.e. there's a loss of control, and accommodating some scenarios such as MarshalByRef become difficult/impossible.
  • Can often make it harder to enforce correct usage of your domain model, such as aggregates.
  • Depending on the ORM, non-POCO objects are harder to test with in a disconnected manor.


On the flip side:
  • Incorporating concepts like current/previous value can be more natural.
  • Performance / ease of development for the ORM can be simplified when not accommodating POCO. You generally need to rely on proxying and virtual methods to make POCO possible, this can introduce additional complexity and
  • small performance hits both on startup and at run-time (not generally that noticeable).


I also took the opportunity to once again mention PostSharp - which I've been using to prototype methods for removing a lot of the repetitive or ugly plumbing code that developers often have to write when developing non-POCO entities.

Oh, and sorry about the late write up! .. Things have been a bit crazy lately and I've been hard pushed to find the time to post this till now, I'll do better with the next chat and try and get that writen up in a more timely manor (a 1 to 2 day turn-around).

Last of all - our next chat is Thursday this week - hopefully we can push our numbers back up to 6 or 8 and catch up with some of the other regulars who haven't been able to make it over the last month and half - and as usual, if you have any topic suggestions, just drop me a comment/email etc. and I'll bring it up at the next chat.

Read More