طراحی پورتال های سازمانی شرکت پروجان

شیرپوینت و پراجکت سرور پروجان

استقرار شیرپوینت و پراجکت سرور

مسیر سایت

کتاب Practical Microsoft Visual Studio 2015.pdf

Practical Microsoft Visual Studio 2015.pdf

دانلود رایگان کتاب Practical Microsoft Visual Studio 2015.pdf

Peter Ritchie

Copyright © 2016 by Peter Ritchie

لینک دانلود کتاب Practical Microsoft Visual Studio 2015.pdf 

 

Contents

 

About the Author .................................................................................................................................... xv
About the Technical Reviewer ................................................................................................................ xvii

 

■ Chapter 1: Introduction to Visual Studio 2015 ............................................................................. 1

Intro to IDEs ........................................................................................................................................... 1
Visual Studio 2015 Editions ...................................................................................................................... 2
Difference from Version 2013 ................................................................................................................... 2
Community ............................................................................................................................................. 3
Professional ............................................................................................................................................ 3
Enterprise ............................................................................................................................................... 3
Test Professional ..................................................................................................................................... 4
What’s New in Version 2015 ..................................................................................................................... 5
Live Code Analysis ................................................................................................................................... 7
Debugging .............................................................................................................................................. 7
Apache Cordova ...................................................................................................................................... 8
New Platforms ......................................................................................................................................... 9
New Bundled Third-Party Tools.................................................................................................................. 9
Unity ..................................................................................................................................................... 13
CodeLens ............................................................................................................................................... 13
.NET 4.6 ................................................................................................................................................ 17
.NET Core .............................................................................................................................................. 17
ASP.NET ................................................................................................................................................ 18
Other .................................................................................................................................................... 18
Comparing Community, Professional, and Enterprise Editions .................................................................... 19

Choosing Editions ................................................................................................................................... 21
Community Edition ................................................................................................................................. 21
Professional Edition ................................................................................................................................ 22
Enterprise Edition ................................................................................................................................... 22
Useful Migration Paths ............................................................................................................................ 22
Other Options ........................................................................................................................................ 23
Visual Studio Team Services ................................................................................................................... 24
OmniSharp ............................................................................................................................................ 24
Summary .............................................................................................................................................. 25

 

■ Chapter 2: Working in Teams: Tasks and Code ......................................................................... 27

Applicable Principles .............................................................................................................................. 27
Project Management Triangle ................................................................................................................. 27
Vision ................................................................................................................................................... 28
Charter ................................................................................................................................................. 28
Sponsor ................................................................................................................................................ 29
Delivering Software ............................................................................................................................... 29
Types of Work ...................................................................................................................................... 29
Systems Development Lifecycle .............................................................................................................. 30
Iterative Development............................................................................................................................ 30
Domain Experts .................................................................................................................................... 31
Agile .................................................................................................................................................... 31
Scrum .................................................................................................................................................. 34
Tasks in Visual Studio ............................................................................................................................ 38
Waterfall Processes ............................................................................................................................... 47
Summary ............................................................................................................................................. 49

 

■ Chapter 3: Version Control.......................................................................................................... 51

Version Control Fundamentals ................................................................................................................ 51
The Lock-Modify-Unlock Model ............................................................................................................... 51
The Copy-Modify-Merge Model ............................................................................................................... 52
Version Control Terminology .................................................................................................................. 52
Branching ............................................................................................................................................. 53
Development Isolation ........................................................................................................................... 53
Hotfi x Isolation ..................................................................................................................................... 53
Feature Isolation ................................................................................................................................... 53
The Branching Big Picture ...................................................................................................................... 54
Using Git ............................................................................................................................................... 54
Intro to Git ............................................................................................................................................ 54
Basic Flow ............................................................................................................................................. 58
Advanced Flow ...................................................................................................................................... 59
OSS Flow .............................................................................................................................................. 62
Using TFVC ........................................................................................................................................... 62
Files Added to TFVC Must Be Part of the Project ...................................................................................... 63
Use Local Workspaces ........................................................................................................................... 64
Choosing TFVC or Git ............................................................................................................................ 65
Git-tfs .................................................................................................................................................. 65
Work Items .......................................................................................................................................... 65
Know Your Team Template ................................................................................................................... 65
Track Your Work .................................................................................................................................. 65
Associate Work Done with Work Items .................................................................................................. 66
Integrate with Git ................................................................................................................................ 66
Reviewing Code ................................................................................................................................... 66
What to Review ................................................................................................................................... 72
Generally Accepted Version Control Practices ......................................................................................... 75
Commit Early, Commit Often ................................................................................................................ 75
Do Not Commit Broken Code ................................................................................................................ 75
Do Not Commit Commented-Out Code .................................................................................................. 75

