Integrating SharePoint
2010 and Visual Studio
LightSwitch



Rob Windsor
rwindsor@allin.com
@robwindsor          #spsvb
Sponsors
About Me
•   Lead SharePoint Consultant with Allin Consulting
•   Technical Contributor to the Pluralsight On-Demand Library
•   Microsoft MVP, MCPD, MCT
•   Founder and Past-President of the North Toronto .NET UG
•   Co-author of Prof. Visual Basic 2010 and .NET 4 (Wrox)
Disclaimers
• I am just learning LightSwitch
    That is, I’m not an expert on the subject
    I want to understand what it is and how it works
    Most of this content is “borrowed” from a TechEd talk by Robert Green
       http://channel9.msdn.com/Events/TechEd/NorthAmerica/2011/DEV211
• This session is about sharing what I’ve learned
    I’m not making judgments about whether LightSwitch is better or
     worse than any other available technologies
• Additional disclaimers
    Attending this session may cause: blurred vision, headache, or
     nausea
What is Visual Studio LightSwitch?
• According to Microsoft

 Visual Studio LightSwitch is the simplest way
    to create business applications for the
            desktop and the cloud


• Learn more at the LightSwitch Developer Center
   • http://msdn.microsoft.com/en-us/lightswitch/default.aspx
Motivation for LightSwitch
• LightSwitch is a development tool that
    Is designed to be used by business users
         In the same way they are using Excel and Access today
    Is designed to be used by developers
         Apps can be transitioned to devs if they grow beyond the workgroup
    Has built-in “plumbing” to handle common application requirements
    Uses the latest Microsoft technologies
         Silverlight, Entity Framework, WCF, SQL Server
      Uses well-known architectural patters
      Builds scalable applications
      Is extensible
      Supports Wizard driven deployment
LightSwitch Simplifies Development
• Data
    Multiple sources / kinds (including SharePoint)
    Entity model
• Screens
    No markup solution
    Extensible controls
    Extensible layouts
• Rules and validation
    Write once, execute everywhere
The LightSwitch Development Experience
DEMO
Introduction to Visual Studio
LightSwitch
LightSwitch Application Overview
    Client Tier




                                      Middle Tier




                                                                     Data Access
                  Data Workspace                    Data Workspace
                     WCF RIA                           WCF RIA




                                                                                   SQL Server


                                                                                                            SharePoint
                                                                                                SQL Azure



                                                                                                                         Other …
                     Services                          Services
                   Silverlight 4.0                   ASP.NET 4.0

                  Browser   Desktop                    IIS 7.0
                   Host      Host                   Windows Azure
Entities
• Can be local (SQL Server Express) or attached (SQL
  Server, SQL Azure, SharePoint, WCF RIA service)
• Can create relationships within and across data sources
• Custom business types
    Provide validation and formatting
• Calculated properties
    Write code to generate value
• Can validate at the entity or property level
Screens
• Variety of built in screens
    New, search, details, editable grid, list and details
• Can use auto-generated screens for adding/editing or
  create your own
• Developers can modify screens at design-time and runtime
• Always based on queries
• Generated screens do not expose XAML
    You can use Silverlight controls you create yourself
    You can add UI elements packaged as extensions
Queries
• LightSwitch creates queries automatically
    Select * query is a collection, eg. CustomerCollection
    Select where query is a detail, eg. CustomerDetail
• You can edit existing queries
    Filter, sort, add parameters
• You can create new queries
• You can base queries on other queries
The LightSwitch Development Experience
DEMO
Entities, Screens, Queries,
and Code
Access Control
• Authentication
    LightSwitch supports Windows and Forms authentication
• Authorization
    Check if the user is allowed to do something
    Define permissions and check them in code at entity
     and property level
    Permissions are granted through administration screens
Access Control
•   Permissions are defined by the developer
•   The application’s administrator(s) define(s) users and roles
•   Permissions are assigned to roles
•   Users are assigned to roles
•   A user’s effective permissions are the combined
    permissions assigned to their roles
Deployment Options
• 2-tier desktop application
    Application runs entirely on user’s computer
• 3-tier desktop application
    User interface runs on user’s computer
    Middle-tier components run on Internet Information
     Services (IIS) or Windows Azure
• 3-tier web application
    User interface is browser based
    Middle-tier components run on IIS or Windows Azure
DEMO
Access control and
deployment
Thank You
• Big thanks to the organizers, sponsors and you for making
  this event possible
