Showing posts with label visual studio. Show all posts
Showing posts with label visual studio. Show all posts

Wednesday, October 05, 2011

SharePoint Conference 2011: Integrating Social Media with SharePoint Websites

These are my rough notes from an SPC presentation by Brian Rodriguez and Ryan Sockalosky. Awesome session – my favourite type – really matter of fact and presenting and solving issues clearly.

Leveraging Social Media Example

Examples of leveraging social media on Facebook sites.

Ticketmaster on FaceBook: Daily Deals, large following, evangelism, popular items. Popularity leads to large revenue.

Front and center placement, put the like button as part of purchasing experience. You go to concerts with your friends and your friends are on facebook.

What can you do to leverage Social Networks?

Help users “Like", Tweet, and share content. Reach a broader audience. Allow your customers to evangelize for you. Drive traffic to your site.

How to Do it: Facebook

Facebook Plugins – developers.facebook.com has plugins you can use.

iFrame or XFBML (facebook XML language)

Some options: Like button, send messages, embed activity feed

plugin on page.

Facebook OpenGraph Protocol – you can use Facebook insights to get insights into traffic patterns, who is liking what

How to do it: Twitter

Embed twitter RSS feed into your page, embed plugin to allow tweets from a page.

How to Do It: Other Social Networks

AddThis – social network sharing

Demos

Contoso eletronics website

Add “Follow” button in master page at the bottom. Added tweet and like buttons next to the content. Defaulted Tweet content makes it dead easy for a user to click tweet and share the link

By function of tweeting that page, it is now part of the “Social Stream” – given a bit more weight in search engines and enabled for discovery by followers of the user or his or her friends.

Created a custom webpart to allow users to tailor the text to configure the Twitter content dynamically. The page owner can decide that they want to automatically embed hashtags in any tweet via a webpart property.

Facebook webpart – same options – defaulting text, show like button, show activity feed, people’s faces etc.

Tip: Make sure the tweet or facebook or sharethis links go to the home page consistently, so set some buttons in the master page footer or header and ensure every page on the site shows the sharing buttons.

One of the limitations of sandbox solutions is you cannot call RegisterClientScript so webparts containing these facebook or twitter plugins cannot be handled as sandbox solutions. Also a separate mode is created for Design Mode to allow rendering in SharePoint Designer otherwise you will see the controls as broken in Design Mode.

Demo of modifying master page by overriding AdditionalPageHead content placeholder in order to inject OpenGraph metadata tags (title, site name, description).

Enable Engagement and Conversations

Allow Social Commenting

Educate others that the conversation is happening

Increasing brand awareness and credibility by inviting the conversation to your site

Customers can engage with you and with each other

Facebook: Login plugin on your page and activity stream

Twitter: Widgets around searching or surfacing profile on your website

Demo of wrapping code in content editor webpart for these

Enabling Engagement and Commenting

Governance is key – to keep engagement clean and managed

Store and publish content on Social Sites: Examples: YouTube, Twitter, Facebook “fan pages”

Increased visibiltiy and re-use

Customers can view/subscribe/join without ever seeing your site

Surface your external social content on your site

1 out 6 minutes people are on a social networking site

Send to Twitter: Workflow in Action

Content added to SharePoint List – triggers approval SP workflow, results in REST post to Twitter. Need to store oAUTH credentials in SharePoint 2010 secure store service to allow staff members to sign in and post via the company account.

Content of tweet needs to be approved before posting

Register an application with Twitter to use their API.

REST Based api using OWA to allow approval

Setup oAuth sending consumer key and secret to Twitter using the Access Token they give us once signed up for the REST based api (while logged in as the company’s Twitter account).

Now go into Secure Store Service and add new Group access (single version of the credentials) although you could have different Twitter profiles and those could be individual secure tokens. Define the attributes we are capturing (Screen Name, Token, TokenSecret, ConsumerKey, ConsumerSecret).