Do Not Commit Fewer Unit Tests .......................................................................................................... 76
Avoid Version Branches ........................................................................................................................ 76
Tag Milestones, Don’t Branch Them ...................................................................................................... 76
Use Feature Branches .......................................................................................................................... 76
Be Explicit with Source Branch When Branching (Git) ............................................................................. 77
Include Descriptive Commit Comments.................................................................................................. 77
Summary ............................................................................................................................................ 77

 

■ Chapter 4: Design and Architecture: Patterns and Practices ................................................... 79

Architecture ........................................................................................................................................ 79
Design ................................................................................................................................................ 80
Patterns and Practices .......................................................................................................................... 80
Non-Functional Requirements ............................................................................................................... 80
Anti-Patterns ....................................................................................................................................... 95
Enterprise Architecture ......................................................................................................................... 98
Solution Architecture ............................................................................................................................ 99
Application Architecture ..................................................................................................................... 100
Summary .......................................................................................................................................... 100

 

■ Chapter 5: Diagramming ........................................................................................................ 101

Diagrams, a Brief History ................................................................................................................... 101
Why Do We Need Diagrams? ............................................................................................................. 102
Types of Diagrams ............................................................................................................................ 103
Architectural Diagrams ....................................................................................................................... 103
Behavioral Diagrams .......................................................................................................................... 103
Directed Graph .................................................................................................................................. 103
UML Diagrams ................................................................................................................................... 106
Layer Diagrams ................................................................................................................................. 111
Other Diagramming Options ............................................................................................................... 112
What to Diagram ............................................................................................................................... 114
Summary .......................................................................................................................................... 122

 

■ Chapter 6: Development: Patterns and Practices ................................................................... 123

Metrics .............................................................................................................................................. 124
Cohesion ........................................................................................................................................... 124
Coupling ........................................................................................................................................... 124
Cyclomatic Complexity ....................................................................................................................... 124
Essential Complexity .......................................................................................................................... 125
Accidental Complexity ........................................................................................................................ 125
Code Coverage .................................................................................................................................. 125
Patterns ............................................................................................................................................ 126
Dependency Injection ........................................................................................................................ 127
Constructor Injection ......................................................................................................................... 127
Property Injection .............................................................................................................................. 128
Composite Root ................................................................................................................................. 128
Abstract Factory ................................................................................................................................ 129
Adapter ............................................................................................................................................ 130
Circuit Breaker .................................................................................................................................. 130
Bridge .............................................................................................................................................. 132
IoC Container ................................................................................................................................... 132
Command ........................................................................................................................................ 133
Decorator ......................................................................................................................................... 133
Façade ............................................................................................................................................. 135
Factory Method ................................................................................................................................. 135
Iterator ............................................................................................................................................. 136
Layers ............................................................................................................................................... 136
Mediator ............................................................................................................................................ 137
Memento ........................................................................................................................................... 138
Model ................................................................................................................................................ 139
Retry ................................................................................................................................................. 141
View .................................................................................................................................................. 142
Anti-Patterns ...................................................................................................................................... 143

Practices ............................................................................................................................................ 144
Principles ........................................................................................................................................... 144
Summary ........................................................................................................................................... 150

 

