ASP.NET
  Home arrow ASP.NET arrow Page 2 - An Object Driven Interface with .Net
Dev Articles Forums 
ADO.NET  
Apache  
ASP  
ASP.NET  
C#  
C++  
ColdFusion  
COM/COM+  
Delphi-Kylix  
Design Usability  
Development Cycles  
DHTML  
Embedded Tools  
Flash  
Graphic Design  
HTML  
IIS  
Interviews  
Java  
JavaScript  
MySQL  
Oracle  
Photoshop  
PHP  
Reviews  
Ruby-on-Rails  
SQL  
SQL Server  
Style Sheets  
VB.Net  
Visual Basic  
Web Authoring  
Web Services  
Web Standards  
XML  
Mobile Linux 
App Generation ROI 
IBM® developerWorks 
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? 
ASP.NET

An Object Driven Interface with .Net
By: Paul Stevens
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 4 stars4 stars4 stars4 stars4 stars / 21
    2003-08-24

    Table of Contents:
  • An Object Driven Interface with .Net
  • Part 2: Creating our Business Object
  • Part 3: The Interface Generator
  • Part 4: Using our Interface Generator

  • 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


    An Object Driven Interface with .Net - Part 2: Creating our Business Object


    (Page 2 of 4 )

     

    In this part, we are going to use the base and attribute classes that we created in the previous part to create a business object that we can use to generate our interface. We will base the business object on a simple customer object with Customer information, Contact details and an Address.

    First we will create a very simple business object called Customer, in customer we will have a number of properties that make up the customer object.

    Imports Web.Wizards.Base
    Imports System.Web.UI
    Public Class Customer
    Inherits WizardBase
    Private lNumber As String
    Private lName As String
    Private lContact As String
    Private lPhone As String
    Private lAddress1 As String
    Private lAddress2 As String
    Private lCity As String
    Private lPostal As String
    Private lActive As Boolean
    Public Sub New()
    CreateList("Code1", "Code2", "Code3")
    End Sub
    ...
    End Class

    The class inherits from WizardBase therefore the class will automatically contain all the methods and properties that exist in WizardBase, in Sub New, we call the method Createlist in the BaseClass to create a List that we will later use when we generate our interface, in order for us to expose our Variables so that we can get get data from our user we create properties.

    <WizardAttributes("Name", GetType(WebControls.TextBox), _
    Helptext:="The Customers Name", _
    SectionName:="Details")> _
    Public Property Name() As String
    Get
    Return lName
    End Get
    Set(ByVal Value As String)
    lName = Value
    End Set
    End Property

    The property declaration declares a Public Read/Write Property Called Name that is used to access the Private field lName, in the code above we also use the Custom attribute class we created “WizardAttributes”, with the custom attribute we specify that the label should state that the field is called Name, that a System.Web.UI.Webcontrols.TextBox should be used to render the Property, that when the user selects the Property Help should display “The Customers Name”, and that the property should fall under a section called “Details” on the property grid.

    More ASP.NET Articles
    More By Paul Stevens


     

    ASP.NET ARTICLES

    - How Caching Means More Ca-ching, Part 2
    - How Caching Means More Ca-ching, Part 1
    - Reading a Delimited File Using ASP.Net and V...
    - What is .Net and Where is ASP.NET?
    - An Object Driven Interface with .Net
    - Create Your Own Guestbook In ASP.NET
    - HTTP File Download Without User Interaction ...
    - Dynamically Using Methods in ASP.NET
    - Changing the Page Size Interactively in a Da...
    - XML Serialization in ASP.NET
    - Using Objects in ASP.NET: Part 1/2
    - IE Web Controls in VB.NET
    - Class Frameworks in VB .NET
    - Cryptographic Objects in C#: Part 1
    - Sample Chapter: Pure ASP.Net







    © 2003-2010 by Developer Shed. All rights reserved. DS Cluster 9 Hosted by Hostway
    For more Enterprise Application Development news, visit eWeek