Structure and Guidance for Organizing Applications within Visual Studio

30
Structure and Guidance for Organizing Applications within Visual Studio Keith Elder Quicken Loans Manager, Sr. Software Engineer Microsoft MVP Keith a t keithelder dot net Blog: http://keithelder.net/blog/

description

Structure and Guidance for Organizing Applications within Visual Studio. Keith Elder Quicken Loans Manager, Sr. Software Engineer Microsoft MVP Keith a t keithelder dot net Blog: http://keithelder.net/blog/ . Quicken Loans. About Quicken Loans. - PowerPoint PPT Presentation

Transcript of Structure and Guidance for Organizing Applications within Visual Studio

Page 1: Structure and Guidance for Organizing Applications  within Visual Studio

Structure and Guidance for Organizing Applications within Visual Studio

Keith ElderQuicken LoansManager, Sr. Software EngineerMicrosoft MVPKeith a t keithelder dot netBlog: http://keithelder.net/blog/

Page 2: Structure and Guidance for Organizing Applications  within Visual Studio

Quicken Loans

Page 3: Structure and Guidance for Organizing Applications  within Visual Studio

About Quicken Loans Originally founded in 1985 as Rock Financial by Dan Gilbert

Grew to one of the largest independent mortgage banks in the country

1998 IPO 1999 Launched Rockloans.Com

1999 Intuit, Inc (makers of TurboTax and Quicken) purchased Rock Financial.

July 2002 Dan Gilbert purchased Quicken Loans back from Intuit. Retained Quicken Loans branding and marketing initiatives.

4500 employees Largest online retail home loan lender

Page 4: Structure and Guidance for Organizing Applications  within Visual Studio

Deep Fried Bytes is an audio talk show with a Southern flavor hosted by technologists and developers Keith Elder and Chris Woodruff. The show discusses a wide range of topics including application development, operating systems and technology in general. Anything is fair game if it plugs into the wall or takes a battery.

http://deepfriedbytes.com

Page 5: Structure and Guidance for Organizing Applications  within Visual Studio

Take Aways Covering the basics of solutions and

projects Things to consider before setting up your

projects Configuring the project

Initial project creation Organizing our project Handling Third Party Assemblies

Page 6: Structure and Guidance for Organizing Applications  within Visual Studio

Ever seen projects that look like this?

Your Mom Was Right!

User InterfaceDatabase

Business Logic

Web Services

Mob

ile

Components

How about this?

Page 7: Structure and Guidance for Organizing Applications  within Visual Studio

ELDERISM

Messy projects

take longer to

understand and will only get messier.

Page 8: Structure and Guidance for Organizing Applications  within Visual Studio

Task: Take my water hose and setup a sprinkler in my yard.

This is how your code looks to new team members if you don’t think about structure.

Being organized makes maintenance and future growth easier.

It is easier to be messy. Takes higher level thought to be organized.

Page 9: Structure and Guidance for Organizing Applications  within Visual Studio

The Joy of Wallowing in a Perfect Mess

Page 10: Structure and Guidance for Organizing Applications  within Visual Studio

What did we learn?

Localize Changes

Separate

Concerns

Help your team

members

a r Or g a i nz

a ti On

m

t tes

ORGANIZATION MATTERS

Page 11: Structure and Guidance for Organizing Applications  within Visual Studio

Basics

Page 12: Structure and Guidance for Organizing Applications  within Visual Studio

Projects and SolutionsProjects – all files belong to a project

Library Windows Form Component

Solutions – are what you deploy

Interface

Components

Accounts Payable

Common

Accounts Receivable

Payroll

Business Layer

Inventory

Data Layer

Web Application

Interface

Components

Accounts Payable

Common

Accounts Receivable

Payroll

Business Layer

Inventory

Data Layer

WindowsApplication

Page 13: Structure and Guidance for Organizing Applications  within Visual Studio

Example Solution

Projects

Solution Folders

Page 14: Structure and Guidance for Organizing Applications  within Visual Studio

Three Solution Types

