• Save
Developing SharePoint 2010 and Silverlight web parts
Upcoming SlideShare
Loading in...5
×
 

Developing SharePoint 2010 and Silverlight web parts

on

  • 930 views

My presentation from http://2012.itcamp.ro/

My presentation from http://2012.itcamp.ro/

Statistics

Views

Total Views
930
Views on SlideShare
929
Embed Views
1

Actions

Likes
0
Downloads
0
Comments
0

1 Embed 1

http://us-w1.rockmelt.com 1

Accessibility

Categories

Upload Details

Uploaded via as Microsoft PowerPoint

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment
  • -class A uses Service A & B – high coupling-can not replace easy, at runtime the Service classes
  • If a type mapping for a particular interface is defined at both the site collection scope and the farm scope, then the site collection mapping will take precedence. If an SPContextobject is not available—in a timer job, for example—then the GetCurrent() method will return a service locator that loads farm-only type mappings. A second overload, GetCurrent(SPSite), will load type mappings from the specified site collection and merge them with the farm-scoped type mappings. This method overload is useful when an SPContext object is not available but you want to use type mappings defined in a particular site collection.
  • The Model-View-ViewModel (MVVM) pattern is an application pattern that isolates the user interface from the underlying business logic. MVVM belongs to a class of patterns called Separated Presentation. These patterns provide a clean separation between the UI and the rest of the application. This improves the testability of the application and allows the application and its UI to evolve more easily and independently. The MVVM pattern consists of the following parts:The Model, which provides a view-independent representation of your business entities. The design of the model is optimized for the logical relationships and operations between your business entities, regardless of how the data is presented in the user interface. The View class which is the user interface. It displays information to the user and fires events in response to user interactions. The ViewModel class, which is the bridge between the view and the model. Each View class has a corresponding ViewModel class. The ViewModel retrieves data from the Model and manipulates it into the format required by the View. It notifies the View if the underlying data in the model is changed, and it updates the data in the Model in response to UI events from the View.