• Please fill out your evaluation
• Please keep in touch


    rwindsor@allin.com
    @robwindsor
    msmvps.com/blogs/windsor

Integrating SharePoint 2010 and Visual Studio Lightswitch

  • 1.
    Integrating SharePoint 2010 andVisual Studio LightSwitch Rob Windsor rwindsor@allin.com @robwindsor #spsvb
  • 2.
  • 3.
    About Me • Lead SharePoint Consultant with Allin Consulting • Technical Contributor to the Pluralsight On-Demand Library • Microsoft MVP, MCPD, MCT • Founder and Past-President of the North Toronto .NET UG • Co-author of Prof. Visual Basic 2010 and .NET 4 (Wrox)
  • 4.
    Disclaimers • I amjust learning LightSwitch  That is, I’m not an expert on the subject  I want to understand what it is and how it works  Most of this content is “borrowed” from a TechEd talk by Robert Green  http://channel9.msdn.com/Events/TechEd/NorthAmerica/2011/DEV211 • This session is about sharing what I’ve learned  I’m not making judgments about whether LightSwitch is better or worse than any other available technologies • Additional disclaimers  Attending this session may cause: blurred vision, headache, or nausea
  • 5.
    What is VisualStudio LightSwitch? • According to Microsoft Visual Studio LightSwitch is the simplest way to create business applications for the desktop and the cloud • Learn more at the LightSwitch Developer Center • http://msdn.microsoft.com/en-us/lightswitch/default.aspx
  • 6.
    Motivation for LightSwitch •LightSwitch is a development tool that  Is designed to be used by business users  In the same way they are using Excel and Access today  Is designed to be used by developers  Apps can be transitioned to devs if they grow beyond the workgroup  Has built-in “plumbing” to handle common application requirements  Uses the latest Microsoft technologies  Silverlight, Entity Framework, WCF, SQL Server  Uses well-known architectural patters  Builds scalable applications  Is extensible  Supports Wizard driven deployment
  • 7.
    LightSwitch Simplifies Development •Data  Multiple sources / kinds (including SharePoint)  Entity model • Screens  No markup solution  Extensible controls  Extensible layouts • Rules and validation  Write once, execute everywhere
  • 8.
  • 9.
    DEMO Introduction to VisualStudio LightSwitch
  • 10.
    LightSwitch Application Overview Client Tier Middle Tier Data Access Data Workspace Data Workspace WCF RIA WCF RIA SQL Server SharePoint SQL Azure Other … Services Services Silverlight 4.0 ASP.NET 4.0 Browser Desktop IIS 7.0 Host Host Windows Azure
  • 11.
    Entities • Can belocal (SQL Server Express) or attached (SQL Server, SQL Azure, SharePoint, WCF RIA service) • Can create relationships within and across data sources • Custom business types  Provide validation and formatting • Calculated properties  Write code to generate value • Can validate at the entity or property level
  • 12.
    Screens • Variety ofbuilt in screens  New, search, details, editable grid, list and details • Can use auto-generated screens for adding/editing or create your own • Developers can modify screens at design-time and runtime • Always based on queries • Generated screens do not expose XAML  You can use Silverlight controls you create yourself  You can add UI elements packaged as extensions
  • 13.
    Queries • LightSwitch createsqueries automatically  Select * query is a collection, eg. CustomerCollection  Select where query is a detail, eg. CustomerDetail • You can edit existing queries  Filter, sort, add parameters • You can create new queries • You can base queries on other queries
  • 14.
  • 15.
  • 16.
    Access Control • Authentication  LightSwitch supports Windows and Forms authentication • Authorization  Check if the user is allowed to do something  Define permissions and check them in code at entity and property level  Permissions are granted through administration screens
  • 17.
    Access Control • Permissions are defined by the developer • The application’s administrator(s) define(s) users and roles • Permissions are assigned to roles • Users are assigned to roles • A user’s effective permissions are the combined permissions assigned to their roles
  • 18.
    Deployment Options • 2-tierdesktop application  Application runs entirely on user’s computer • 3-tier desktop application  User interface runs on user’s computer  Middle-tier components run on Internet Information Services (IIS) or Windows Azure • 3-tier web application  User interface is browser based  Middle-tier components run on IIS or Windows Azure
  • 19.
  • 20.
    Thank You • Bigthanks to the organizers, sponsors and you for making this event possible • Please fill out your evaluation • Please keep in touch rwindsor@allin.com @robwindsor msmvps.com/blogs/windsor