Demo of creating automatic tweet via workflow that includes page title (for a press release) and then a link back to the page automatically

Other Integration Scenarios

Leverage FAST Search for dynamic content  with the FB Graph API

Connect BCS to Twitter – use native UI and WebParts with twitter content

Federated Search of Twitter, YouTube etc

Use federated login to Live or Facebook – use native SP Claims Based Auth instead of using the FB Connect plugin. Allows for audience targeting or storing a rich SP user profile

Allows for back end LOB integration (ex CRM, SAP, etc)

Tips and Considerations

Do you need to own the conversation / content?

SharePoint’s Social Networking capabilities require login

Linking is tied to pages / uRLs – if pages change or are deleted conversation goes away

Performance of plugins – Facebook like button is at least 2 calls to Facebook. You could try to load JS asynchronously after pages load to keep down load.

Reference javascript in master pages or page layouts

Sunday, November 01, 2009

Introducing Clockwork Web Framework for .NET

In 2003, I read a book, “Making Space Happen”, by Paula Berinstein. It’s about the efforts of entrepreneurs to open up space to the public. It’s the kind of thing that gets my propeller-head spinning, and after reading it I resolved to create the best website on space travel on the internet.

So, I sat down in a park and within two hours I had covered several sheets of paper with scribbles and scrawls of what my website needed. I had notes on authentication, web components, search boxes, themes, dynamic images, language toggles, and all kinds of stuff.

Being a good little programmer, the more I designed, the more intricate the design became, and pretty soon I was knee-deep in code. Flash forward six years later, and I have yet to write a single page of that space website!

But I do have a web framework :)

What It Is

Clockwork makes it easy to build powerful .NET web sites. It’s completely free, open source (under the Apache 2 license) and you can use it in proprietary or open source projects, as you like.

Some of the ways it makes web development easy:

  • Database-agnostic data access
  • Dynamically displays content in different languages
  • Leverages the .NET 3.5 framework, including the Provider Model, generics, LINQ, automatic properties, and more
  • Integrates with popular web services such as those provided by UserVoice, LinkedIn, Google and Yahoo!
  • Makes it really easy to use object-oriented programming standards like Dependency Injection / Inversion of Control, Repositories, and Specifications

Under the hood I use many popular components, including NHibernate for database access, Castle Windsor for Dependency Injection, and log4Net for logging.

Although today marks the official public release, the framework is currently at version 3.x because I’ve been using earlier versions of it in production websites since 2004.

I’ve built Clockwork using as many web standards as I can find, as many of the latest .NET elements as possible, software best practices, and a lot of love and stubbornness.

What It Will Become

Well, it’s obviously too early to say. But I am committed to continuing to develop it, I have a long list of things I plan to add, and I’m hopeful a community of .NET developers will adopt it and push it into areas I can’t even imagine today.

Please take a minute to visit the website and learn more about it. I hope you find it helpful.

Many thanks,

Nick

Tuesday, September 02, 2008

Global Assembly Cache Trap Door

Sergio Otoya, the Technical Director of the Australian SharePoint consulting shop LivePoint, showed me a great little trick yesterday to open a "trap door" to explore the Global Assembly Cache (GAC). This is a special folder on the file system (at c:\windows\assembly)  where all the globally registered .NET DLLs reside.

Sergio pointed out that if you navigate to it using Windows File Explorer you can only see the registered DLL information.

GAC

However there is a little back door you can use to actually view the deployed DLLs. If you go to the Windows Start line and type c:\windows\assembly\gac  - it will open a new File Explorer window with the list of all the DLLs in a sort of folder view. So now copy and paste is enabled.

GAC - Behind The Scenes

Why is this useful? Well, in my particular case I was trying to copy a feature from one SharePoint portal server to another, and couldn't find the original WSP or Feature...So in order to manually recreate this I simply wanted to find the Feature (available from the SharePoint hive) and get my hands on the GAC-deployed DLL.

Not a very common use case, but a good trick to know.

