.NET
  Home arrow .NET arrow Page 3 - The Basics
ASP Free Forums 
.NET  
ASP  
ASP Code  
ASP.NET  
ASP.NET Code  
BrainDump  
C#  
Code Examples  
Database  
Database Code  
IIS  
Microsoft Access  
MS SQL Server  
Visual Basic.NET  
Windows Scripting  
Windows Security  
XML  
ASP Web Hosting  
ASP.NET Web Hosting 
Mobile Linux 
App Generation ROI 
Windows Web Hosting
 
IBM® developerWorks 
Sun Developer Network 
Weekly Newsletter
 
Developer Updates  
Free Website Content 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us Get Paid 
Request Media Kit
Contact Us 
Site Map 
Privacy Policy 
Support 
 USERNAME
 
 PASSWORD
 
 
  >>> SIGN UP!  
  Lost Password? 
.NET

The Basics
By: Apress Publishing
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 3 stars3 stars3 stars3 stars3 stars / 19
    2005-04-06

    Table of Contents:
  • The Basics
  • Modeling a Logon Process
  • Coding Conventions
  • Generating the VB .NET Code for the Logon Class
  • Generating the C# Code for the Logon Class
  • ER and ORM Diagrams
  • Generating the Database
  • Reverse Engineering a Database

  • Rate this Article: Poor Best 
      ADD THIS ARTICLE TO:
      Del.ici.ous Digg
      Blink Simpy
      Google Spurl
      Y! MyWeb Furl
    Email Me Similar Content When Posted
    Add Developer Shed Article Feed To Your Site
    Email Article To Friend
    Print Version Of Article
    PDF Version Of Article
     
     
    ADVERTISEMENT


    The Basics - Coding Conventions


    (Page 3 of 8 )

    Although this chapter isn’t about coding conventions, and it doesn’t even contain a lot of code, we want to get the message across, before you start e-mailing us about our coding conventions. We use the following Microsoft-endorsed and/or recommended guidelines:

    We’re aware that some of these documents overlap, but they will give you an idea of why and how we name our classes, constants, variables, and so on.


    NOTE VEA 2003 comes with a complete set of data types supported by the four programming languages you get with the VSEA edition: C#, C++, J#, and VB .NET. You can also choose from the Interface Definition Language (IDL) data types, which means you might avoid having separate models for different target languages. However, the IDL data types don’t support all the data types in the three mentioned programming languages. On the other hand, IDL does support data types that are supported in only some of the three programming languages. One such example is unsigned data types, which aren’t supported in VB .NET. One thing you can do is to use IDL data types for all the generic data types, and then use more language-specific ones when they are necessary.

    Now that you’ve named the class and created the attributes for it, you need to create the operations for it. Exercise 1-3 demonstrates how to specify operations and their parameters.

    EXERCISE 1-3

    1. Open the UML Class Properties dialog box (if it isn’t already open).

    2. Select the Operations category from the Categories list.

    3. Create a new operation by clicking the New button.

    4. Type Logon in the Operation column.

    5. Select VB::Boolean from the Return Type list.

    6. Click the Properties button while the Logon operation is selected to open the UML Operation Properties dialog box.
    7. Select the Code Generation Options category from the Categories list.

    8. Select Procedure from the Operation Kind list.

    9. Select the Parameters category from the Categories list.

    10. Create a new parameter by clicking the New button.

    11. Type userID in the Parameter column.

    12. Select VB::String from the Type list, and ensure “in” is selected in the Kind column.

    13. Repeat steps 10 through 12, creating a new input parameter with the name password. The UML Operation Properties dialog box should now look like Figure 1-4.


    Figure 1-4.  The UML Operation Properties dialog box showing parameters

      14.  Click OK.

      15.  Select the Code Generation Options category from the
            Categories list.

      16.  Select Visual Basic from the Target language list.

      17.  Click OK. You return to the class diagram, which is updated to
            reflect the changes you’ve made. (You may need to select
            View -> Zoom to adjust the class size on the diagram.) The class
            has a new name, Logon, and the attributes and operations are
            displayed, divided by a horizontal line, as shown in Figure 1-5.


    Figure 1-5.  The Class diagram with the updated class


    Now that you’ve actually completed the class skeleton for the example, let’s take a moment to recap what you did to get to this point:

    1. Created a new UML model diagram

    2. Added a class to the diagram

    3. Created two attributes (private variables) for the class

    4. Created a public operation (procedure) with two input parameters

    5. Specified the target programming language as Visual Basic

    Now you just need to save the UML model, following the steps in Exercise 1-4.

    EXERCISE 1-4

    1. Select File -> Save.

    2. Browse to the location you want to save the model in and type a name in the Save As dialog box. Save the model with this name and path for easy access

    in later exercises and chapters: \EDWVSNETUMLMSF\Chapter 01\ VB .NET\Logon.vsd.

       3. Click OK.


    This article is excerpted from Enterprise Development with Visual Studio .NET, UML, and MSF by John Erik Hansen and Carsten Thomsen (Apress, 2004; ISBN 1590590422). Check it out at your favorite bookstore today. Buy this book now.

    More .NET Articles
    More By Apress Publishing


     

    .NET ARTICLES

    - Using CrystalReportViewer to Display Crystal...
    - Creating Summary .Net Crystal Reports
    - More on Commands, Input and the WPF
    - Grouping and Aggregating When Querying LINQ ...
    - Commands, Input and the WPF
    - Keyboard and Ink Input with WPF
    - Mouse Input and the WPF
    - Input with Windows Presentation Foundation
    - Introducing LINQ with XML and Databases
    - An Introduction to LINQ
    - Querying LINQ to SQL: Basics
    - Completing a Simple Storefront with LINQ
    - Knowing Your Environment: the System.Environ...
    - Creating the Home Page for a Simple Storefro...
    - LINQ Quickly with Language Integrated Queries

     
    Best Practices for Windows Vista Migration Presentation
    Dell and Microsoft recently held a series of face-to-face seminars entitled, &qu....

     
    Creating a Culture for Code Reuse
    If you oversee development teams you know that like it or not proprietary and ex....

     
    Keys to Web Application Acceleration: Advances in Delivery Systems
    Accelerate Web apps by up to 5x. Ensure significantly faster access to the Web a....

     
    Optimizing Application Monitoring
    Tired of finding out from your customers that you're offline? This white paper e....

     
    Solaris to Solaris Migration -- Migrating applications from Sun SPARC to Dell PowerEdge R900
    This comprehensive Migration Guide reviews the approach that Principled Technolo....

     




    © 2003-2009 by Developer Shed. All rights reserved. DS Cluster 4 hosted by Hostway
    Stay green...Green IT