development session
DESCRIPTION
SharePoint 2007 DevelopmentTRANSCRIPT
Development sessionSharePoint, NHibernate and Castle Windsor
container
Moutasem Al-awa Senior Software Engineer at Technology
World Company (TWC) Twitter: @moutasema Email: [email protected]
Presenter
Current Problems
SharePoint
Too many Projects. No modularity. No standards, or common way for
structuring code. Duplicated files (such as ASCX). Code maintaining is a HELL . Dependency on Site Url to access lists and
items. Performance issues.
Current problems
Proposed Solutions
SharePoint
Better Code StructureSharePoint
SharePoint code structure
Twc.Client.SharePoint
Twc.Client.Web
Twc.Client.Business
Twc.Client.DataAccess
Twc.C
lient.U
tility
Twc.C
lient.E
ntit
y
How to deploy User controls ?
How to GAC other assemblies ?
SharePoint code structure
Visual studio Build events Disable UAC, or run Visual studio as
administrator Copy user controls : xcopy "$
(ProjectDir)UserControls\*.ascx" "C:\Program Files\Common Files\microsoft shared\Web Server Extensions\12\TEMPLATE\CONTROLTEMPLATES\UserControls\" /s /y
SharePoint code structure
GAC Assembly : "C:\Program Files\Microsoft SDKs\Windows\v6.0A\Bin\gacutil.exe" /i "$(TargetPath)" /f
NOTE: When adding reference to SharePoint solution change CopyLocal property to False.
SharePoint code structure
Use Utility ClassesSharePoint
Provide unified way to interact with SPWeb SPSite SPList
Provide helper methods such as: Is user in a particular group (Soni, Admins) => Give me the absolute Url (/Arabic/Sites/Admins/)
=> http://server/Arabic/Sites/Admins/ More work, means better code base.
SharePoint Utility Class
Always .. Yes Always Dispose SPWeb, and SPSite (Using statement)
SharePoint
Always .. Yes Always Dispose SPWeb, and SPSite (Using statement)
SharePoint
WSPBuilder .. Base for our deployment tool
SharePoint
Thank You