■ Chapter 7: Deployment: Patterns and Practices ..................................................................... 151

Application Development .................................................................................................................... 151
Application Development Practices ...................................................................................................... 151
Enterprise Development ..................................................................................................................... 154
Deployment Strategies ....................................................................................................................... 154
Environments .................................................................................................................................... 155
Practices ........................................................................................................................................... 159
Composable Systems ......................................................................................................................... 159
Health Monitoring .............................................................................................................................. 160
Quality Attributes ............................................................................................................................... 160
High Availability ................................................................................................................................. 161
Creating Environments ....................................................................................................................... 163
Write-Once Servers ............................................................................................................................ 164
Environment Flow .............................................................................................................................. 165
Promotion Over Per-Environment ........................................................................................................ 165
Parallelize .......................................................................................................................................... 165
Verify Prior to Production .................................................................................................................... 166
Similar Environments .......................................................................................................................... 166
Similar Deployments ........................................................................................................................... 166
Continuous Delivery ............................................................................................................................ 167
Smoke Testing ................................................................................................................................... 167
Summary ........................................................................................................................................... 168

 

■ Chapter 8: Testing ................................................................................................................... 169

Tests ................................................................................................................................................. 169
Unit Testing ....................................................................................................................................... 169
Unit Test Patterns ............................................................................................................................... 170
Mocking ............................................................................................................................................. 182
Whitebox Testing ................................................................................................................................ 188
Blackbox Testing ................................................................................................................................ 188
Fuzz Testing ...................................................................................................................................... 188
Negative Testing ................................................................................................................................ 189
Boundary Testing ............................................................................................................................... 190
Acceptance Testing ............................................................................................................................ 191
Loosely-Coupled Design ..................................................................................................................... 191
Test-Driven Development ................................................................................................................... 191
Integration Testing ............................................................................................................................ 192
Summary .......................................................................................................................................... 193
Index ................................................................................................................................................ 195

 

 

CHAPTER 1


Introduction to Visual Studio 2015
Visual Studio 2015 is a major release of Visual Studio. It incorporated some major advancements that Microsoft has been working on, from Project Rosyln to .NET Core. It not only is the latest version of Visual Studio, but it also introduces some major new features, technologies, and abilities. Let’s take a brief look at what’s new in Visual Studio 2015.

 

Intro to IDEs
First, let’s briefly go over what an Integrated Development Environment (IDE) means. IDEs provide a onestop environment to do most of your development/testing tasks within one user experience. IDEs typically provide an environment to edit, refactor, and compile code; edit user interfaces; diagram logic; build applications; and perform some level of code analysis, testing, and source code control integration.
IDEs started when there were only console terminals, so they originally started as console-based applications. Early IDEs only performed editing, file management, compilation, and debugging/execution. These environments worked with console-based applications only and did not need to visually edit the user interface. Later, as graphical user interfaces became available, IDEs started to support editing user interfaces. Although every user interface is based on a specification that is textual in nature, it’s rare that user interfaces are edited textually.
It wasn’t until much later that features like code analysis, refactoring, testing, and diagramming were added to IDEs. Obviously refactoring wouldn’t be added until after Martin Fowler’s book, Refactoring:
Improving the Design of Existing Code in 1999, and even then IDEs like Eclipse didn’t get inherent refactoring until 2002 or 2003. (Visual Studio got it in Visual Studio 2005.) Now we can’t imagine an environment without refactoring, code analysis, UI editing, and debugging. Despite all these features inherent in Visual Studio, many prefer to use add-ons like ReSharper or CodeRush. With Visual Studio’s rich plugin ecosystem, there’s almost always some third-party extension to do what you need.
Visual Studio 2015 has several technologies related specifically to integrated development environments. For example, IntelliSense is the Visual Studio 2015 “autocomplete” component. It has several features such as Complete Word, Parameter Info, Quick Info, and List Members, that intelligently allow developers to complete what they are typing based on context. Complete Word provides options to complete the word you are typing, which could be the name of variable or command. Parameter Info provides information about the parameters you are typing, such as the parameters of a method call. It shows the documentation and name of each parameter. Quick Info is similar to Parameter Info, but provides the documentation information for any identifier in your code. List Members is autocomplete for member invocation while typing (after entering the . ); it allows you to see the members that can be invoked for the given identifier and some quick documentation about each one.