Sunday, February 17, 2008

Starlight Day SharePoint Site

Starlight Day is an annual event when volunteers from across Australia donate their time and money to give sick children a wish. This year Dimension Data Australia worked with Starlight Children's Foundation to create a new public Internet site that would allow the Foundation to sign up and track volunteers, as well as modify content on the fly, rather than going through the existing manual and laborious process.

For the last few months I've watched my colleagues working hard to create a MOSS Internet with some custom application development and last week their efforts were rewarded when the site launched. I thought it would be nice to profile the site as another example of what can be done in a short time frame with SharePoint, and to identify the challenges that they overcame.

The Solution

MOSS 2007 was used with the Internet Connector License to allow content updates by Starlight staff. In addition, a custom volunteer roster system allowed visitors to find and sign up for Starlight Day activities based on a postal code.

The Team

In alphabetical order, the Microsoft Solutions - Application Integration team members who worked on Starlight Day are:

  • Slava Gorbunov (Roster custom web development)
  • Hatim Hamid (Quality Assurance)
  • Marianne Hidalgo (Quality Assurance)
  • Abdul Khan (Deployment)
  • David Langeder (Practice Manager)
  • David Marsh (Deployment and web development)
  • Karina Smith (Visual Design and Information Architecture)
  • Viraf Wadia (Project leader)

Viraf: “I was responsible [for] delivering the project...It has been a fantastic achievement from the team. Makes me feel proud in helping Starlight achieve their goal of having an internally hosted internet site that they can manage from a content and branding perspective”

Hatim: "Basically, I have been testing, testing and more testing. Specifically, I have been [testing] the Starlight Day Roster...The other thing I have been doing is some performance testing."

David Marsh: "It went well - I could have made more structure and process around the deployment strategy. The best part was seeing the final design come together using all the WCM features."

The Challenges

Essentially Starlight Day presented the familiar challenges of any custom web application and website launch:

  • Coming up with the Visual Design and site architecture
  • Content development
  • Coding and refactoring
  • Deployment and change management
  • Bug, integration, and performance testing
  • Project management
  • Timeframe: The entire project including planning, infrastructure, installation, customization, content delivery, and live deployment fell within a 3-month window.

Development

The idea was to use as much "out-of-the-box" as possible. The customizations were broadly limited to:

  • Preventing core.js from loading for anonymous users
  • Creating rotating list of images using Summary Links Web Part and JavaScript
  • Preloading image scripts
  • Storing images in separate libraries
  • The Volunteer Roster was the most significant development piece

The team had to quickly come up with functional requirements to identify precisely how the process would work. The requirements had to be "as simple as possible, but no simpler". Then visual design had to commence to identify what pages were required and what the flow was like. At this point coding began in earnest using .NET 3.0.

Deployment

Deployment was carried out using SharePoint's Feature and Solutions model with some batch files to automate. The team used STSDev from CodePlex to help manage features and solutions. Content was updated live by Starlight's staff while work was still underway, so coordination and communication was critical.

They did a content migration using WCM instead of a database migration (using attach and reattach). David Marsh suggests that might have been better because some things in content migration didn't work such as some pages became corrupted and some options in SharePoint no longer worked since they were referencing the old development server's URL. Fixing this required some manual tweaking. In hindsight he suggested they needed to plan for more time to fully integrate roster functionality into SharePoint (via custom web part or as ASPX pages).

Bug Testing

Not all URLs were fixed up automatically during the migration to production. Database migration would have fixed this. The design layout and content needed to be tested in all browsers. Not surprisingly, older browsers had issues with the CSS - not a SharePoint issue, rather CSS-related.

Key Learnings

  • More prototyping is required up front to verify and validate design concepts. This de-risks the project and nails down task deliverable times
  • Plan deployment earlier - document and test each type of deployment
  • Never underestimate the time it takes to test and deploy
  • Use enough environments to adequately develop, integrate, test, and manage content approval and staging

