ITF11006.NET Industrial Programming. Guidelines – Development Guidelines – UX Guidelines Quality Measures – Code Metrics – Code Analyses Robustness –

Slides:



Advertisements
Similar presentations
Samsung Smart TV is a web-based application running on an application engine installed on digital TVs connected to the Internet.
Advertisements

Chapter 3 – Web Design Tables & Page Layout
Coding Standard: General Rules 1.Always be consistent with existing code. 2.Adopt naming conventions consistent with selected framework. 3.Use the same.
Chapter 9 Chapter 9: Managing Groups, Folders, Files, and Object Security.
SQL Injection Attacks Prof. Jim Whitehead CMPS 183: Spring 2006 May 17, 2006.
1 Frameworks. 2 Framework Set of cooperating classes/interfaces –Structure essential mechanisms of a problem domain –Programmer can extend framework classes,
Chapter 3 Data Abstraction: The Walls. © 2005 Pearson Addison-Wesley. All rights reserved3-2 Abstract Data Types Modularity –Keeps the complexity of a.
 2006 Pearson Education, Inc. All rights reserved Introduction to Classes and Objects.
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.
Form Handling, Validation and Functions. Form Handling Forms are a graphical user interfaces (GUIs) that enables the interaction between users and servers.
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.
Programming with Microsoft Visual Basic 2012 Chapter 13: Working with Access Databases and LINQ.
Microsoft Visual Basic 2005: Reloaded Second Edition
CSCI 6962: Server-side Design and Programming Validation Tools in Java Server Faces.
Computer Science Standard Level Mastery Aspects. Mastery Item Claimed JustificationWhere Listed Arrays Used to store the student data Lines P.
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.
9 Chapter Nine Compiled Web Server Programs. 9 Chapter Objectives Learn about Common Gateway Interface (CGI) Create CGI programs that generate dynamic.
Physical Database Design Chapter 6. Physical Design and implementation 1.Translate global logical data model for target DBMS  1.1Design base relations.
Murach’s ASP.NET 4.0/VB, C1© 2006, Mike Murach & Associates, Inc.Slide 1.
Exceptions Handling Exceptionally Sticky Problems.
HOME EVIDENCE EXECUTION MICROSOFT SOLUTIONS SERVICES PARTNERS Custom Field Controls and SharePoint Web Content Management Chakkaradeep Chandran Robert.
Introduction to Exception Handling and Defensive Programming.
1 Chapter Overview Performing Configuration Tasks Setting Up Additional Features Performing Maintenance Tasks.
The Price Index Processor System PIPS Niall O’Hanlon.
Creating Graphical User Interfaces (GUI’s) with MATLAB By Jeffrey A. Webb OSU Gateway Coalition Member.
Microsoft Access 2010 Chapter 10 Administering a Database System.
Javadoc A very short tutorial. What is it A program that automatically generates documentation of your Java classes in a standard format For each X.java.
1 MIS309 Database Systems Introduction to Microsoft Access.
Javadoc Dwight Deugo Nesa Matic
Chapter 2: Variables, Functions, Objects, and Events JavaScript - Introductory.
Feb. 8, 2008 UHCO Graduate Course in MATLAB Core Programming Module Best Practices Core Grant Programming Module Best Practices (Coding Conventions) General.
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.
ASP.NET Web Services.  A unit of managed code installed under IIS that can be remotely invoked using HTTP.
Managing C++ CHRIS DAHLBERG MID-TIER DEVELOPER SCOTTRADE.
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.
.NET Mobile Application Development XML Web Services.
User Interface Programming in C#: Basics and Events Chris North CS 3724: HCI.
Uploading in PHP CPTE 212 2/24/2015 John Beckett.
Introduction to ASP.NET, Second Edition2 Chapter Objectives.
Programming with Microsoft Visual Basic 2012 Chapter 14: Access Databases and SQL.
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
Industrial Programming
Software Metrics 1.
Jim Fawcett CSE681 – SW Modeling & Analysis Fall 2014
WORKSHOP 1 CUSTOM TIRE SUBROUTINE
Handling Exceptionally Sticky Problems
Error Message Handling
Coding Defensively Coding Defensively
About the Presentations
PHP Training at GoLogica in Bangalore
Unit Test Pattern.
ALEPH Version 22 Beginning Cataloging
Exception Handling Chapter 9.
Introduction to Classes and Objects
Programming in C# Lesson 5. Exceptions..
Tonga Institute of Higher Education
These slides are for reference only. They are not "lecture notes"
How to organize and document your classes
Handling Exceptionally Sticky Problems
Presentation transcript:

ITF11006.NET 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 ( Design Guidelines for Developing Class Librarieshttp://msdn.microsoft.com/en-us/library/ms aspx – Guidelines for Names Capitalization Conventions ( Capitalization Conventionshttp://msdn.microsoft.com/en-us/library/ms229043(v=vs.100).aspx) Use Pascal casing ALLWAYS Except, use camel casing for: – parameter names – variables and (none-public) fields – Member Design Guidelines Choosing Between Properties and Methods ( Choosing Between Properties and Methods – Never public fields (except for structs) Documentation of code

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

Documentation of code (cont.) XML tags ( XML tags – summary – param – example – code – exception – returns GhostDoc ( GhostDoc

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

Windows Size – Default – Min – Max Windows Position 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 – 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,( * ln(Halstead Volume) * (Cyclomatic Complexity) * 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 MetricGreenYellowRed Maintainability Index <40 Cyclomatic complexity< >20 Class Coupling< >20 Lines of Code< >30 Use MS official sample – “Image slideshow in full screen mode” ( )

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

Exception Handling

Catching Exceptions

Exceptions Design Guidelines for Exceptions ( Design Guidelines for Exceptions Do not throw System.Exception Inherit from System.Exception End with Exception

User Defined Exceptions public class NewException : BaseException, ISerializable { public NewException() { // Add implementation. } public NewException(string message) { // Add implementation. } public NewException(string message, Exception inner) { // Add implementation. } // This constructor is needed for serialization. protected NewException(SerializationInfo info, StreamingContext context) { // Add implementation. }

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

Resource handling Unmanaged resources – Implementing IDisposable – Consuming Using vs. try/finally Closing vs Disposing – Database, files, …