NuGet 3.0 - Transitioning from OData to JSON-LD

Jeff Handley
Jeff HandleyEngineering Manager at Microsoft
NuGet 3.0 
Transitioning from OData 
to JSON-LD 
Jeff Handley 
@JeffHandley
NuGet 3.0 
New UI for Visual Studio 
• Lots of new UI features 
New client/server API 
• Built for nuget.org availability, based on usage patterns 
Lots of code refactoring 
• Easier maintenance going forward
NuGet 3.0 - Transitioning from OData to JSON-LD
NuGet 3.0 Plans 
Aligned with Visual Studio “14” release cycle 
• Preview in the next release 
• Shipping for VS 2012 and VS 2013 
• Not shipping for VS 2010 
MSBuild will consume package references 
Solution Explorer integration 
Details at http://blog.nuget.org
Transitioning to the 
new client/server API 
Design retrospective
package repository 
remote server local folder 
package 
metadata from API unpacked into memory 
Visual Studio project system 
C# F# Windows Phone … 
file system 
/packages folder project system
Guiding principles 
BEFORE NUGET 3.0 
Bolt onto Visual Studio 
Heavy use of abstractions 
Comprehensive unit tests 
Generic client/server API (OData)
Visual Studio bolt-on 
Use Visual Studio API 
Same result as manually referencing libraries 
Integrate with most Visual Studio project systems 
Support VS-integrated source control
Abstractions 
IPackageRepository 
• nuget.org 
• Other remote servers 
• Folder on disk or network 
IPackage/IPackageMetadata 
• Remote 
• In-memory 
• On disk 
IPackageManager 
IProjectSystem 
• C# 
• F# 
• Windows Phone 
IFileSystem 
• Actual file system 
• Project systems 
• Source control 
LOOSE COUPLING & UNIT TESTING 
more than 80 other interfaces
Generic client/server API 
ANOTHER FORM OF LOOSE COUPLING 
Don’t couple the client to a server implementation 
Avoid versioning the server to add client features 
LINQ programming model for local and remote
NuGet.VisualStudio 
NuGet.Core 
PowerShell 
console 
package 
manager 
window 
VS IDE 
integration 
source control 
integration 
command 
extensions 
nuget.exe
NuGet.VisualStudio 
Visual Studio IDE integration 
• Output window logging 
• Settings (package sources) 
• Automatic package restore upon build 
• Garbage-collecting packages on VS restart 
• Extension update banner 
Visual Studio APIs 
• Project system integration 
• Actual package installation and uninstallation
NuGet.Core 
• Package authoring (including package analysis rules) 
• Package reading (OPC/Zip, data model w/validation, file conventions) 
• Semantic Version implementation 
• Target framework compatibility 
• Dependency resolver 
• Local and remote sources (API, HTTP, proxies, authentication) 
• NuGet.Config Processing (including hierarchical and extensible features) 
• 80+ interfaces
http://valleyreport.blogspot.com/2012/01 
/revised-dumping-ordinance-allows.html
Classes fulfilling multiple interfaces 
Project systems are also file systems 
• Add/remove files 
• Enforces VS project system and source control integration 
/packages folder is also a package repository 
• GetPackages() 
• AddPackage() 
• RemovePackage() 
Extension methods on interfaces to simulate multiple inheritance 
• 17 “extensions” classes that act as base classes 
33 “utility” classes to contain business logic
Extreme loose coupling 
Magic values trigger special handling several layers deep 
• FindPackage(id, version: null); 
Granular interfaces led to unmanageable parameter counts 
• ProjectSystemExtensions.DeleteFiles FxCop 
suppressions 
Events during operations allowed decoupled reactions 
• InstallWalker needs to report progress to the VS UI
http://www.flickr.com/photos/bump/2807032202/
No change was easy 
• 18 classes touched adding HTTP headers for downloads 
• Dozens of classes affected to add a new field to nuspec 
• Mocks require more work than the actual implementation 
• Extension methods are not compatible with mocking 
•We became afraid to touch the dependency resolver
Big changes needed 
Replacing API v2 with API v3
SQL Azure 
database 
Azure 
Blob 
Storage 
Gallery / API v2 
Azure web role (3 instances) 
EntityFramework 
code-first 
WCF Data 
Services and 
ASP.NET MVC 
and Razor 
OData 
Search and 
feed 
requests 
Content Delivery Network (CDN) 
Package 
downloads
Azure 
Blob 
Storage 
Search Service 
Azure worker role (3+ instances) 
Lucene.NET 
Full index loaded into memory 
Content Delivery Network (CDN) 
Metrics Service 
Azure website (3+ instances) 
SQL Azure 
database 
Search 
queries 
Package 
metadata 
requests 
Package 
downloads
JSON-LD 
http://json-ld.org/ 
{ 
"@context": "http://json-ld.org/contexts/person.jsonld", 
"@id": "http://dbpedia.org/resource/John_Lennon", 
"name": "John Lennon", 
"born": "1940-10-09", 
"spouse": "http://dbpedia.org/resource/Cynthia_Lennon" 
}
Creating the v3 client 
For the new UI
API v2 support 
The UI must support both v2 and v3 clients 
No clean surface area to re-implement 
• UI  install walker  API v2  install walker  API v2 
• IQueryable<IPackage> exposed throughout code
NuGet 3.0 - Transitioning from OData to JSON-LD
Infinite surface area 
Finite scenarios
Scenarios and clients 
1. Search 
2. Install specific version 
3. Install latest version 
4. Install with dependencies 
5. Install from cache 
6. Install into another project 
7. Check for updates 
8. Update and update all 
9. Restore 
1. Package manager UI 
2. PowerShell console 
3. nuget.exe
http://www.clayburn.wtf/2011/03/to 
p-5-reasons-youre-unemployed.html
API v3 
search 
(feed) 
Search Service 
Azure worker role (3+ instances) 
Lucene.NET 
Full Index Loaded into Memory 
Gallery / API v2 
Azure web role (3+ instances) 
Content Delivery Network (CDN) 
API v3 
Package 
Metadata 
Package 
Downloads 
Metrics Service 
Azure website (3+ instances) 
API v2 
OData 
SQL Azure 
database 
Azure 
Blob 
Storage
WCF Data Services to the rescue!? 
NuGet 
Core 
WCF Data 
Services 
API v2 
Server 
OData 
XML 
WCF Data 
Services 
Entity 
Framework 
API v3 
Services 
JSON-LD 
Convert JSON-LD to XML
http://www.marcioezequiel.com 
.br/2013/10/bigode-grosso.html
Introducing NuGet.Client 
Handle the client/server scenarios 
Support API v2 and API v3 
Scenario-focused object model 
Prevent new dependencies on NuGet.Core
Wrapping NuGet.Core 
Package Manager UI 
NuGet.Core 
NuGet.Client
Dealing with deep API v2 assumptions 
• Implemented v2 interfaces in v3 classes 
• Threw NotImplementedException on all members 
• Ran a scenario, identified code paths required 
• Identified more concrete API v3 requirements 
• Discovered data needed for each scenario 
• Influenced API v3 JSON-LD views
Shrinking NuGet.Core 
Package Manager UI 
NuGet.Core 
Package 
Authoring 
Package 
Reading 
Semantic 
Versioning 
Target FX 
Compat 
Dependency 
Resolver 
Local 
Package 
Sources 
NuGet 
Config 
Processing 
Project and 
NuGet.Core 
NuGet.Client 
NuGet.Client File Systems
Compromises 
API v3 isn’t completely “clean” yet 
• It exposes the API v2 interfaces 
Chatty 
• API v3 uses more HTTP requests than a pure v3 server/client would 
• API v2 interop performs more OData requests than we used to 
Out of scope 
• PowerShell console 
• nuget.exe
New guiding principles 
Our new rules
Guiding principle #1 
Technology is not a substitute 
for understanding our scenarios.
Guiding principle #2 
Don’t expose IQueryable on 
public API. 
* this applies to our RESTful services too
Guiding principle #3 
Every client/server scenario 
needs an explicit endpoint.
Guiding principle #4 
Shipping is more valuable than 
code purity.
Guiding principle #5 
Don’t implement interfaces just 
because the members match.
Guiding principle #6 
Side-effecting event handlers 
hurt in unpredictable ways.
Guiding principle #7 
Avoid business logic in extension 
methods. They can’t be mocked.
Guiding principle #8 
If adding new business logic is 
hard, refactor right away.
Thanks 
Come get NuGet stickers 
@jeffhandley | jeffhandley.com | jeff.handley@microsoft.com | blog.nuget.org
1 of 46

