Industrial Programming

Slides:



Advertisements
Similar presentations
Chapter 3 – Web Design Tables & Page Layout
Advertisements

AS ICT Finding your way round MS-Access The Home Ribbon This ribbon is automatically displayed when MS-Access is started and when existing tables.
Visual Studio Tips and Tricks Code Metrics Zain Naboulsi Sr. Developer Evangelist Microsoft Blog: blogs.msdn.com/
Advantage Data Dictionary. agenda Creating and Managing Data Dictionaries –Tables, Indexes, Fields, and Triggers –Defining Referential Integrity –Defining.
70-290: MCSE Guide to Managing a Microsoft Windows Server 2003 Environment Chapter 5: Managing File Access.
Chapter 3 Data Abstraction: The Walls. © 2005 Pearson Addison-Wesley. All rights reserved3-2 Abstract Data Types Modularity –Keeps the complexity of a.
Flowchart Start Input weight and height
Using the Visual Basic Editor Visual Basic for Applications 1.
ASP.NET Programming with C# and SQL Server First Edition
ASP.NET Programming with C# and SQL Server First Edition Chapter 8 Manipulating SQL Server Databases with ASP.NET.
Microsoft Excel 2003 Illustrated Complete Excel and Advanced Worksheet Management Customizing.
1 An Introduction to Visual Basic Objectives Explain the history of programming languages Define the terminology used in object-oriented programming.
Chapter 1 Introduction to Programming and C# Programming in C#.NET © 2003 by The McGraw-Hill Companies, Inc. All rights reserved.
Microsoft Visual Basic 2005 CHAPTER 8 Using Procedures and Exception Handling.
Tutorial: Introduction to ASP.NET Internet Technologies and Web Application 4 th February 2010.
Database-Driven Web Sites, Second Edition1 Chapter 8 Processing ASP.NET Web Forms and Working With Server Controls.
Programming with Microsoft Visual Basic 2012 Chapter 13: Working with Access Databases and LINQ.
ITF11006.NET Industrial Programming. Guidelines – Development Guidelines – UX Guidelines Quality Measures – Code Metrics – Code Analyses Robustness –
Microsoft Visual Basic 2012 Using Procedures and Exception Handling CHAPTER SEVEN.
* A form is another means of viewing information from a table & displaying the information one record at a time. Access Lesson 1 Lesson Plans Michele Smith.
Microsoft Excel 2007 © Wiley Publishing All Rights Reserved. The L Line The Express Line to Learning L Line.
CSCI 6962: Server-side Design and Programming Validation Tools in Java Server Faces.
70-290: MCSE Guide to Managing a Microsoft Windows Server 2003 Environment, Enhanced Chapter 5: Managing File Access.
Keith Elder Microsoft MVP
Web Programming: Client/Server Applications Server sends the web pages to the client. –built into Visual Studio for development purposes Client displays.
The set of files includes : Tcl source of the POLYGON program The database (file obtained initially by P.Afonine from using phenix.model_vs_data.
OCC Network Drives  H:\  P:\ 
Introduction to Exception Handling and Defensive Programming.
Visual Basic.NET BASICS Lesson 5 Exponentiation, Order of Operations, and Error Handling.
The Price Index Processor System PIPS Niall O’Hanlon.
Microsoft Access 2010 Chapter 10 Administering a Database System.
Enhancing Forms with OLE Fields, Hyperlinks, and Subforms – Project 5.
Programming with Visual Studio 2005.NET A short review of the process.
Chapter 3 MATLAB Fundamentals Introduction to MATLAB Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
1 MIS309 Database Systems Introduction to Microsoft Access.
1 Guide to Oracle10G CHAPTER 7: Creating Database Reports 7.
Web Services Error Handling and Debugging. Agenda Simple SOAP faults Advanced SOAP faults SOAP headers and faults Error handling From a Service Perspective.
© Copyright by Deitel & Associates, Inc. and Pearson Education Inc. All Rights Reserved. 1 Outline 5.1 Test-Driving the Inventory Application.
Business Rules for MeF By Greg Martinez & Donna Mucilli.
CN1260 Client Operating System Kemtis Kunanuraksapong MSIS with Distinction MCT, MCITP, MCTS, MCDST, MCP, A+
HTML IMAGES. CONTENTS IMG Tag Alt Attribute Setting Width and Height Of An Image Summary Exercise.
1 Terminology. 2 Requirements for Network Printing Print server Sufficient RAM to process documents Sufficient disk space on the print server.
Visual Basic.NET Comprehensive Concepts and Techniques Chapter 3 Building an Application in the Visual Basic.NET Environment.
Text INTRODUCTION TO ASP.NET. InterComm Campaign Guidelines CONFIDENTIAL Simply Server side language Simplified page development model Modular, well-factored,
CIS-NG CASREP Information System Next Generation Shawn Baugh Amy Ramirez Amy Lee Alex Sanin Sam Avanessians.
Uploading in PHP CPTE 212 2/24/2015 John Beckett.
Introduction to ASP.NET, Second Edition2 Chapter Objectives.
A S P. Outline  The introduction of ASP  Why we choose ASP  How ASP works  Basic syntax rule of ASP  ASP’S object model  Limitations of ASP  Summary.
Static Software Metrics Tool
Top 10 Entity Framework Features Every Developer Should Know
ASP.NET Programming with C# and SQL Server First Edition
Chapter 2: The Visual Studio .NET Development Environment
Software Metrics 1.
WORKSHOP 1 CUSTOM TIRE SUBROUTINE
22-INTEGRATION HUB
Computer Programming I
Coding Defensively Coding Defensively
Microsoft Access Illustrated
Using Procedures and Exception Handling
ALEPH Version 22 Beginning Cataloging
Web Development in Microsoft Visual Studio 2013
Variables and Arithmetic Operations
Decisions, repetition, Code Snippets, Comments, and Intellisense
Programming in C# Lesson 5. Exceptions..
Visual Studio.
Exception Handling Imran Rashid CTO at ManiWeber Technologies.
Tonga Institute of Higher Education
Presented by Trey Brumley and Ryan Carter
These slides are for reference only. They are not "lecture notes"
敦群數位科技有限公司(vanGene Digital Inc.) 游家德(Jade Yu.)
Presentation transcript:

Industrial Programming ITF11006 .NET Industrial Programming

Industrial Programming Guidelines Development Guidelines UX Guidelines Quality Measures Code Metrics Code Analyses Robustness Error handling (exceptions) Resource handling

Guidelines Design Guidelines for Developing Class Libraries (http://msdn.microsoft.com/en-us/library/ms229042.aspx) Guidelines for Names Capitalization Conventions (http://msdn.microsoft.com/en-us/library/ms229043(v=vs.100).aspx) Member Design Guidelines Choosing Between Properties and Methods (http://msdn.microsoft.com/en-us/library/ms229054.aspx) Documentation of code

Documentation of code Documentable Entities Class / Struct Method … Cannot document Namespace through XML tag Shows up in Object Browser Intellisense Library Documentation

Documentation of code (cont.) XML tags (http://msdn.microsoft.com/en-us/library/5ast78ax.aspx) summary param example code exception returns GhostDoc

Guidelines Design Guidelines for Developing Class Libraries (http://msdn.microsoft.com/en-us/library/ms229042.aspx) Guidelines for Names Capitalization Conventions (http://msdn.microsoft.com/en-us/library/ms229043(v=vs.100).aspx) Member Design Guidelines Choosing Between Properties and Methods (http://msdn.microsoft.com/en-us/library/ms229054.aspx) Documentation of code UX Guidelines

UX Guidelines Windows Size Resizing must work! Clean layout Shortcuts Default Min Max Resizing must work! Clean layout Shortcuts Tab-order

Industrial Programming Guidelines Development Guidelines UX Guidelines Quality Measures Code Metrics Code Analyses Robustness Error handling (exceptions) Resource handling

Code Metrics Cyclomatic complexity Class Coupling Lines of Code Structural complexity of code Calculates number of different code paths High values requires more unit tests to cover all paths Class Coupling Measures the Efferent Coupling, the number of classes this method depends on High coupling means brittle, likely to change, probably unfocused and lack of responsibility Lines of Code Based on IL, so approximate, but better than source Excludes white space, comments, braces, types etc.

Code Metrics (cont.) Maintainability Index: A weighted number based on Halstead volume, cyclomatic complexity and lines of code Maintainability Index = MAX(0,(171 - 5.2 * ln(Halstead Volume) - 0.23 * (Cyclomatic Complexity) - 16.2 * ln(Lines of Code))*100 / 171) A green rating is between 20 and 100 and indicates that the code has good maintainability. A yellow rating is between 10 and 19 and indicates that the code is moderately maintainable. A red rating is a rating between 0 and 9 and indicates low maintainability.

Code Metrics Use MS official sample Green Yellow Red Maintainability Index 100-60 60-40 <40 Cyclomatic complexity <10 10-20 >20 Class Coupling Lines of Code 10-30 >30 Use MS official sample “Image slideshow in full screen mode” (http://code.msdn.microsoft.com/CSImageFullScreenSlideShow-79e29568)

Code Metrics – VS 2010

Code Metrics – Excel

Code Analyses Rule Set Rule Action Automatic / Manual execution Use from Start

Code Analyses - Settings

Code Analyses – Results/Fix

Code Analyses – Requirements Microsoft Minimum Recommended Rules +Microsoft.Naming (All) HiOf.Net.ruleset

Industrial Programming Guidelines Development Guidelines UX Guidelines Quality Measures Code Metrics Code Analyses Robustness Defensive Programming Error handling (exceptions) Resource handling

Defensive Programming Handle anticipated deviations Missing Directory / File Lack of database connectivity Lost database connection Verify input data Do not let the user enter erroneous data Guard against SQL injection Use SQL procedures / bind variables

Error handling

Exceptions Do not throw System.Exception Inherit from System.Exception End with Exception

Exceptions Exception handling Throwing exceptions Exception info Message InnerException Library code rethrows/do not catch Clients shall handle exceptions

Resource handling