Developing SharePoint 2010 and Silverlight web parts Developing SharePoint 2010 and Silverlight web parts Presentation Transcript

  • Developing SharePoint 2010 and Silverlight Web Parts – Tips and Tricks Ovidiu Becheș-Puia SharePoint Developer EBS Romania ovidiu.beches@ebs.ro@ itcampro # itcamp12 Premium conference on Microsoft technologies
  • Architecture &ITCamp 2012 sponsors Best Practices@ itcampro # itcamp12 Premium conference on Microsoft technologies
  • Architecture &Agenda Best Practices• SharePoint Developer Tools• ASP.NET and Silverlight Web Parts• SPG (SharePoint Pattern&Practices Guidance)• Unit Testing in SharePoint• DEMOS@ itcampro # itcamp12 Premium conference on Microsoft technologies
  • Architecture &Intro Best Practices What means to me developing and working with SharePoint ?@ itcampro # itcamp12 Premium conference on Microsoft technologies
  • Architecture &Intro Best Practices@ itcampro # itcamp12 Premium conference on Microsoft technologies
  • The SharePoint Developer Toolbox TOOLS@ itcampro # itcamp12 Premium conference on Microsoft technologies
  • Architecture &TOOLS Best Practices• SPM 2010@ itcampro # itcamp12 Premium conference on Microsoft technologies
  • Architecture &TOOLS Best Practices• ULS Viewer@ itcampro # itcamp12 Premium conference on Microsoft technologies
  • Architecture &TOOLS Best Practices• .NET Reflector / JustDecompile@ itcampro # itcamp12 Premium conference on Microsoft technologies
  • Architecture &TOOLS Best Practices• Fiddler2 / Firebug@ itcampro # itcamp12 Premium conference on Microsoft technologies
  • Architecture &TOOLS Best Practices• CKS – Community Kit for SharePoint@ itcampro # itcamp12 Premium conference on Microsoft technologies
  • Architecture &TOOLS Best Practices• SPSF – SharePoint Software Factory@ itcampro # itcamp12 Premium conference on Microsoft technologies
  • Architecture &TOOLS Best Practices• Linq to SharePoint DSL Extension for VS2010@ itcampro # itcamp12 Premium conference on Microsoft technologies
  • Developing ASP.NET and Silverlight WebParts WEB PARTS@ itcampro # itcamp12 Premium conference on Microsoft technologies
  • Architecture &Web Parts Best Practices@ itcampro # itcamp12 Premium conference on Microsoft technologies
  • Architecture &Web Parts Best PracticesMy GOLDEN RULE (GOAL)It would be so much easier if we could avoid usingSharePoint server to develop Web Part / anything The F5 Build/Deploy/Test cycle is slow….@ itcampro # itcamp12 Premium conference on Microsoft technologies
  • Architecture &Web Parts Best PracticesWhen not to use SharePoint:-if your WebPart does not use SharePoint calls-use a simple ASP.NET Web Application – test harness-statically declare WebParts in aspx – so no need tohandle personalisation The F5 Build/Deploy/Test cycle is slowww..@ itcampro # itcamp12 Premium conference on Microsoft technologies
  • SharePoint 2010 Pattern & Practices Guidance SPG@ itcampro # itcamp12 Premium conference on Microsoft technologies
  • Architecture &SPG Best Practices(Coding) Challenges when creating enterpriseapplications:• Testability – can you isolate your classes• Flexibility – Can you update or replace code without recompiling• Configuration – How do you manage configuration settings?@ itcampro # itcamp12 Premium conference on Microsoft technologies
  • Architecture &SPG Best Practices(Coding) Challenges when creating enterpriseapplications:• Logging and exception handling – How do you log ? Consistent across the team• Maintainability - How can you maintain code that is always evolving• Can your code run in the Cloud (Office 365) - Without Full trust proxy@ itcampro # itcamp12 Premium conference on Microsoft technologies
  • Architecture &SPG Best Practices• Main patterns illustrated (with reference applications in the SPG)-Service Locator pattern-MVP pattern (Model-View-Presenter)-MVVM pattern (Model-View-ViewModel)-Repository pattern@ itcampro # itcamp12 Premium conference on Microsoft technologies
  • Architecture &SPG: Service Locator pattern Best Practices@ itcampro # itcamp12 Premium conference on Microsoft technologies
  • Architecture &SPG: Service Locator pattern Best Practices Mappings add on Farm level Can be added using only: -farm feature / CA Web App -console app Mappings add on Site Coll. level Get Service Locator -Site Collection (if SPContext ) -Farm@ itcampro # itcamp12 Premium conference on Microsoft technologies
  • Architecture &SPG:MVP (Model-View-Presenter) Best Practices-MVP originated in early 1990s-MVP is a derivative of MVC-Two types of implementation – Passive View – Supervising Controller-Presenter assumes the functionality of theMVC controller-View is responsible for handling UI events-Model becomes strictly a Domain Model@ itcampro # itcamp12 Premium conference on Microsoft technologies
  • Architecture &SPG:MVP (Model-View-Presenter) Best Practices@ itcampro # itcamp12 Premium conference on Microsoft technologies
  • Architecture &SPG:M-V-VM Best Practices• Largely based on MVC• Specialization of the MVP pattern known as Presentation Model• Build specifically for the WPF and Silverlight• ViewModel is a “Model of the View” -it extends the Model with Behaviours the View could use -Data binding between View and Model -Passes commands between the View and Model@ itcampro # itcamp12 Premium conference on Microsoft technologies
  • Architecture &SPG:M-V-VM Best Practices@ itcampro # itcamp12 Premium conference on Microsoft technologies
  • Architecture &SPG:M-V-VM Best PracticesThe Model - which provides a view-independentrepresentation of your business entitiesThe View - which is the user interface. It displays informationto the user and fires events in response to user interactionsThe ViewModel - which is the bridge between the view and themodel.@ itcampro # itcamp12 Premium conference on Microsoft technologies
  • Architecture &SPG:M-V-VM Best Practices How about JavaScript / HTML5?@ itcampro # itcamp12 Premium conference on Microsoft technologies
  • Architecture &SPG: Repository Pattern Best Practices@ itcampro # itcamp12 Premium conference on Microsoft technologies
  • Architecture &SPG: Repository Pattern Best Practices Choosing a SharePoint Data Access Technology@ itcampro # itcamp12 Premium conference on Microsoft technologies
  • Unit Testing in SharePoint World UNIT TESTS@ itcampro # itcamp12 Premium conference on Microsoft technologies
  • Architecture &UNIT TEST Best PracticesOnly Integration Tests with MSTest - Visual Studio 2010 SP1SPListCollection – internal ctors.Isolation Frameworks: -Typemock – not free -Pex and Moles – free@ itcampro # itcamp12 Premium conference on Microsoft technologies
  • Architecture &UNIT TEST Best Practices Mocking the „Principle of Isolation‟@ itcampro # itcamp12 Premium conference on Microsoft technologies
  • Architecture &UNIT TEST Best PracticesTDD and SharePoint-reducing the cost of change-in a typical SharePoint project, the portionwhere TDD is actually applicable is very smallwhich is the writing code part Sahil MalikTDD + SharePoint ? Not worth it IMHO.@ itcampro # itcamp12 Premium conference on Microsoft technologies
  • Architecture &UNIT TEST Best PracticesTDD and SharePointa typical SharePoint project:• Customer communication and prototyping• Plenty of attention to the IT Pro side, where you decide logical and physical layouts of your servers, networks, and your site collections• A significant effort in branding Sahil Malik• Focus on scalability• Writing some code• Establishing roles within your team (overlap with IT Pro guys)• Training required• large portions of XML@ itcampro # itcamp12 Premium conference on Microsoft technologies
  • Architecture &UNIT TEST Best Practices Pex and Moles - Peli de Halleux – Microsoft Research@ itcampro # itcamp12 Premium conference on Microsoft technologies
  • Vă mulțumesc Q&A@ itcampro # itcamp12 Premium conference on Microsoft technologies
  • Architecture &Conclusions Best Practices@ itcampro # itcamp12 Premium conference on Microsoft technologies