Recommended

Continuous Delivery with Jenkins by
Continuous Delivery with JenkinsContinuous Delivery with Jenkins
Continuous Delivery with JenkinsJadson Santos
381 views98 slides
DCSF 19 Building Your Development Pipeline by
DCSF 19 Building Your Development Pipeline  DCSF 19 Building Your Development Pipeline
DCSF 19 Building Your Development Pipeline Docker, Inc.
467 views50 slides
Kubernetes Networking 101 by
Kubernetes Networking 101Kubernetes Networking 101
Kubernetes Networking 101Kublr
87 views17 slides
Building Angular 2.0 applications with TypeScript by
Building Angular 2.0 applications with TypeScriptBuilding Angular 2.0 applications with TypeScript
Building Angular 2.0 applications with TypeScriptMSDEVMTL
776 views30 slides
5 patterns for success for application transformation by
5 patterns for success for application transformation5 patterns for success for application transformation
5 patterns for success for application transformationDocker, Inc.
669 views24 slides
DockerCon SF 2015: Ben Golub's Keynote Day 1 by
DockerCon SF 2015: Ben Golub's Keynote Day 1DockerCon SF 2015: Ben Golub's Keynote Day 1
DockerCon SF 2015: Ben Golub's Keynote Day 1Docker, Inc.
20.1K views29 slides

More Related Content

What's hot

DockerCon SF 2015: Docker in the New York Times Newsroom by
DockerCon SF 2015: Docker in the New York Times NewsroomDockerCon SF 2015: Docker in the New York Times Newsroom
DockerCon SF 2015: Docker in the New York Times NewsroomDocker, Inc.
5.2K views68 slides
What’s New in Spring Batch? by
What’s New in Spring Batch?What’s New in Spring Batch?
What’s New in Spring Batch?VMware Tanzu
392 views28 slides
CI/CD 기반의 Microservice 개발 by
 CI/CD 기반의 Microservice 개발 CI/CD 기반의 Microservice 개발