Starlight Day is May 2, 2008. You can view the live site at http://www.starlightday.org.au/. The custom roster page is at http://www.starlightday.org.au/StarlightDay/GetInvolved/Volunteering/Pages/VolunteerForStarlightDay.aspx. Congratulations to the team for a job very well done!

Tuesday, December 11, 2007

Quick and Dirty Web Parts

SharePoint is a joy for Rapid Application Development and prototyping. It's great fun to sit with clients and run up site hierarchy or document taxonomy on the fly, in response to their direct feedback.

When it comes to any custom development, there is a bit more heavy lifting - especially if there's a requirement for custom web parts. This starts to involve Code Access Security, custom control lifecycles, and change management.

What if you just want to do some RAD custom development?

There are some nifty shortcuts to help with web part prototyping. First of all, the SmartPart and Son of SmartPart are wonderful little controls created by Jan Tielens. They make it easy to create custom user controls with full design support and then make those work in a SharePoint context.

In a similar vein, MOSS includes the very useful Page Viewer Web Part. This is available right out of the box with no assembly required. Follow the steps of this example to use it with very little effort:

1. Create a basic web page, Default.aspx with the following script:

<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="CustomSharePointWebApp._Default" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
    <title>Untitled Page</title>
</head>
<body>
    <form id="form1" runat="server">
    <div>
        <asp:TextBox ID="Field1" runat="server"></asp:TextBox>
        <asp:Button ID="SubmitButton" runat="server" Text="Button" />
        <asp:Label ID="ResultLabel" runat="server" ></asp:Label></div>
        <asp:RequiredFieldValidator ID="Field1RequiredFieldValidator" ControlToValidate="Field1" ErrorMessage="Field 1 cannot be empty" runat="server"></asp:RequiredFieldValidator>
    </form>
</body>
</html>

2. Use the following code for the code-behind:

using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;

namespace CustomSharePointWebApp
{
    public partial class _Default : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if (Page.IsPostBack)
            {
                ResultLabel.Text = Field1.Text;
            }
        }
    }
}

3. Now right-click the project file in the Solution Explorer and click "Publish". For target location, enter the full path to the _layouts folder as well as the name for your custom app, ie:

http://[Your Sharepoint Portal]/_layouts/[Your web app name]/

This will automatically migrate the code and create a folder in the _layouts directory.

4. Now create a test team site somewhere on your portal. Add a Page Viewer Web Part to the page, and point its link to your application's default.aspx page.

5. You should now see your application appearing in the team site, with full SharePoint context, Master Page, and site hierarchy. Notice that in the example we created, the default.aspx application lifecycle is handled completely outside of SharePoint. By deploying it in the _layouts folder we can lstill everage the SharePoint user context if we need to (for security trimming, user profile information and the like).

Custom Form with Page Viewer

Happy prototyping!

Caution: The Page Viewer Web Part uses iFrames, which present some potential security concerns, such as cross-site scripting attacks. iFrames are probably safest if hosted internally; don't deploy these to public-facing sites unless you've closely examined the security implications!

Friday, November 23, 2007

Visual Studio 2008 and .NET 3.5 Release

This week Microsoft released Visual Studio 2008 and .NET Framework 3.5.

Over the past month I've been running the Beta 2 in the Virtual PC Microsoft provided. This was an excellent way to evaluate the beta version since it isolated the code from my laptop - making it easy to remove now that I can upgrade to the RTM. I love this approach and hope to see more of it for CTP and Beta releases.

I remember upgrading from Visual Studio 2003 to Whidbey was a frustrating experience since there were a lot of incompatibilities due to the underlying changes in the .NET framework - particularly the change from the code-behind to the code-beside model. This time, the upgrade tool didn't seem to have too much to do. The code I was running in Beta 2 happily migrated to RTM without any problems, which was a nice little bonus. In fact I've always found the Visual Studio betas to be exceptional stable and this doesn't seem to have changed.