Visual Studio 2015 has substantial debugging capabilities with features like IntelliTrace . IntelliTrace is a historical debugger for managed code that records events during execution within the debugger such as method calls, method parameters, exceptions, timings, memory usage, etc. This allows you to rewind code in the debugger should more information need be analyzed when a particular breakpoint is hit. This book isn’t specifically about working with an IDE. This information is provided to inform readers about the features of an IDE so that we can compare Visual Studio 2015 features.

 

Visual Studio 2015 Editions

Visual Studio 2015 continues the Editions idea of Visual Studio, providing multiple editions geared toward different segments of the market or toward different roles within organizations.


Difference from Version 2013

If you’re familiar with Visual Studio 2013 , it will be useful to look at what has changed in the Editions landscape. One of the biggest differences in 2015 from 2013 is the new Community Edition and the sunsetting of the Express Editions.
Prior to Visual Studio 2015 ( Visual Studio 2013 ), Visual Studio had Express Editions. This wasn’t merely one edition, it was really four—Visual Studio Express for Desktop, Visual Studio Express for Web, and Visual Studio Express for Windows. There was also a Team Foundation Server 2015 Express Edition.
Visual Studio Express for Desktop is an edition of Visual Studio 2013 that uses the familiar Visual Studio 2013 IDE that focuses on and facilitates development of desktop applications for Windows. This edition supports all the typical “native” platforms for windows: Windows Presentation Framework (WPF), Windows Forms, and Win32. Each platform generally has its own supported programming languages, but the Visual Studio Express for Desktop Edition supports C#, Visual Basic, and C++ . While this edition allows you to create applications for Windows 7 and beyond, it isn’t supported under Windows 10.
Visual Studio Express for Web is an edition of Visual Studio 2013 that uses the familiar Visual Studio 2013 IDE that facilitates development of web sites, web APIs, or ASP.NET. Visual Studio Express for Desktop edition supports C# and Visual Basic for ASP.NET and web APIs, and the typical web stack for web sites:
JavaScript, HTML, CSS, etc. This edition also isn’t supported under Windows 10.
Visual Studio Express for Windows is an edition of Visual Studio 2013 that uses the familiar Visual Studio 2013 IDE that facilitates development of Windows Store applications for Windows Phone and Windows 8.1+.
Windows Store applications can be written in C#, Visual Basic, HTML5/JavaScript, and C++. While this edition allows you to create applications for Windows 8.1 and beyond, it isn’t supported under Windows 10.
Express editions typically didn’t support extensions (some versions supported Microsoft-only extensions). This changed with the 2013 Community Edition that allowed extensions. Using the Community Edition meant the ability to create application/web sites/etc. with Visual Studio for free but still use extensions (like TestDriven.NET, NUnit, etc.)
Visual Studio Team Foundation Server 2015 Express is an edition of Visual Studio for non-programmers and non-testers. These are team members who need to work with work items, bugs, tasks, etc. (Otherwise, for team members who need to work with developers and testers but didn’t need to use any of the IDE features of Visual Studio, but just access TFS.) This edition became less and less important, as a web-based UI to TFS was created and has feature parity with Visual Studio Team Foundation Server 2015 Express (and in some cases, it’s much more feature-rich).
In Visual Studio 2013 all the Express Editions and the Community Edition are replaced by the one Community Edition. Users download the plugins, extensions, packs, packages, etc. and then can develop for the platform or platforms of their choice.
The Visual Studio 2013 Ultimate and Premium Editions have not been carried forward to Visual Studio 2015. Instead there is an Enterprise Edition, which effectively has the features of the Visual Studio 2013 Premium and Visual Studio 2013 Ultimate Editions.

 