Page 15: Structure and Guidance for Organizing Applications  within Visual Studio

Single Solution

Visual Studio Solution

Interface

Components

Accounts Payable

Common

Accounts Receivable

Payroll

Business Layer

Inventory

Data Layer

Really Cool Piece of Software

Page 16: Structure and Guidance for Organizing Applications  within Visual Studio

Multiple SolutionsD

E

F

C

A

B

Page 17: Structure and Guidance for Organizing Applications  within Visual Studio

This is your continuous integration build.

Master Solution

Interface

Components

Accounts Payable

Common

Accounts Receivable

Payroll

Business Layer

Inventory

Data Layer

Interface

Accounts Payable

Common

Accounts Receivable

Payroll

Inventory

Data Layer

Interface

Components

Common

Payroll

Business Layer

Inventory

Data Layer

Common

Accounts Receivable

Business Layer

Inventory

Page 18: Structure and Guidance for Organizing Applications  within Visual Studio

Before you write a single line of

code

Page 19: Structure and Guidance for Organizing Applications  within Visual Studio

It Starts With The Namespace

Company

Team

Product

Layer

Company

Product

Module

Layer

Examples

Microsoft

Practices

EnterpriseLibrary

WidgetsRUs

Helpdesk

Page 20: Structure and Guidance for Organizing Applications  within Visual Studio

Where do these projects go?

Page 21: Structure and Guidance for Organizing Applications  within Visual Studio

C:\Dev\MyApp

Source

HelpDesk

BusinessLayer

DataLayer

Services

WorkFlow

UIWinFor

mWeb

Mobile

Common

ThirdPartyAssemblies

Company.MyApp.HelpDesk.UI.WinForm

Company.MyApp.HelpDesk.UI.Mobile

Folder Structure For Application

Module

Project Folders

Company.MyApp.HelpDesk.BusinessLayer

Company.MyApp.HelpDesk.DataLayer

Project Folder

Page 22: Structure and Guidance for Organizing Applications  within Visual Studio

ELDERISM

Adding a project to a late project

makes it later.

The Mythical Man-Month, Fred Brooks, “Adding manpower to a late software project makes it later. “

Page 23: Structure and Guidance for Organizing Applications  within Visual Studio

Source Folder

Where are the solution files?

CI Helpdesk Service

Master Web

Master Mobile

Master WinForm

Page 24: Structure and Guidance for Organizing Applications  within Visual Studio

Real world exampleInterface

Components

WEB

Interface

Components

Interface

Components

Interface

Components

MOBILE SERVICE SMART CLIENT

Database

DataLayer

Business

Workflow

Page 25: Structure and Guidance for Organizing Applications  within Visual Studio

Those pesky third party assemblies

Page 26: Structure and Guidance for Organizing Applications  within Visual Studio

C:\Dev\MyApp

Source

ThirdPartyAssemblies

Third Party Assemblies

Name of Library

Version1

Version2

Allows you to version libraries. On larger projects the whole system may not change at once.

Projects use a relative path

of: ../../../

Developers can checkout source control and do a

build

And, so can your automated

build server!

Can put DLL here, wouldn’t recommend strong named assemblies.

Page 27: Structure and Guidance for Organizing Applications  within Visual Studio

Did you test it though?

Page 28: Structure and Guidance for Organizing Applications  within Visual Studio

C:\Dev\MyApp

Source

Tests

Tests

Inventory.TestsInventory.BusinessLayer.TestsUI.Web.Tests

Each project should have a corresponding tests project.

While it doesn’t matter *where* you put your tests projects, we’ve found it easier to deal with them all in one location.

Pick a standard, stick to it.

Page 29: Structure and Guidance for Organizing Applications  within Visual Studio

DemoCreating Our

Application: SkunkWorks ERP

Page 30: Structure and Guidance for Organizing Applications  within Visual Studio

Resources My Blog

http://keithelder.net/blog/ http://keithelder.net/presentations/ http://deepfriedbytes.com

Email Keith a t keithelder dot net

Resources http://shrinkster.com/oqh (team development

with visual studio)