New Language Features

.NET Framework 3.5 introduces many new language features. These are powerful but sometimes a little hard to grasp. LINQ is probably the most significant change but it builds on existing .NET 2.0 functionality including Generics, as well as new language additions such as Lambda expressions and anonymous types.

Extension methods allow you to add static methods to add functionality to existing classes. This may be most useful when you need to add functionality to a library you can reference but not change (such as to someone else's code, or the .NET framework itself). Use with caution as extension methods are not a substitute for proper software architecture.

There are some nice new bits of syntactic sugar. One of these is Automatic Properties. Rather than creating member variables for parameters, I can now create parameters that look like this:

public String FirstName { get; set; }

public Int32 Age { get; set; }

Object and Collection initializers also make it easy to create and assign properties all on the same line.

Visual Studio 2008 and Training Kit

Visual Studio IDE itself doesn't seem to have changed too much. One nice new feature is the ability to target multiple version of the .NET framework within a solution. I used this to switch a couple of libraries in my custom framework to use framework 3.5 features (such as LINQ), while the rest of my class libraries stayed at 3.0.

Many of the changes in the studio target web development, which suits me fine. The split-pane window is a nice way of viewing the code and design views at the same time. CSS support is improved in the GUI by visually showcasing inheritance rules. The AJAX toolkit is included by default, as are WCF and Workflow templates (including SharePoint workflows, hooray!).

Testing is facilitated using Microsoft's MSTest framework which is now available with the Professional version (before it was only available with Team Studio). The online community is keener on MbUnit or Nunit but there's no harm in having a third option that's built-in.

There is a wonderful Visual Studio 2008 RTM Training Kit which provides tutorials and videos to help get users up to speed. From the kit's installed home page:

[The Training Kit] contains a full 5-days of technical content including 20hands-on labs, 28 presentations, and 20 scripted demos.   The technologies covered in the kit include:  LINQ, C# 3.0, VB 9, WCF, WF, WPF, Windows CardSpace, Silverlight, ASP.NET Ajax, .NET Compact Framework 3.5, VSTO 3.0, Visual Studio Team System, and Team Foundation Server.

Five full days of technical content? Better crack open that case of Jolt cola! The kit is publicly available at http://go.microsoft.com/?linkid=7602397.

"Paying Off Debt"

There is an interesting article on eWeek about Microsoft "paying off its debt". Soma Somasegar who is the corporate VP of the Microsoft Developer Division explains how he shut down all engineering on Visual Studio for four months and set everybody concentrating on removing as many bugs as possible.

Following this period, known as "MQ" or Milestone Quality, each feature team was limited to a certain number of outstanding bugs at one time. These actions, referred to as an "engineering investment", resulted in an increase in quality in the product. In fact the Visual Studio team won an internal engineering award from Bill Gates for this effort.

It's an interesting insight into Microsoft's development efforts. Presumably this work will also really pay off for future release of Visual Studio.

What's Next?

Speaking of which, now that the current version is RTM, it's time to look ahead again. Programmers are never satisfied! The Visual Studios "futures" roadmap is posted at

http://msdn2.microsoft.com/de-de/teamsystem/bb407307.aspx.

Rosario is the upcoming Team Edition version and will be next on the block.

As well, Microsoft will be providing a window into the .NET Framework source code within a few weeks. This will prove helpful in debugging, especially with lower-level coding. Scott Guthrie explains exactly how this will work. Currently this sort of framework-spelunking is usually done with Lutz Roeder's Reflector.

The Visual Studio 2008 website is located at http://msdn2.microsoft.com/en-us/vs2008/default.aspx.

Wednesday, October 17, 2007

Public Facing WSS Sites + Silverlight

Last night was another interesting Sydney SharePoint User Group. There were two presentations, one on using Windows SharePoint Services as a public facing CMS site given by Jon Matthes, and another by Michael Kordahi on Silverlight (+ SharePoint!).

Jon gave a very interesting talk about using WSS to rewrite a legacy web application for The Scottish Banner, an online community newsletter for Scots abroad. His aim was to improve on the old PHP website, retain its general design, allow online feedback forms, and produce minimal impact on end users in a cost effective way. He also hoped it would be an opportunity to learn about WSS 3.

The way he approached the site migration was to replicate as much of the existing structure as he could, with the only exception being the addition of the WSS administration area. He created anonymous access to a list to allow people to make submissions to the site while not logged in. An additional feature was the use of image libraries to serve as a simple product catalog, which was a new feature for the site.

Best of all, none of this required code. This turned out to be a good thing, as Jon had no access to the server and the US-based ISP was difficult to reach due to the time zone differences. Unfortunately he was unable to use Themes so some options were unavailable to him while he was doing the redesign.

Jon suggested some take-away lessons from his experience. He pointed out how important it is to use a hosting provider who has knowledge around SharePoint (and preferably one in the same time zone!). Research on what WSS could do and not do out of the box was important, and he also recommended making end user training an important component of any moves to SharePoint.


Michael Kordahi (http://delicategeniusblog.com) from Microsoft then presented Silverlight for us. This is Microsoft's intended Flash killer.

Its selling point is that it's a cross-browser/platform implementation of .NET for "building and delivering the next generation of media and rich applications for the web". Michael explained that its value is intended to lie in its flexible programming model combined with its ability to create rich media experiences.

A key component is its use of XAML, which will be the next generation declarative XML syntax for separating presentation from code and is already used in Windows Presentation Foundation. The goal is to have designers do their creative work in tools such as Expression Blend, and then have developers take the XAML code and code to it in Visual Studio.

There were some pointed questions from members of the user group. Flash can do all of these things currently, but it seems that the case for Silverlight might appear more convincing over time. Version 1.1 allows .NET code to be written on the server, and no doubt future versions will add increased functionality and productivity options. Already in version 1.0, it is easy to create animations and manipulate design objects, and then code to the Silverlight canvas using JavaScript.

Some people also remained unconvinced that the developer/designer split would be solved by this technology - after all that was an intended goal of code-behind. I haven't worked directly with enough designers to assess this problem for myself so I'm reserving judgement.

What was particularly cool about this presentation were all the demos Michael showed us. Tafiti is a neat experiment in changing the search interface to amalgamate multiple search content types. Inkable Search Tip uses the Vista handwriting recognition technology to do freehand searches on Google. Top Banana allowed browser-based video editing. A Chess Game written by Scott Guthrie rounded out the demos.

You can view many of these showcase applications at http://www.silverlight.net. Most of them are proof-of-concepts and showcases of what Silverlight can do, rather than real-world examples. 

All in all, it seems to be a very cool technology and one that'll become a very big deal. Silverlight 1.1 is currently in Alpha release and a preview version of Expression Blend 2 is available to MSDN subscribers.  For more information, Scott Guthrie has some excellent posts on Silverlight at http://weblogs.asp.net/scottgu/archive/tags/Silverlight.

Tuesday, August 28, 2007

LINQ To SQL ≠ N-Tier Architecture?

Ok, LINQ seems pretty wonderful, and I can see the utility of it - and with regards to SharePoint we'll probably end up using it when Microsoft comes out with an official LINQ to SharePoint, or the community does. Heck, it may even replace (or at least abstract) the dreaded CAML code....

With LINQ, you get:

  • Design-time type checking of data queries
  • Code syntax that is consistent across objects, XML, and relational databases (and, really, anything else)
  • Queries are integrated right into the .NET code frameworks
  • Full IntelliSense support when coding what used to be a bunch of string values

All good stuff. But what I don't understand is how it fits with traditional N-Tier architecture. Is this more of the same old "you can write 70% less code if you don't mind your web page directly accessing your database" trend, or can we actually use this in a properly architected application?

I've been following along on Scott Guthrie's blog; he has a detailed series of posts about using LINQ, but he hasn't yet addressed where LINQ might fit in the N-Tier architecture.

Rick Strahl is already blogging about some of the limitations when trying to combine LINQ in the middle tier with POCO (Plain Old C# Objects), but it isn't clear if this is a beta 2 problem or a design limitation. Here's his conclusion:

The more I look at LINQ the more I'm coming to the conclusion that using LINQ in a middle tier - especially in a generic business object architecture - is not going to work well. There are many little problem issues that when all added up point at more problems being created than solved by the entity generation and easy CRUD layer.

Manning Publishing's upcoming LINQ In Action book has an early access program that lets you download PDFs and view chapters as the authors write them (the ink stains on the PDF are still wet!). It's a great read. Incidentally they're the folks behind LINQ to Amazon, which was one of the earliest LINQ extensions that showed up on the 'net.

Chapter 14 of this book talks about how to integrate LINQ into applications. It makes the point that LINQ "out of the box" is more of a Rapid Application Development tool - which goes back to the "70% less code" approach Microsoft is so fond of. However, the book suggests specific concerns that should be noted when trying to use LINQ in a DAL in the traditional way.

LINQ defers calls to the data source until the query is enumerated over, so if you're returning entities or queries to a business layer (in the format IQueryable<Whatever>, you might be introducing a dependency (your business layer is actually calling a LINQ to SQL query at runtime). You can turn off lazy loading by setting the DataContext's DeferredLoadingEnabled property to false, and also by explicitly loading an entity's child records before returning the entity from the DAL.

So, if I understand correctly:

  • LINQ to XML or XSD doesn't seem to foil N-Tier architecture, since LINQ is essentially a tactical solution to make it easier to read or write XML, and doesn't cross any layer boundaries.
  • LINQ to Objects is an in-memory LINQ technique, that again shouldn't cross any boundaries. Your method signatures will consume and provide POCO, and you use LINQ to iterate over them completely within the Presentation or Business layer. So far, so good.
  • The real issue seems to be LINQ to SQL...and issues can be avoided if the LINQ to SQL code is confined entirely to the DAL, lazy loading is turned off, and disconnected entities and lists are passed back out of the DAL to the Business tier. But if you do this, the only apparent advantages of LINQ to SQL over any other ADO.NET data access method is the consistency of coding and the design-time safety of the strongly typed queries (which you can already get with Strongly Typed Datasets!)

Please, can anybody help me understand what an appropriate N-Tier architecture might look like with LINQ To SQL?

Friday, August 24, 2007

SharePoint Development Tips

Mark Jones has an excellent post on best practices for SharePoint development on his blog, entitled "Sharepoint 2007 - Development and Engineering Practices".

He places a great deal of emphasis on team development using Visual Studio and some sort of source control. He further recommends that as much as possible is automated via scripts or code to ensure that you can minimize the deployment effort, avoid errors, and manage code changes and versioning.

He's also a fan of test harnesses and not relying on SharePoint's object model to do all the testing for you.

One of my favourite tips is his advice to customize as a last resort. Although the SDKs and tools are getting better, there's a lot that can be done by configuring what's already out-of-the-box long before any code needs to be touched.  Office 14 is already underway and while I'm sure Microsoft will try to minimize the changes, it's a sure bet that enough will change between versions to make upgrading a roll-your-own portal painful. In fact it's amazing how much can be achieved with just a little thought about the existing features.

Mark's got a lot of great conclusions and ideas in there. I encourage you to check it out.

Thursday, August 23, 2007

The Microsoft SharePoint Team has just announced a major release to the SDKs - version 1.2 of each. The full details are here: http://blogs.msdn.com/randalli/archive/2007/08/22/just-published-major-update-to-the-moss-and-wss-downloadable-sdks-8-22-2007.aspx

This is wonderful news - not only will it make developing to the object model more understandable but there are numerous samples and, best of all, a BDC editor tool! Check this page out:

The Business Data Catalog Definition Editor provides a visual tool for creating an Application Definition for BDC in MOSS 2007. Features include:

  • Underlying XML is abstracted by the design surface and properties window
  • Drag and drop web methods, tables, or views to create line of business (LOB) connections.
  • Entities and methods are created automatically from database metadata and WSDLs.
  • Additional method instances can be added to further enhance the database or web service connection.
  • Method instances can be tested from within the tool, enabling incremental development of LOB connections
Background

Currently, writing an application definition to connect the BDC to a LOB system is a manual process. This requires an understanding of both how the LOB system is configured and what must be included in the XML to satisfy the BDC. Having a tool to simplify this process not only lowers the initial knowledge threshold for administering the BDC, it also lessens the required work of the user (such as testing, making modifications, etc.).

[...]

Highlights
  • Tool supports databases (SQL, Oracle, OLEDB, and ODBC) and web services
  • Drag and drop design surface for selecting DB tables or web methods:
  • Metadata is automatically extracted from databases by dragging and dropping tables
  • Web Services require a few additional steps to completely configure the connection
  • Users can import and export Application Definition XML files
  • Users are able to test method instances incrementally from within the tool
  • The tool is not required to run on a web front-end
  • Associations are created automatically when foreign keys are selected; they can also be created easily for web services by adding an Association method instance

Objectively speaking, the SDK and tool release just made life 100% easier (32.4% of the time)1. You can't argue with those numbers!

The Microsoft team has also stated that it has doubled the resources working on the SDKs, which means we can look forward to even more improvements in the future. They're obviously listening to the community -they even make that point in their announcement - and it's very welcome indeed.

1 Actual results may vary.

Saturday, August 04, 2007

Currently Team Foundation Server uses Windows SharePoint Services sites to host project sites. This provides a useful central point to collect development documentation, workspaces, meeting spaces, and allows people without TFS to at least view the related information (although now there is an additional option, the very cool TeamPlain Web Access for Team System, which is free for all licensed TFS users!).



Unfortunately the current version only supports WSS 2.0 sites. There are some work arounds, but they can be flaky.

The good news is that TFS 2008 will support WSS 3 sites - Abdelhamid Abdou talks about this on his blog in this posting. Better yet, when you setup TFS you are now given the choice to have the SharePoint integration on the same box, or point to an existing SharePoint application on another server.

To learn more about the current workaround, you can read Brian Keller's blog posting here. Brian is a Technical Evangelist for TFS and makes it clear that any modifications to current TFS installations to make them work with WSS 3 are hacks and may not be supported. He does point to Mike Glaser who blogged extensively about how to upgrade to WSS 3 sites.

Incidentally, as of July 30, Readify in Australia has released TFS hosting "in the cloud"! This could be very huge for small ISVs or consultants that want to have enterprise development tools without the upfront expense or maintenance effort! The service starts at $995 AUD a month and more info can be found at http://www.tfsnow.com/.

Friday, July 27, 2007

The Beta 2 of Visual Studio 2008 (aka "Orcas") has been released. To download it, point your browser at http://msdn2.microsoft.com/en-us/vstudio/aa700831.aspx.

If you're using the VPC version you'll first have to download and install the base virtual hard disk, Base01.vhd. It's available here.

After extracting the VPC or DVD, you'll also have to download and run a script to prevent the beta from messing up any existing Ajax development you may be working on.

Finally, if you are using the VPC image you can log onto the box using the username "Administrator" and the password "P2ssw0rd". It will prompt you to change the password once you log in for the first time.

Scott Guthrie has been blogging about many of the cool features that are contained in Visual Studio 2008.

Some of the things that I hope to try over the next few days:

  • Working with Linq, especially trying to figure out how it would work in an n-tier architecture;
  • Nesting master pages;
  • Trying out the enhanced CSS support;
  • Using the embedded Ajax framework and enhanced JavaScript intellisense and debugging.

Happy coding!