CI/CD 기반의 Microservice 개발Oracle Korea
241 views22 slides
Orchestrating Microservices with Kubernetes by
Orchestrating Microservices with Kubernetes Orchestrating Microservices with Kubernetes
Orchestrating Microservices with Kubernetes Weaveworks
2.4K views43 slides
Security model for a remote company by
Security model for a remote companySecurity model for a remote company
Security model for a remote companyPierre Mavro
159 views19 slides
Ultimate Guide to Microservice Architecture on Kubernetes by
Ultimate Guide to Microservice Architecture on KubernetesUltimate Guide to Microservice Architecture on Kubernetes
Ultimate Guide to Microservice Architecture on Kuberneteskloia
722 views107 slides

What's hot(20)

DockerCon SF 2015: Docker in the New York Times Newsroom by Docker, Inc.
DockerCon SF 2015: Docker in the New York Times NewsroomDockerCon SF 2015: Docker in the New York Times Newsroom
DockerCon SF 2015: Docker in the New York Times Newsroom
Docker, Inc.5.2K views
What’s New in Spring Batch? by VMware Tanzu
What’s New in Spring Batch?What’s New in Spring Batch?
What’s New in Spring Batch?
VMware Tanzu392 views
CI/CD 기반의 Microservice 개발 by Oracle Korea
 CI/CD 기반의 Microservice 개발 CI/CD 기반의 Microservice 개발
CI/CD 기반의 Microservice 개발
Oracle Korea241 views
Orchestrating Microservices with Kubernetes by Weaveworks
Orchestrating Microservices with Kubernetes Orchestrating Microservices with Kubernetes
Orchestrating Microservices with Kubernetes
Weaveworks2.4K views
Security model for a remote company by Pierre Mavro
Security model for a remote companySecurity model for a remote company
Security model for a remote company
Pierre Mavro159 views
Ultimate Guide to Microservice Architecture on Kubernetes by kloia
Ultimate Guide to Microservice Architecture on KubernetesUltimate Guide to Microservice Architecture on Kubernetes
Ultimate Guide to Microservice Architecture on Kubernetes
kloia722 views
Introduction to GitHub Actions - How to easily automate and integrate with Gi... by All Things Open
Introduction to GitHub Actions - How to easily automate and integrate with Gi...Introduction to GitHub Actions - How to easily automate and integrate with Gi...
Introduction to GitHub Actions - How to easily automate and integrate with Gi...
All Things Open109 views
Continuous Delivery the Hard Way with Kubernetes by Weaveworks
Continuous Delivery the Hard Way with Kubernetes Continuous Delivery the Hard Way with Kubernetes
Continuous Delivery the Hard Way with Kubernetes
Weaveworks912 views
Windows container security by Docker, Inc.
Windows container securityWindows container security
Windows container security
Docker, Inc.3.7K views
Load Balancing in the Cloud using Nginx & Kubernetes by Lee Calcote
Load Balancing in the Cloud using Nginx & KubernetesLoad Balancing in the Cloud using Nginx & Kubernetes
Load Balancing in the Cloud using Nginx & Kubernetes
Lee Calcote2.7K views
Jenkins Pipeline @ Scale. Building Automation Frameworks for Systems Integration by Oleg Nenashev
Jenkins Pipeline @ Scale. Building Automation Frameworks for Systems IntegrationJenkins Pipeline @ Scale. Building Automation Frameworks for Systems Integration
Jenkins Pipeline @ Scale. Building Automation Frameworks for Systems Integration
Oleg Nenashev1.4K views
OpenShift for Java EE Developers by Markus Eisele
OpenShift for Java EE DevelopersOpenShift for Java EE Developers
OpenShift for Java EE Developers
Markus Eisele1.7K views
Greach 2014 - Road to Grails 3.0 by graemerocher
Greach 2014  - Road to Grails 3.0Greach 2014  - Road to Grails 3.0
Greach 2014 - Road to Grails 3.0
graemerocher4K views
Introduction to Kubernetes Security (Aqua & Weaveworks) by Weaveworks
Introduction to Kubernetes Security (Aqua & Weaveworks)Introduction to Kubernetes Security (Aqua & Weaveworks)
Introduction to Kubernetes Security (Aqua & Weaveworks)
Weaveworks502 views
NATS: Simple, Secure and Scalable Messaging For the Cloud Native Era by wallyqs
NATS: Simple, Secure and Scalable Messaging For the Cloud Native EraNATS: Simple, Secure and Scalable Messaging For the Cloud Native Era
NATS: Simple, Secure and Scalable Messaging For the Cloud Native Era
wallyqs2.5K views
Jenkins Workflow Webinar - Dec 10, 2014 by CloudBees
Jenkins Workflow Webinar - Dec 10, 2014Jenkins Workflow Webinar - Dec 10, 2014
Jenkins Workflow Webinar - Dec 10, 2014
CloudBees3.6K views
DCSF19 Docker Containers & Java: What I Wish I Had Been Told by Docker, Inc.
DCSF19 Docker Containers & Java: What I Wish I Had Been ToldDCSF19 Docker Containers & Java: What I Wish I Had Been Told
DCSF19 Docker Containers & Java: What I Wish I Had Been Told
Docker, Inc.2.6K views
Demystifying container connectivity with kubernetes in docker by Docker, Inc.
Demystifying container connectivity with kubernetes in dockerDemystifying container connectivity with kubernetes in docker
Demystifying container connectivity with kubernetes in docker
Docker, Inc.765 views

