SharePoint Layered Architecture App

Ovidiu Becheş-Puia
  • SharePoint Layered Architecture App Ovidiu Becheş-Puia

    Do you use enterprise layer architecture when creating SharePoint solutions ? Can you give me a codeplex.com/other site project as example, where I can find a layered design ? (Interface/BL/DAL)

  • I use layered architecture in all my SharePoint solutions and treat SharePoint generally as the UI layer, keeping it very thin. Any logic goes into the business model and I have DAL wrappers to abstract away the List infrastructure (which also helps with testing).

    For a good read on layered architecture in ASP.NET check out this article here. It's ASP.NET and NHibernate, but the principles are the same. There's also a layered architecture sample in .NET here on CodePlex. Again, not SharePoint specific but the principles are the same.

    Keep the SharePoint UI thin and resist the temptation to start reading/writing to lists in your web part code. Treat it like a database (because it is!)

  • Agree with Bil.

    Web parts, web controls, application pages etc should only be the UI layer that calls into a layer that is agnostic of the original calling context; calling context could be an event receiver, console application, timer job, workflow, etc. Always ensure that this shared layer you call into does not have a dependency on SPContext.Current since it isn't always there! Accept SPWebs, SPLists, SPLisItems etc as method parameters and constructor parameters. In a web context you can pass these from the SPContext.Current, but in a Console Application you would construct these yourself.

    To improve ease of debugging (just press F5) and shorten the developer feedback cycle, I often start off writing a simple Console Application which calls into the layer that will contain the core logic, passing in an SPWeb which I constructed in the Console Application. Once the core logic is finished, I write a thin WebControl or WebPart to replace the Console app, read the SPWeb from the context instead of constructing it, set up event handlers etc.

Tags
development design architecture
Related questions and answers
  • Is it possible to extend the activity stream in SP2010? Out of the box, the activity only contains data from a user's mysite and profile changes. I would like to feed in a user's activity from other sites within the farm. For example, if there is a team site in the farm which has a discussion board and the user starts a new discussion or posts a reply, I would like his followers to know about the update. The update should only be seen by the user's followers who has access to that team site. Also, it would be great if you can direct me to an article that talks about the architecture

  • I went through the SharePoint Escalation team blogs and understood the basic architecture of the "User Profile Import" and still would like to know the architecture of the "Audience Compilation" and how it uses "User Profile Import" ? Help me with thoughts?

  • On the first page of our web app we want some "boxes" with a image and some links. What is the best approach for this? My first guess is to render data from a custom list. For this I need very custom HTML, is XLV a good solution? I had a look at sharepoint-2010-list-view-blog-series-part-3-list-view-architecture, but I'm not quite sure how to do this. If I use designer I won't get any usable XSL, if I edit it I will get tons of XSL I don't need. I just need a basic example of how I can render my fields within simple HTML.

  • I'm currently going through the SharePoint Planning and Architecture documentation, planning a SharePoint installation. I'm on the section "Determine Sites and Subsites". One of the things suggested to take into account for each site is what site template you will base it on. A number of the sites on our site will be existing ASP.NET applications that we're embedding into the new SharePoint... for a while. I would simply envisage us having a link on either our global navigation, or the current navigation (the vetical menu on the left..), which when clicked upon brings up the issue tracker

  • Symptoms: You have installed and run the Visual Studio Remote Debugger on your SharePoint server. You can debug the IIS worker process in the terminal session on the server. You cannot connect to the Remote Debugger from your development workstation. Network response packets show "WebDAV MiniRedir ... PROPFIND not implemented" messages.

  • SharePoint Server 2010 is a fantastic product! However, I'm sure you have some great ideas for v.Next. What features do you believe could be improved for SharePoint 15? One topic per answer please (you can leave multiple answers) so the community can vote. (Question inspired by Project 15 Wish List post.)

  • How can you change the SharePoint 2010 Central Administration site so that it works over SSL, rather than a random port over http? Other sites on the server may also use SSL, so would use a host header to differentiate between them (e.g. admin.contoso.com for central admin, docs.contoso.com for documents etc). Edit: Can't set host headers with https in IIS, even though you can add a https... secure site, or do you also have to run 'stsadm' to tell SharePoint you have done this as well?

  • From SharePoint Designer it is possible to modify the edit and display list forms. From the ribbon in ListSettings tab select Design Forms In InfoPath and choose the content type you want to modify forms for. InfoPath will open with a generated form and the form can be modified. My question is when you publish the form from InfoPath to a SharePoint List is it posible to export the list and import it to list in SharePoint Foundation or are the forms dependent on InfoPath ?

  • A client is asking for a custom application to be created and deployed within the corporate intranet. Part of the requirements are to publish some of the content also available on the internet site. Both sites are built on SharePoint 2007 but they are on different farms and on different networks. Can the Content Deployment API (and associated tools) handle moving selected content across networks with no direct connectivity? Can we use web services? Has anybody done this sort of thing? If so what approaches have you taken? Thanks, James.

Data information