www.steria.com Steria approach to SharePoint Development SharePoint Application Lifecycle Management Development, build and deployment environments Filip Lindboe Steria
The Company Steria: Rådgivning, projekt ledelse, systemudvikling, infrastruktur, drift og hosting. Off-/Nearshore i Indien, Østeuropa og Marokko Repræsenteret i Europa Belgien Danmark Tyskland Frankrig Repræsenteret i 16 lande... Hongkong Indien Luxembourg Marokko Norge Østrig Polen Singapore Spanien Sverige Schweiz UK www.steria.com 06.06.2011 2
The Company Blandt de ti førende it-serviceleverandører i Europa. 13 Mia. Dkr omsætning (Top 10 in Europa) 20.000 Medarbejdere Präsenz in Europa 185 Medarbejdere i danmark Off-/Nearshore i Indien, Østeuropa og Marokko www.steria.com 06.06.2011 3
Udvalgte danske referencer e-clearance.dk et webbaseret toldsystem med 600 brugere og dagligt mere end 5.000 importangivelser via Web eller EDI Workflow og kundekontaktcenterløsning til betjening af over 1 million privatkunder Steria trafikledelsessystem Traffic Expert til trafikregulering i forbindelse med udvidelsen af Motorring 3 fra fire til seks spor Citrix-løsning gav Videnskabsministeriet effektive og velfungerende hjemmearbejdspladser Workflow og kundekontaktcenter- løsning til betjening af 730.000 privatkunder og erhverskunder CRM-system, der giver ATPs kundeservicemedarbejdere i SP-ordningen et 360 graders overblik over den enkelte kunde. Outsourcing med ansvar for systemdrift, vedligeholdelse og HelpDesk i et blandet Unix- og Windows-miljø Kundekontaktcenter til styring af ind- og udgående kundebetjening af 800.000 privatkunder og 100.000 erhvervskunder Udvikling af en hostet Workflow-løsning til ASP-løsning til ProCons sagsbehandling i administrative system helbredsbetingede sager www.steria.com 6/6/2011 for 310.000 medlemmer p4 Workflow-løsning med dokumentindscanning og elektronisk sagsmappe til betjening af over 300.000 kunder Implementering af Desktop Management-system og dermed højere tilgængelighed for brugerne samt aflastning af IT-funktionen
What is Application Lifecycle Management Application Lifecycle Management is a continuous process of managing the life of an application through governance, development and maintenance ALM is the marriage of business management to software engineering made possible by tools that facilitate and integrate requirements management, architecture, coding, testing, tracking, and release management. Solution Deployment Quality Assurance Operate Application Lifecycle Testing Requirements Management Solution Architecture Development www.steria.com 06/06/2011 06.06.2011 5 5 Confidential - Presentation name.ppt
Challenges in ALM for SharePoint Application Lifecycle Management Complex is a continuous process of Deployment managing the life of an application through governance, development and maintenance No Code Metrics ALM is the marriage of business management to software engineering made possible by tools that facilitate and integrate requirements management, architecture, coding, testing, tracking, and release management. Solution Deployment Quality Assurance No Code Analysis Operate Complex Webtesting Application Lifecycle Testing Requirements Management Solution Architecture Complex Development Development Complex UnitTesting www.steria.com 06/06/2011 06.06.2011 6 6 Confidential - Presentation name.ppt
Team Foundation Server Development Roles and Responsibilities Project Managers Project Planning Task Assignment Bug Tracking Business Analysts Requirements Management QoS Management Requirements Analysis Development Execs Portfolio Management Project Organization Stakeholder Communication Architects Architecture Modeling Analysis and Design Design for Deployment Operations Customer Support Infrastructure Architecture Infrastructure Deployment Testers Developers Test Case Management Code Analysis Manual Testing Unit Testing Load Testing Version Control Automated Testing www.steria.com 06/06/2011 7 Confidential - Presentation name.ppt Designers UI Design UI Prototyping UI Flow Modeling
SharePoint Challenge Challenge 1: Create SharePoint code fast and with a high quality according to naming conventions and coding guidelines www.steria.com 06.06.2011 8
SharePoint SharePoint Code consists of a lot different files Sample: Visual Webpart, in Feature with FeatureReceiver, multilanguage Resource-File für Mehrsprachigkeit, (.RESX) ControlTemplate (UserControl), (.ASCX) WebPart-Beschreibung (.WEBPART) Feature (.XML) WebPart Icon (.GIF) WebPart Code (.CS) FeatureReceiver Code (.CS) CAS-Policy für BIN-Deployment (.XML) www.steria.com 06.06.2011 9
SharePoint Development SharePoint-Customizations must be installed into the setup folder of SharePoint on each machine in the farm Standard SharePoint- Features Extensions www.steria.com 06.06.2011 10
SharePoint Development SharePoint projects contains a lot of XML code www.steria.com 06.06.2011 11
SharePoint Software Factory SPSF SharePoint Software Factory Developed by Steria Integrates into Visual Studio 2010 and 2008 Creates SharePoint Code with help of wizards Based on Microsoft Guidance Automation Extensions (GAX) Open Source Projects http://spalm.codeplex.com http://spsf.codeplex.com www.steria.com 06/06/2011 06.06.2011 12 12 Confidential - Presentation name.ppt
SharePoint Software Factory Integrated into Visual Studio 2010/2008 www.steria.com 06.06.2011 13
SharePoint Software Factory Wizards collect additional information www.steria.com 06.06.2011 14
SharePoint Software Factory... helps to find Ids and GUIDs,... www.steria.com 06.06.2011 15
SharePoint Software Factory...and generates all necessary files according to naming conventions www.steria.com 06.06.2011 16
SharePoint Software Factory Free project on Codeplex www.steria.com 06.06.2011 17
SharePoint Challenge Challenge 2: Create correct SharePoint code www.steria.com 06.06.2011 18
Build correct code Challenge: SharePoint projects contain a lot of xml... e.g. for Content Type List Templates List Instances Features Fields ContentTypeBindings Workflows CustomAction HideCustomAction Module Site Definitions etc. www.steria.com 06.06.2011 19
Building correct code Problem: XML in Visual Studio projects is not validated during build. This code is incorrect...but will compile without errors. MSDN: The ActivateOnDefault attribute does not apply to site collection (Site) or Web site (Web) scoped Features. And the wrong code will lead to problems during: Build? NO FxCop Code Analysis? NO Installation? NO Run? YES www.steria.com 06.06.2011 20
Building correct code Solution: SharePoint Code Analysis ShareCop checks also the XML code during build (local build and team build) and double click on error message opens the wrong xml file and jumps to the incorrect xml tag. ShareCop www.steria.com 06.06.2011 21
SharePoint Code Analysis How it works? Deserialize XML to Objects in memory www.steria.com 06.06.2011 22
SharePoint Code Analysis...and apply rules on this model This is the rule for checking the property ActivateOnDefault for each feature in the project: ShareCop www.steria.com 06.06.2011 23
SharePoint Challeng Challenge 3 Build an installable SharePoint package www.steria.com 06.06.2011 24
Building an installable package Challenge: Output of SharePoint projects must be installed on several farms during deployment. Test Integration Production www.steria.com 06.06.2011 25
Building an installable package Problem: Building a SharePoint project will not create a installable package Building in Visual Studio places all WSP Solution files in separate folders or the Team Build places all together in a drop location. But now the developer needs to create a setup project manually to allow automatic deployment on TEST, INTEGRATION and PRODUCTION farm, www.steria.com 06.06.2011 26
Building an installable package Solution: SPALM provides a project template for deployment and generates a installable package during each build A separate setup project is available in each solution which builds the output as an installable package with batch and msbuild files www.steria.com 06.06.2011 27
SharePoint Challeng Callenge 4: Run custom steps after deployment www.steria.com 06.06.2011 28
Run custom steps after deployment Challenge: During installation often several additional steps must be performed Installation Steps 1. Deploy Solution to WebApp http://tfsrtm08 2. Activate Feature DE6E1F2D-6409 in Site collection http://tfsrtm08/root. 22. Create Quota Template Limit S 23. Create Managed Path intranet. 55. Enable Usage Analysis in SSP http://tfsrtm:13856 www.steria.com 06.06.2011 29
Run custom steps after deployment Problem: New functionality in Visual Studio 2010 only works locally on the developement machine www.steria.com 06.06.2011 30
Run custom steps after deployment Solution: SPALM uses msbuild to allow a full automated installation process for different environments Installation is scripted and parametrized e.g. $(WebAppUrl) Different parameter values are used for different environments www.steria.com 06.06.2011 31
SharePoint Challenge Challenge 5: Calculate Code Metrics of SharePoint code www.steria.com 06.06.2011 32
Calculate Code Metrics Challenge: SharePoint projects contain lot of XML, ASPX, CSS etc. www.steria.com 06.06.2011 33
Calculate Code Metrics Problem: Visual Studio can only calculate code metrics for code Running Calculate Code Metrics on a SharePoint project with 200 lines of xml......returns Lines of Code = 0, Maintainability Index = 100...and the TFS reports for code churn, project progress etc. are based on these numbers www.steria.com 06.06.2011 34
Calculate Code Metrics Solution: ShareLog can calculate code metrics from SharePoint code This can be simple metrics e.g. Count of Features, Workflows, ContentTypes etc. Count of external dependencies Count of WSP-Packages in an application Metrics like Maintainability can be calculated based on these numbers E.g. Large number of Content Types reduces Maintainability www.steria.com 06.06.2011 35
SharePoint Challenge Challenge 6: Dependency Analysis www.steria.com 06.06.2011 36
Dependency Analysis Challenge: Dependencies in SharePoint are stored in XML Code <?xml> <Feature Id="19bdd1ba-e856-48f1-b299-3734bbc16dec" Title= ContentTypes" ReceiverAssembly="CommonComponents.dll"> <ActivationDependency FeatureId= e7e3480e-38fb-4f4f-a08b-6cd93efd9e83 /> </Feature> <?xml> <ContentType ID="0x010100C568DB52D9D0A1 Name= CustomPage > <FieldRefs> <FieldRef ID="{8719A43A-7BC9-48a0-A508-D3F53D261733} /> </FieldRefs> </ContentType> www.steria.com 06.06.2011 37
Dependency Analysis Dependency can be across WSP Packages and different types of elements CommonElements.WSP Feature Content Types Site Template Workspace Assembly FeatureReceiver Assemblies.WSP Feature Fields Components.WSP Standard-Feature Publishing MOSS Features www.steria.com 06.06.2011 38
Dependency Analysis Solution: ShareLog Code Analysis includes SharePoint Artefacts into the dependency graph www.steria.com 06.06.2011 39
SharePoint Challenge Challenge 7: Ensure high coding quality www.steria.com 06.06.2011 40
Coding Quality Challenge: SharePoint code uses a lot of XML and a lot of different files in a project Naming convention for files in a project are very important (e.g. for feature names) Some companies want that their company name must be present in folder and file names www.steria.com 06.06.2011 41
Coding Quality Problem: Microsoft StyleCop can only check C# source code Running Run StyleCop on a SharePoint project......only checks AssemblyInfo.cs www.steria.com 06.06.2011 42
Coding Quality Solution: SharePoint Software Factory helps the developer to create code according to naming conventions and coding guidelines Software Factory places comments into XML......and helps with correct naming of features and folders www.steria.com 06.06.2011 43
Coding Quality Solution: ShareLog Code Inspector checks that filenames are created according to the naming conventions Here each feature name must start with the company name www.steria.com 06.06.2011 44
www.steria.com Thank you for your attention Steria
What s next? Projects at Codeplex spalm.codeplex.com SPSF SharePoint Software Factory SPCop SharePoint Code Analyse ShareLog SharePoint Code Inspector Kontakt: Mail Linked-in Blog FLI@steria.dk http://www.linkedin.com/in/sharepointfilip Sharepointfilip.wordpress.com www.steria.com 06.06.2011 46