Viewers also liked

Running in the Cloud - First Belgian Azure project by
Running in the Cloud - First Belgian Azure projectRunning in the Cloud - First Belgian Azure project
Running in the Cloud - First Belgian Azure projectMaarten Balliauw
1.2K views67 slides
Fun with ASP.NET MVC 3, MEF and NuGet (#comdaybe) by
Fun with ASP.NET MVC 3, MEF and NuGet (#comdaybe)Fun with ASP.NET MVC 3, MEF and NuGet (#comdaybe)
Fun with ASP.NET MVC 3, MEF and NuGet (#comdaybe)Maarten Balliauw
2.8K views26 slides
An overview of the NuGet ecosystem - Mobel.io by
An overview of the NuGet ecosystem - Mobel.ioAn overview of the NuGet ecosystem - Mobel.io
An overview of the NuGet ecosystem - Mobel.ioMaarten Balliauw
2.3K views33 slides
Understanding NuGet implementation for Enterprises by
Understanding NuGet implementation for EnterprisesUnderstanding NuGet implementation for Enterprises
Understanding NuGet implementation for EnterprisesJ S Jodha
931 views40 slides
OData, Open Data Protocol. A brief introduction by
OData, Open Data Protocol. A brief introductionOData, Open Data Protocol. A brief introduction
OData, Open Data Protocol. A brief introductionEugenio Lentini
2.7K views9 slides
NuGet vs Maven by
NuGet vs MavenNuGet vs Maven
NuGet vs MavenMiguel Fernández
9K views14 slides

Viewers also liked(20)

Running in the Cloud - First Belgian Azure project by Maarten Balliauw
Running in the Cloud - First Belgian Azure projectRunning in the Cloud - First Belgian Azure project
Running in the Cloud - First Belgian Azure project
Maarten Balliauw1.2K views
Fun with ASP.NET MVC 3, MEF and NuGet (#comdaybe) by Maarten Balliauw
Fun with ASP.NET MVC 3, MEF and NuGet (#comdaybe)Fun with ASP.NET MVC 3, MEF and NuGet (#comdaybe)
Fun with ASP.NET MVC 3, MEF and NuGet (#comdaybe)
Maarten Balliauw2.8K views
An overview of the NuGet ecosystem - Mobel.io by Maarten Balliauw
An overview of the NuGet ecosystem - Mobel.ioAn overview of the NuGet ecosystem - Mobel.io
An overview of the NuGet ecosystem - Mobel.io
Maarten Balliauw2.3K views
Understanding NuGet implementation for Enterprises by J S Jodha
Understanding NuGet implementation for EnterprisesUnderstanding NuGet implementation for Enterprises
Understanding NuGet implementation for Enterprises
J S Jodha931 views
OData, Open Data Protocol. A brief introduction by Eugenio Lentini
OData, Open Data Protocol. A brief introductionOData, Open Data Protocol. A brief introduction
OData, Open Data Protocol. A brief introduction
Eugenio Lentini2.7K views
Using nu get the way you should svcc by Maarten Balliauw
Using nu get the way you should   svccUsing nu get the way you should   svcc
Using nu get the way you should svcc
Maarten Balliauw1.5K views
Using NuGet the way you should - TechDays NL 2014 by Maarten Balliauw
Using NuGet the way you should - TechDays NL 2014Using NuGet the way you should - TechDays NL 2014
Using NuGet the way you should - TechDays NL 2014
Maarten Balliauw2.5K views
The API Tempest by Sam Ramji
The API TempestThe API Tempest
The API Tempest
Sam Ramji2.9K views
Elegant Rest Design Webinar by Stormpath
Elegant Rest Design WebinarElegant Rest Design Webinar
Elegant Rest Design Webinar
Stormpath3.7K views
Build A Killer Client For Your REST+JSON API by Stormpath
Build A Killer Client For Your REST+JSON APIBuild A Killer Client For Your REST+JSON API
Build A Killer Client For Your REST+JSON API
Stormpath3.1K views
Gestion paquetes NuGet con Visual Studio Team Services y MyGet by Luis Fraile
Gestion paquetes NuGet con Visual Studio Team Services y MyGetGestion paquetes NuGet con Visual Studio Team Services y MyGet
Gestion paquetes NuGet con Visual Studio Team Services y MyGet
Luis Fraile1.2K views
Hortonworks Data In Motion Series Part 4 by Hortonworks
Hortonworks Data In Motion Series Part 4Hortonworks Data In Motion Series Part 4
Hortonworks Data In Motion Series Part 4
Hortonworks15.3K views
Custom Data Search with Stormpath by Stormpath
Custom Data Search with StormpathCustom Data Search with Stormpath
Custom Data Search with Stormpath
Stormpath333 views
JWTs in Java for CSRF and Microservices by Stormpath
JWTs in Java for CSRF and MicroservicesJWTs in Java for CSRF and Microservices
JWTs in Java for CSRF and Microservices
Stormpath716 views
Protecting Your APIs Against Attack & Hijack by CA API Management
Protecting Your APIs Against Attack & Hijack Protecting Your APIs Against Attack & Hijack
Protecting Your APIs Against Attack & Hijack
CA API Management18.4K views
Getting Started With Angular by Stormpath
Getting Started With AngularGetting Started With Angular
Getting Started With Angular
Stormpath757 views
Instant Security & Scalable User Management with Spring Boot by Stormpath
Instant Security & Scalable User Management with Spring BootInstant Security & Scalable User Management with Spring Boot
Instant Security & Scalable User Management with Spring Boot
Stormpath669 views

Similar to NuGet 3.0 - Transitioning from OData to JSON-LD

Open shift and docker - october,2014 by
Open shift and docker - october,2014Open shift and docker - october,2014
Open shift and docker - october,2014Hojoong Kim
10K views72 slides
.NET Core Apps: Design & Development by
.NET Core Apps: Design & Development.NET Core Apps: Design & Development
.NET Core Apps: Design & DevelopmentGlobalLogic Ukraine
1K views47 slides
Vijay Oscon by
Vijay OsconVijay Oscon
Vijay Osconvijayrvr
380 views36 slides
ASP.NET vNext by
ASP.NET vNextASP.NET vNext
ASP.NET vNextAlex Thissen
273 views36 slides
04_Azure Kubernetes Service: Basic Practices for Developers_GAB2019 by
04_Azure Kubernetes Service: Basic Practices for Developers_GAB201904_Azure Kubernetes Service: Basic Practices for Developers_GAB2019
04_Azure Kubernetes Service: Basic Practices for Developers_GAB2019Kumton Suttiraksiri
698 views23 slides
Tokyo Azure Meetup #7 - Introduction to Serverless Architectures with Azure F... by
Tokyo Azure Meetup #7 - Introduction to Serverless Architectures with Azure F...Tokyo Azure Meetup #7 - Introduction to Serverless Architectures with Azure F...
Tokyo Azure Meetup #7 - Introduction to Serverless Architectures with Azure F...Tokyo Azure Meetup
1.4K views48 slides

Similar to NuGet 3.0 - Transitioning from OData to JSON-LD(20)

Open shift and docker - october,2014 by Hojoong Kim
Open shift and docker - october,2014Open shift and docker - october,2014
Open shift and docker - october,2014
Hojoong Kim10K views
Vijay Oscon by vijayrvr
Vijay OsconVijay Oscon
Vijay Oscon
vijayrvr380 views
04_Azure Kubernetes Service: Basic Practices for Developers_GAB2019 by Kumton Suttiraksiri
04_Azure Kubernetes Service: Basic Practices for Developers_GAB201904_Azure Kubernetes Service: Basic Practices for Developers_GAB2019
04_Azure Kubernetes Service: Basic Practices for Developers_GAB2019
Tokyo Azure Meetup #7 - Introduction to Serverless Architectures with Azure F... by Tokyo Azure Meetup
Tokyo Azure Meetup #7 - Introduction to Serverless Architectures with Azure F...Tokyo Azure Meetup #7 - Introduction to Serverless Architectures with Azure F...
Tokyo Azure Meetup #7 - Introduction to Serverless Architectures with Azure F...
Tokyo Azure Meetup1.4K views
What's New in .Net 4.5 by Malam Team
What's New in .Net 4.5What's New in .Net 4.5
What's New in .Net 4.5
Malam Team3K views
Red Hat Forum Benelux 2015 by Microsoft
Red Hat Forum Benelux 2015Red Hat Forum Benelux 2015
Red Hat Forum Benelux 2015
Microsoft1.2K views
MVC 6 - the new unified Web programming model by Alex Thissen
MVC 6 - the new unified Web programming modelMVC 6 - the new unified Web programming model
MVC 6 - the new unified Web programming model
Alex Thissen403 views
DEVNET-1166 Open SDN Controller APIs by Cisco DevNet
DEVNET-1166	Open SDN Controller APIsDEVNET-1166	Open SDN Controller APIs
DEVNET-1166 Open SDN Controller APIs
Cisco DevNet1.1K views
Mete Atamel by CodeFest
Mete AtamelMete Atamel
Mete Atamel
CodeFest338 views
VMworld 2013: vSphere UI Platform Best Practices: Putting the Web Client SDK ... by VMworld
VMworld 2013: vSphere UI Platform Best Practices: Putting the Web Client SDK ...VMworld 2013: vSphere UI Platform Best Practices: Putting the Web Client SDK ...
VMworld 2013: vSphere UI Platform Best Practices: Putting the Web Client SDK ...
VMworld1.4K views
JSS build and deployment by David Szöke
JSS build and deploymentJSS build and deployment
JSS build and deployment
David Szöke235 views
Deep Dive Azure Functions - Global Azure Bootcamp 2019 by Andrea Tosato
Deep Dive Azure Functions - Global Azure Bootcamp 2019Deep Dive Azure Functions - Global Azure Bootcamp 2019
Deep Dive Azure Functions - Global Azure Bootcamp 2019
Andrea Tosato368 views
Taking Spring Apps for a Spin on Microsoft Azure Cloud by Bruno Borges
Taking Spring Apps for a Spin on Microsoft Azure CloudTaking Spring Apps for a Spin on Microsoft Azure Cloud
Taking Spring Apps for a Spin on Microsoft Azure Cloud
Bruno Borges646 views
ASP.NET Core 1.0 by Ido Flatow
ASP.NET Core 1.0ASP.NET Core 1.0
ASP.NET Core 1.0
Ido Flatow701 views

Recently uploaded

"Surviving highload with Node.js", Andrii Shumada by
"Surviving highload with Node.js", Andrii Shumada "Surviving highload with Node.js", Andrii Shumada
"Surviving highload with Node.js", Andrii Shumada Fwdays
40 views29 slides
Microsoft Power Platform.pptx by
Microsoft Power Platform.pptxMicrosoft Power Platform.pptx
Microsoft Power Platform.pptxUni Systems S.M.S.A.
67 views38 slides
Business Analyst Series 2023 - Week 3 Session 5 by
Business Analyst Series 2023 -  Week 3 Session 5Business Analyst Series 2023 -  Week 3 Session 5
Business Analyst Series 2023 - Week 3 Session 5DianaGray10
369 views20 slides
Don’t Make A Human Do A Robot’s Job! : 6 Reasons Why AI Will Save Us & Not De... by
Don’t Make A Human Do A Robot’s Job! : 6 Reasons Why AI Will Save Us & Not De...Don’t Make A Human Do A Robot’s Job! : 6 Reasons Why AI Will Save Us & Not De...
Don’t Make A Human Do A Robot’s Job! : 6 Reasons Why AI Will Save Us & Not De...Moses Kemibaro
29 views38 slides
Five Things You SHOULD Know About Postman by
Five Things You SHOULD Know About PostmanFive Things You SHOULD Know About Postman
Five Things You SHOULD Know About PostmanPostman
40 views43 slides
Backup and Disaster Recovery with CloudStack and StorPool - Workshop - Venko ... by
Backup and Disaster Recovery with CloudStack and StorPool - Workshop - Venko ...Backup and Disaster Recovery with CloudStack and StorPool - Workshop - Venko ...
Backup and Disaster Recovery with CloudStack and StorPool - Workshop - Venko ...ShapeBlue
77 views12 slides

Recently uploaded(20)

"Surviving highload with Node.js", Andrii Shumada by Fwdays
"Surviving highload with Node.js", Andrii Shumada "Surviving highload with Node.js", Andrii Shumada
"Surviving highload with Node.js", Andrii Shumada
Fwdays40 views
Business Analyst Series 2023 - Week 3 Session 5 by DianaGray10
Business Analyst Series 2023 -  Week 3 Session 5Business Analyst Series 2023 -  Week 3 Session 5
Business Analyst Series 2023 - Week 3 Session 5
DianaGray10369 views
Don’t Make A Human Do A Robot’s Job! : 6 Reasons Why AI Will Save Us & Not De... by Moses Kemibaro
Don’t Make A Human Do A Robot’s Job! : 6 Reasons Why AI Will Save Us & Not De...Don’t Make A Human Do A Robot’s Job! : 6 Reasons Why AI Will Save Us & Not De...
Don’t Make A Human Do A Robot’s Job! : 6 Reasons Why AI Will Save Us & Not De...
Moses Kemibaro29 views
Five Things You SHOULD Know About Postman by Postman
Five Things You SHOULD Know About PostmanFive Things You SHOULD Know About Postman
Five Things You SHOULD Know About Postman
Postman40 views
Backup and Disaster Recovery with CloudStack and StorPool - Workshop - Venko ... by ShapeBlue
Backup and Disaster Recovery with CloudStack and StorPool - Workshop - Venko ...Backup and Disaster Recovery with CloudStack and StorPool - Workshop - Venko ...
Backup and Disaster Recovery with CloudStack and StorPool - Workshop - Venko ...
ShapeBlue77 views
Keynote Talk: Open Source is Not Dead - Charles Schulz - Vates by ShapeBlue
Keynote Talk: Open Source is Not Dead - Charles Schulz - VatesKeynote Talk: Open Source is Not Dead - Charles Schulz - Vates
Keynote Talk: Open Source is Not Dead - Charles Schulz - Vates
ShapeBlue119 views
2FA and OAuth2 in CloudStack - Andrija Panić - ShapeBlue by ShapeBlue
2FA and OAuth2 in CloudStack - Andrija Panić - ShapeBlue2FA and OAuth2 in CloudStack - Andrija Panić - ShapeBlue
2FA and OAuth2 in CloudStack - Andrija Panić - ShapeBlue
ShapeBlue50 views
Why and How CloudStack at weSystems - Stephan Bienek - weSystems by ShapeBlue
Why and How CloudStack at weSystems - Stephan Bienek - weSystemsWhy and How CloudStack at weSystems - Stephan Bienek - weSystems
Why and How CloudStack at weSystems - Stephan Bienek - weSystems
ShapeBlue111 views
How to Re-use Old Hardware with CloudStack. Saving Money and the Environment ... by ShapeBlue
How to Re-use Old Hardware with CloudStack. Saving Money and the Environment ...How to Re-use Old Hardware with CloudStack. Saving Money and the Environment ...
How to Re-use Old Hardware with CloudStack. Saving Money and the Environment ...
ShapeBlue65 views
Igniting Next Level Productivity with AI-Infused Data Integration Workflows by Safe Software
Igniting Next Level Productivity with AI-Infused Data Integration Workflows Igniting Next Level Productivity with AI-Infused Data Integration Workflows
Igniting Next Level Productivity with AI-Infused Data Integration Workflows
Safe Software344 views
Backroll, News and Demo - Pierre Charton, Matthias Dhellin, Ousmane Diarra - ... by ShapeBlue
Backroll, News and Demo - Pierre Charton, Matthias Dhellin, Ousmane Diarra - ...Backroll, News and Demo - Pierre Charton, Matthias Dhellin, Ousmane Diarra - ...
Backroll, News and Demo - Pierre Charton, Matthias Dhellin, Ousmane Diarra - ...
ShapeBlue83 views
【USB韌體設計課程】精選講義節錄-USB的列舉過程_艾鍗學院 by IttrainingIttraining
【USB韌體設計課程】精選講義節錄-USB的列舉過程_艾鍗學院【USB韌體設計課程】精選講義節錄-USB的列舉過程_艾鍗學院
【USB韌體設計課程】精選講義節錄-USB的列舉過程_艾鍗學院
VNF Integration and Support in CloudStack - Wei Zhou - ShapeBlue by ShapeBlue
VNF Integration and Support in CloudStack - Wei Zhou - ShapeBlueVNF Integration and Support in CloudStack - Wei Zhou - ShapeBlue
VNF Integration and Support in CloudStack - Wei Zhou - ShapeBlue
ShapeBlue85 views
CloudStack Managed User Data and Demo - Harikrishna Patnala - ShapeBlue by ShapeBlue
CloudStack Managed User Data and Demo - Harikrishna Patnala - ShapeBlueCloudStack Managed User Data and Demo - Harikrishna Patnala - ShapeBlue
CloudStack Managed User Data and Demo - Harikrishna Patnala - ShapeBlue
ShapeBlue46 views
DRBD Deep Dive - Philipp Reisner - LINBIT by ShapeBlue
DRBD Deep Dive - Philipp Reisner - LINBITDRBD Deep Dive - Philipp Reisner - LINBIT
DRBD Deep Dive - Philipp Reisner - LINBIT
ShapeBlue62 views
What’s New in CloudStack 4.19 - Abhishek Kumar - ShapeBlue by ShapeBlue
What’s New in CloudStack 4.19 - Abhishek Kumar - ShapeBlueWhat’s New in CloudStack 4.19 - Abhishek Kumar - ShapeBlue
What’s New in CloudStack 4.19 - Abhishek Kumar - ShapeBlue
ShapeBlue131 views

NuGet 3.0 - Transitioning from OData to JSON-LD

  • 1. NuGet 3.0 Transitioning from OData to JSON-LD Jeff Handley @JeffHandley
  • 2. NuGet 3.0 New UI for Visual Studio • Lots of new UI features New client/server API • Built for nuget.org availability, based on usage patterns Lots of code refactoring • Easier maintenance going forward
  • 4. NuGet 3.0 Plans Aligned with Visual Studio “14” release cycle • Preview in the next release • Shipping for VS 2012 and VS 2013 • Not shipping for VS 2010 MSBuild will consume package references Solution Explorer integration Details at http://blog.nuget.org
  • 5. Transitioning to the new client/server API Design retrospective
  • 6. package repository remote server local folder package metadata from API unpacked into memory Visual Studio project system C# F# Windows Phone … file system /packages folder project system
  • 7. Guiding principles BEFORE NUGET 3.0 Bolt onto Visual Studio Heavy use of abstractions Comprehensive unit tests Generic client/server API (OData)
  • 8. Visual Studio bolt-on Use Visual Studio API Same result as manually referencing libraries Integrate with most Visual Studio project systems Support VS-integrated source control
  • 9. Abstractions IPackageRepository • nuget.org • Other remote servers • Folder on disk or network IPackage/IPackageMetadata • Remote • In-memory • On disk IPackageManager IProjectSystem • C# • F# • Windows Phone IFileSystem • Actual file system • Project systems • Source control LOOSE COUPLING & UNIT TESTING more than 80 other interfaces
  • 10. Generic client/server API ANOTHER FORM OF LOOSE COUPLING Don’t couple the client to a server implementation Avoid versioning the server to add client features LINQ programming model for local and remote
  • 11. NuGet.VisualStudio NuGet.Core PowerShell console package manager window VS IDE integration source control integration command extensions nuget.exe
  • 12. NuGet.VisualStudio Visual Studio IDE integration • Output window logging • Settings (package sources) • Automatic package restore upon build • Garbage-collecting packages on VS restart • Extension update banner Visual Studio APIs • Project system integration • Actual package installation and uninstallation
  • 13. NuGet.Core • Package authoring (including package analysis rules) • Package reading (OPC/Zip, data model w/validation, file conventions) • Semantic Version implementation • Target framework compatibility • Dependency resolver • Local and remote sources (API, HTTP, proxies, authentication) • NuGet.Config Processing (including hierarchical and extensible features) • 80+ interfaces
  • 15. Classes fulfilling multiple interfaces Project systems are also file systems • Add/remove files • Enforces VS project system and source control integration /packages folder is also a package repository • GetPackages() • AddPackage() • RemovePackage() Extension methods on interfaces to simulate multiple inheritance • 17 “extensions” classes that act as base classes 33 “utility” classes to contain business logic
  • 16. Extreme loose coupling Magic values trigger special handling several layers deep • FindPackage(id, version: null); Granular interfaces led to unmanageable parameter counts • ProjectSystemExtensions.DeleteFiles FxCop suppressions Events during operations allowed decoupled reactions • InstallWalker needs to report progress to the VS UI
  • 18. No change was easy • 18 classes touched adding HTTP headers for downloads • Dozens of classes affected to add a new field to nuspec • Mocks require more work than the actual implementation • Extension methods are not compatible with mocking •We became afraid to touch the dependency resolver
  • 19. Big changes needed Replacing API v2 with API v3
  • 20. SQL Azure database Azure Blob Storage Gallery / API v2 Azure web role (3 instances) EntityFramework code-first WCF Data Services and ASP.NET MVC and Razor OData Search and feed requests Content Delivery Network (CDN) Package downloads
  • 21. Azure Blob Storage Search Service Azure worker role (3+ instances) Lucene.NET Full index loaded into memory Content Delivery Network (CDN) Metrics Service Azure website (3+ instances) SQL Azure database Search queries Package metadata requests Package downloads
  • 22. JSON-LD http://json-ld.org/ { "@context": "http://json-ld.org/contexts/person.jsonld", "@id": "http://dbpedia.org/resource/John_Lennon", "name": "John Lennon", "born": "1940-10-09", "spouse": "http://dbpedia.org/resource/Cynthia_Lennon" }
  • 23. Creating the v3 client For the new UI
  • 24. API v2 support The UI must support both v2 and v3 clients No clean surface area to re-implement • UI  install walker  API v2  install walker  API v2 • IQueryable<IPackage> exposed throughout code
  • 26. Infinite surface area Finite scenarios
  • 27. Scenarios and clients 1. Search 2. Install specific version 3. Install latest version 4. Install with dependencies 5. Install from cache 6. Install into another project 7. Check for updates 8. Update and update all 9. Restore 1. Package manager UI 2. PowerShell console 3. nuget.exe
  • 29. API v3 search (feed) Search Service Azure worker role (3+ instances) Lucene.NET Full Index Loaded into Memory Gallery / API v2 Azure web role (3+ instances) Content Delivery Network (CDN) API v3 Package Metadata Package Downloads Metrics Service Azure website (3+ instances) API v2 OData SQL Azure database Azure Blob Storage
  • 30. WCF Data Services to the rescue!? NuGet Core WCF Data Services API v2 Server OData XML WCF Data Services Entity Framework API v3 Services JSON-LD Convert JSON-LD to XML
  • 32. Introducing NuGet.Client Handle the client/server scenarios Support API v2 and API v3 Scenario-focused object model Prevent new dependencies on NuGet.Core
  • 33. Wrapping NuGet.Core Package Manager UI NuGet.Core NuGet.Client
  • 34. Dealing with deep API v2 assumptions • Implemented v2 interfaces in v3 classes • Threw NotImplementedException on all members • Ran a scenario, identified code paths required • Identified more concrete API v3 requirements • Discovered data needed for each scenario • Influenced API v3 JSON-LD views
  • 35. Shrinking NuGet.Core Package Manager UI NuGet.Core Package Authoring Package Reading Semantic Versioning Target FX Compat Dependency Resolver Local Package Sources NuGet Config Processing Project and NuGet.Core NuGet.Client NuGet.Client File Systems
  • 36. Compromises API v3 isn’t completely “clean” yet • It exposes the API v2 interfaces Chatty • API v3 uses more HTTP requests than a pure v3 server/client would • API v2 interop performs more OData requests than we used to Out of scope • PowerShell console • nuget.exe
  • 37. New guiding principles Our new rules
  • 38. Guiding principle #1 Technology is not a substitute for understanding our scenarios.
  • 39. Guiding principle #2 Don’t expose IQueryable on public API. * this applies to our RESTful services too
  • 40. Guiding principle #3 Every client/server scenario needs an explicit endpoint.
  • 41. Guiding principle #4 Shipping is more valuable than code purity.
  • 42. Guiding principle #5 Don’t implement interfaces just because the members match.
  • 43. Guiding principle #6 Side-effecting event handlers hurt in unpredictable ways.
  • 44. Guiding principle #7 Avoid business logic in extension methods. They can’t be mocked.
  • 45. Guiding principle #8 If adding new business logic is hard, refactor right away.
  • 46. Thanks Come get NuGet stickers @jeffhandley | jeffhandley.com | jeff.handley@microsoft.com | blog.nuget.org

Editor's Notes

  1. Demo the new UI Consolidation of Online, Installed, and Updates workflows Search respects target framework Version selection (for both installing and updating) Preview Installation Options Multiple windows Solution-Level management of versions installed
  2. We thought JSON would save us!
  3. Searching for the contract