Community
As detailed, Microsoft has historically had Express Editions of Visual Studio that allow developers to create applications/web sites with Microsoft technologies at no cost. The Express Editions were criticized for not including all the basic tools that good software deployment needs. Things like unit testing and code analysis were lacking in some Express Editions, leaving the moniker “integrated” somewhat of a misnomer. There are literally thousands of extensions for Visual Studio and, while Express Editions might not have included all the tools for good software development, an extension could have been found to compensate. Alas, Express Editions did not support extensions .
After the Visual Studio 2013 Editions were released, Microsoft (or Microsoft Developer Division, DevDiv) started to move to a more componentized model with Visual Studio. Quickly Visual Studio proper was just a shell and the various things that made it an IDE were extensions, packs, add-ons, plugins, etc. The features could then be updated out-of-band (e.g., once a quarter as Microsoft also moved to a more iterative development cycle). It was clear with this extensible model that the lack of extensions would hurt more than it benefited. The Community Edition was introduced and it allowed developers to use Visual Studio for various platforms at no cost but still use extensions. This allowed the four Express Editions (and the costly management of different SKUs that went along with it) to be sunsetted while making the community as a whole happier.
For the most part, the Community Edition of Visual Studio 2015 is a slightly scaled back version of the Professional Edition. The Community Edition, like the Express Editions, does not support “enterprise” development (which means an organization with >250 PCs or >US$1 million annual revenue or more than five Visual Studio users writing software). The Community Edition provides no support over and above the support someone could get in the community: StackOverflow, MSDN Forums, etc.
The Community Edition provides features for debugging, unit testing, code editing and refactoring, UI design, viewing dependency graphs and code maps, code analysis, and team collaboration.

 

Professional
The Visual Studio 2015 Professional Edition is very similar to the Visual Studio 2015 Community Edition. Probably the most obvious difference is cost. The cost varies depending on the licensing/subscription model, quantity, and whether it includes MSDN. There are courses and much material on licensing with Microsoft, so we won’t attempt to get into pricing here.
The important part of Visual Studio 2015 Professional is that the minimum requirement for use is “Enterprise Development” (five or more developers or an organization with >250 PCs, or an organization with >US$ 1 million in annual revenue).
Professional also includes CodeLens . CodeLens was introduced in Visual Studio 2013 (although only available in Ultimate) and allows developers to see what code references methods, how many unit tests there are, and how many are passing for a method, who was the last to edit the method, past and future edits to a method, and any work items associated with the method. Developers can see all this information without having to go out to the respective tools (TFS or GIT), therefore improving productivity.
In addition, Visual Studio 2015 Professional includes Team Foundation Server (TFS) features. It might seem a little strange that Visual Studio 2015 Professional is the lowest edition to support TFS since there is an Express (no-cost) edition of TFS, but this is mostly due to the fact that Visual Studio 2015 Professional includes a license for TFS, whereas Community does not. The Team Foundation Server “features” with Visual Studio 2015 Professional simply seem to be the Team Foundation Server features .

 

Enterprise

Visual Studio 2015 Enterprise Edition is the next level up from Visual Studio 2015 Professional. It’s the first edition to include creation and editing of architectural and design diagrams (although lower editions can view them). Unfortunately it’s also the lowest edition that supports architectural validation. Architectural validations perform validations based on design in diagrams. Diagrams like UML, Layer, etc. can be used to validate that the solution is abiding by the constraints of the diagrams. For the most part, this requires a lot of up-front design and isn’t part of non-Enterprise users running of unit tests. In fact, it has to be run manually and separately from unit tests. Presumably someone would occasionally validate the architecture in this way, but this doesn’t keep feedback close to when it was worked on, so this is problematic. It can, however, be set up on build in Team Foundation Server and be validated reasonably close to the work if gated checkins are used. If you’re using Git, however, this is a completely manual process.

 

لینک دانلود کتاب Practical Microsoft Visual Studio 2015.pdf 

 

 

 

عضویت در خبرنامه