1 / 50

Project Management

Project Management. StumbleUpon. Overview. Customize? Why, what, how? .NET Framework overview & fundamentals Class libraries, namespaces, classes Declaring and using variables Defining and using functions VS Projects & Solutions and folder/file organization Layered Applications

irving
Télécharger la présentation

Project Management

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Project Management

  2. StumbleUpon

  3. Overview • Customize? Why, what, how? • .NET Framework overview & fundamentals • Class libraries, namespaces, classes • Declaring and using variables • Defining and using functions • VS Projects & Solutions and folder/file organization • Layered Applications • Business Logic Layer & Testing • Presentation Layer (Windows Forms)

  4. Why customize ArcGIS ? Workflow. Software does not do EXACTLY what you want to do “out-of-the-box” but has the programming infrastructure required that allows you to customize it to do exactly what you want

  5. Extending ArcGIS, Add-ins, C#, & ArcObjects • Adding toolbars, buttons, tools, etc. • ArcGIS 10.1 provides tools for making Python Add-insArcGIS 10.0 did not (Free webinar) • ArcObjects SDK for the Microsoft .NET Framework will be covered in GIS Customization II • ArcObjects is more comprehensive than Python

  6. ArcEngine • Build your own GIS-enabled app • Does not require ArcGIS but does require ArcEngine runtime ($) • Not coveredin Customizationcourses

  7. Open Source GIS components

  8. Overview • Customize? Why, what, how? • .NET Framework overview & fundamentals • Class libraries, namespaces, classes • Declaring and using variables • Defining and using functions • VS Projects & Solutions and folder/file organization • Layered Applications • Business Logic Layer & Testing • Presentation Layer (Windows Forms)

  9. .NET Framework Overview CLS(Common Language Specification) C#, VB.NET, Managed C++, J# CLS specifes rules .NET languages must follow to create .NET code that will reference the.NET Framework Class Libraries (.NET DLL Assemblies) and .NET CTS. Framework Class Libraries UI Web Form WinForm WPF Services WCF WorkFlow Data Access ADO.NET Entity Framwork LINQ to SQL Framework Base Classes & CTS (Common Type System) IO, Collections, Security, Threading, etc. .NET compilers will compile.NET code into CIL stored in.NET assemblies (EXE or DLL) Compilers CIL(Common Intermediate Language) .NET CLR will perform JIT (Just-In-Time compilation) tonative machine code and ensure that the .NET assembly runs properly and securely. CLR(Common Language Runtime) Windows OS Win32, IIS, MSMQ

  10. System.Console.WriteLine() example mscorlib is required by CLR so no reference is required in code

  11. Compiling and running The 4.0 .NETFramework must be installed on the computer that will run a 4.0 Assembly(EXE) Use C# compilerto create hw.exe Running assembly invokes JIT by CLR and runs app

  12. using keyword for Namespaces static keyword means you don’t need an instance of the class Program to call the function Main.

  13. Class libraries, namespaces, classes Class Libraries are stored ina .NET assembly (DLL) Namespaces are a way of naming a group of related classes and other types. Namespaces can be nested. Namespaceicon

  14. Declaring and using variables Variable declaration syntax: [scope] [static] type name;

  15. Variable Scope Variable declaration syntax: [scope] [static] type name;

  16. Scope Review public internal (default) protected Entire solution private More … Assembly only More … Derived classes More … Class only More … 16 of 29

  17. Types Variable declaration syntax: [scope] [static] type name; string array etc. .NET Classes Classes you create. int long double bool etc.

  18. Defining and calling functions Syntax for defining functions: [scope] [static] return_type name ([params]) { // C# statements } 0 or more params are declared like variables and comma separated.

  19. Scope

  20. Command-line args for Console applications

  21. C# Compiler & command-line args

  22. Overview • Customize? Why, what, how? • .NET Framework overview & fundamentals • Class libraries, namespaces, classes • Declaring and using variables • Defining and using functions • VS Projects & Solutions and folder/file organization • Layered Applications • Business Logic Layer & Testing • Presentation Layer (Windows Forms)

  23. Projects … … because any application worth building usually has more than one .cs file and other files (e.g. images, cursors, etc.)

  24. Solutions … … because Projects must be part of a Solution Visual Studio Solution (.sln) * Projects (.csproj)

  25. Folder structure for application development Download …

  26. Creating an app dev folder - Create a New Project … Blank Solution, in src- Save - Exit Visual Studio - Move files up one level into src - Delete solution folder Solutions can include code from other CLS languages (e.g. VB.NET)

  27. Adding a Project to a Solution

  28. StartUp Project is the first project to run when the application is run Class Library Projects cannot be set as the StartUp Project StartUp Project

  29. Overview • Customize? Why, what, how? • .NET Framework overview & fundamentals • Class libraries, namespaces, classes • Declaring and using variables • Defining and using functions • VS Projects & Solutions and folder/file organization • Layered Applications • Business Logic Layer & Testing • Presentation Layer (Windows Forms)

  30. Layered Applications Presentation Layer BLL Business objects & logic Business Logic Layer DAL Read/Write data from/to a database Data Access Layer Data

  31. Steps to building a layered application • Get requirements for application feature(s) • Decide on a presentation layer and sketch it out(no code) • Create the … • Data access layer and tests, debug • Business logic layer and tests, debug • Presentation layer and connect to business layer, debug • Test the application • Create installer • Deploy application to users • Repeat until all application features are complete

  32. Creating a Business Layer • Add Class Library Project to Solution • Suffix name with BLL (e.g. IssueTrackerBLL) • Add classes to represent the business objects • Add properties and methods to these classes to represent the business data and processes respectively

  33. Testing a Business Layer • Create a Test Project • Common to have one Test Project per application Project • Suffix Test Project name with “Tests”

  34. Adding a Test

  35. Editing the TestMethod

  36. Running the test – no debugging With cursor in test method … Or right-click and use TestDriven.NET

  37. Running the test – with debugging With cursor in test method … Or right-click and use TestDriven.NET Need Breakpoint(F9 to toggle)

  38. Test results

  39. Overview • Customize? Why, what, how? • .NET Framework overview & fundamentals • Class libraries, namespaces, classes • Declaring and using variables • Defining and using functions • VS Projects & Solutions and folder/file organization • Layered Applications • Business Logic Layer & Testing • Presentation Layer (Windows Forms)

  40. Building a Presentation Layer (UI) • Add UI Application Project that satisfies the requirements • Windows • Console Application • Windows Forms Application • WPF Application • Web • ASP.NET Web Application • ASP.NET MVC Application • Silverlight Application • Suffix Project name with UI • This is the StartUp Project

  41. Windows Forms Application • A Form is a container for UI controls • Common for starting form to have name MainForm Drag & Drop from Toolbox

  42. Naming child controls • Give child control names prefixes • btn = Button • txt = TextBox • lbl = Label • lst = ListBox • cbo = ComboBox • rdo = RadioButton • etc. • Adding code to controls … Double-click control or code by hand

  43. “Connecting” the UI and BLL Add Reference in UI to BLL Project Add using to UI code(MainForm.cs in this example)

  44. Example: Accessing BLL from UI

  45. Links for VS 2010 and C# • “Quick Tour” of the VS 2010 IDE • Beginner Developer Learning Centre • Csharp-station.com tutorial

  46. Keys to remember F1 – Context sensitive Help (If cursor is on keyword, help on keyword provided) F6 – Build code (compile) without running F5 – Build code (compile) and run F11 – Step through code, into called functions F10 – Step through code, not into called functions Shift-F5 – Stop running code F9 – Toggle Breakpoint at current statement

  47. Overview • Customize? Why, what, how? • .NET Framework overview & fundamentals • Class libraries, namespaces, classes • Declaring and using variables • Defining and using functions • VS Projects & Solutions and folder/file organization • Layered Applications • Business Logic Layer & Testing • Presentation Layer (Windows Forms)

More Related