Multi-tier ASP.net web application

Discussion in 'ASP .Net' started by kito, Aug 11, 2006.

  1. kito

    kito Guest

    Hi,
    I've a question, regarding the multi-tier model of designing
    applications. I'm programming a web-application (Little web-shop) in
    VB.net for a project of the university and my question is the
    following:

    I have a table "Customer" in the database. Is it intelligent then, if
    I'm creating (in the business logic) a VB class called Customer.vb,
    which looks like the following:
    Namespace Blogic
    Public Class Customer
    Dim _alias As String
    Dim password As String
    Dim companyname As String
    Dim firstname As String
    Dim lastname As String
    Dim birthdate As String
    Dim street As String
    Dim city As String
    Dim zipcode As String
    Dim country As String
    Dim contactTitle As String
    Dim email As String
    Dim phone As String

    Public Sub New()
    MyBase.new()
    ....
    End Sub
    ....
    ....
    End Class
    End Namespace

    The idea is every time i retrieve data about the customer, I create
    objects out of that class, filled with the data from the database and I
    pass this object then further to the Top-logic or UI logic??
    Or would it be better just to pass the data in some kind of collection,
    elaborated in the business logic?

    Can someone give me suggestions, since I'm new to ASP.net

    Thanks
     
    kito, Aug 11, 2006
    #1
    1. Advertising

  2. Really, it makes no difference what you're storing in the database. If you
    analyze the problem, you realize that every database table contains columns
    and rows, regardless of what you call it. What I'm getting at here, is that
    it is the business rules, the requirements of you app that determine the
    structure. It may be logical to create a "Customer" class, or it may not.
    For example, if you want to create a tabular interface for working with
    Customer records, the extra step of creating a Customer class would be
    unnecessary. On the other hand, if you need to apply a lot of logic that
    acts upon that data, treating it as a Customer (a human being or an
    organization), a Customer class would probably be a good idea.

    What you need to do is completely anaylyze the requirements and business
    rules of your app, taking into account likely future enhancements and
    changes, and design your structure accordingly.

    --
    HTH,

    Kevin Spencer
    Microsoft MVP
    Chicken Salad Surgery

    Orange you bland I stopped splaying bananas?


    "kito" <> wrote in message
    news:...
    > Hi,
    > I've a question, regarding the multi-tier model of designing
    > applications. I'm programming a web-application (Little web-shop) in
    > VB.net for a project of the university and my question is the
    > following:
    >
    > I have a table "Customer" in the database. Is it intelligent then, if
    > I'm creating (in the business logic) a VB class called Customer.vb,
    > which looks like the following:
    > Namespace Blogic
    > Public Class Customer
    > Dim _alias As String
    > Dim password As String
    > Dim companyname As String
    > Dim firstname As String
    > Dim lastname As String
    > Dim birthdate As String
    > Dim street As String
    > Dim city As String
    > Dim zipcode As String
    > Dim country As String
    > Dim contactTitle As String
    > Dim email As String
    > Dim phone As String
    >
    > Public Sub New()
    > MyBase.new()
    > ....
    > End Sub
    > ....
    > ....
    > End Class
    > End Namespace
    >
    > The idea is every time i retrieve data about the customer, I create
    > objects out of that class, filled with the data from the database and I
    > pass this object then further to the Top-logic or UI logic??
    > Or would it be better just to pass the data in some kind of collection,
    > elaborated in the business logic?
    >
    > Can someone give me suggestions, since I'm new to ASP.net
    >
    > Thanks
    >
     
    Kevin Spencer, Aug 11, 2006
    #2
    1. Advertising

  3. kito

    kito Guest

    Yes, ok
    thanks

    Kevin Spencer wrote:
    > Really, it makes no difference what you're storing in the database. If you
    > analyze the problem, you realize that every database table contains columns
    > and rows, regardless of what you call it. What I'm getting at here, is that
    > it is the business rules, the requirements of you app that determine the
    > structure. It may be logical to create a "Customer" class, or it may not.
    > For example, if you want to create a tabular interface for working with
    > Customer records, the extra step of creating a Customer class would be
    > unnecessary. On the other hand, if you need to apply a lot of logic that
    > acts upon that data, treating it as a Customer (a human being or an
    > organization), a Customer class would probably be a good idea.
    >
    > What you need to do is completely anaylyze the requirements and business
    > rules of your app, taking into account likely future enhancements and
    > changes, and design your structure accordingly.
    >
    > --
    > HTH,
    >
    > Kevin Spencer
    > Microsoft MVP
    > Chicken Salad Surgery
    >
    > Orange you bland I stopped splaying bananas?
    >
    >
    > "kito" <> wrote in message
    > news:...
    > > Hi,
    > > I've a question, regarding the multi-tier model of designing
    > > applications. I'm programming a web-application (Little web-shop) in
    > > VB.net for a project of the university and my question is the
    > > following:
    > >
    > > I have a table "Customer" in the database. Is it intelligent then, if
    > > I'm creating (in the business logic) a VB class called Customer.vb,
    > > which looks like the following:
    > > Namespace Blogic
    > > Public Class Customer
    > > Dim _alias As String
    > > Dim password As String
    > > Dim companyname As String
    > > Dim firstname As String
    > > Dim lastname As String
    > > Dim birthdate As String
    > > Dim street As String
    > > Dim city As String
    > > Dim zipcode As String
    > > Dim country As String
    > > Dim contactTitle As String
    > > Dim email As String
    > > Dim phone As String
    > >
    > > Public Sub New()
    > > MyBase.new()
    > > ....
    > > End Sub
    > > ....
    > > ....
    > > End Class
    > > End Namespace
    > >
    > > The idea is every time i retrieve data about the customer, I create
    > > objects out of that class, filled with the data from the database and I
    > > pass this object then further to the Top-logic or UI logic??
    > > Or would it be better just to pass the data in some kind of collection,
    > > elaborated in the business logic?
    > >
    > > Can someone give me suggestions, since I'm new to ASP.net
    > >
    > > Thanks
    > >
     
    kito, Aug 11, 2006
    #3
  4. kito

    sloan Guest

    spaces.msn.com/sholliday/

    I have a 1.1 and 2.0 "tiered development" example.

    Should you create a Customer class? Most times, I'd say yes.
    But if all you are doing is creating a web page, with a list of customers,
    so you can click "Edit", than maybe not.

    But anytime I program something professional or semi professional, I go with
    the custom objects.

    The articles at the blog reference a microsoft article, I'd find it and read
    it.
    It gives you the main stream way so handling info, and what it means.
    Much better than I could explain in a newsgroup post.

    Last comment:
    "Rapid Development" is not the same thing as "Good Development" alot of
    times.
    So it depends on your motivation.
    When I'm not less interested in "Rapid", I set up my custom objects.

    With 2.0 and generic <List>'s , its alot easier, since I don't have to
    create a CustomCollection : CollectionBase for every object I created.




    "kito" <> wrote in message
    news:...
    > Hi,
    > I've a question, regarding the multi-tier model of designing
    > applications. I'm programming a web-application (Little web-shop) in
    > VB.net for a project of the university and my question is the
    > following:
    >
    > I have a table "Customer" in the database. Is it intelligent then, if
    > I'm creating (in the business logic) a VB class called Customer.vb,
    > which looks like the following:
    > Namespace Blogic
    > Public Class Customer
    > Dim _alias As String
    > Dim password As String
    > Dim companyname As String
    > Dim firstname As String
    > Dim lastname As String
    > Dim birthdate As String
    > Dim street As String
    > Dim city As String
    > Dim zipcode As String
    > Dim country As String
    > Dim contactTitle As String
    > Dim email As String
    > Dim phone As String
    >
    > Public Sub New()
    > MyBase.new()
    > ....
    > End Sub
    > ....
    > ....
    > End Class
    > End Namespace
    >
    > The idea is every time i retrieve data about the customer, I create
    > objects out of that class, filled with the data from the database and I
    > pass this object then further to the Top-logic or UI logic??
    > Or would it be better just to pass the data in some kind of collection,
    > elaborated in the business logic?
    >
    > Can someone give me suggestions, since I'm new to ASP.net
    >
    > Thanks
    >
     
    sloan, Aug 11, 2006
    #4
  5. kito

    kito Guest

    Yes I normally also create objects for tables like Customers, Products
    and so on...But since it is the first time I program a .NET ASP
    application, I was not sure. What about memory...
    Usually in Java applications, I created objects out of the database,
    storing them in some Collection (Array-list) or so....depending which
    object than was changed by my program, the object updated itself (with
    some corresponding method) to the database. This worked quiet fine, but
    I'm not sure if this is the right strategy for a web application.
    I think it should be better not to load all data into memory...

    thanks anyway sloan

    sloan wrote:
    > spaces.msn.com/sholliday/
    >
    > I have a 1.1 and 2.0 "tiered development" example.
    >
    > Should you create a Customer class? Most times, I'd say yes.
    > But if all you are doing is creating a web page, with a list of customers,
    > so you can click "Edit", than maybe not.
    >
    > But anytime I program something professional or semi professional, I go with
    > the custom objects.
    >
    > The articles at the blog reference a microsoft article, I'd find it and read
    > it.
    > It gives you the main stream way so handling info, and what it means.
    > Much better than I could explain in a newsgroup post.
    >
    > Last comment:
    > "Rapid Development" is not the same thing as "Good Development" alot of
    > times.
    > So it depends on your motivation.
    > When I'm not less interested in "Rapid", I set up my custom objects.
    >
    > With 2.0 and generic <List>'s , its alot easier, since I don't have to
    > create a CustomCollection : CollectionBase for every object I created.
    >
    >
    >
    >
    > "kito" <> wrote in message
    > news:...
    > > Hi,
    > > I've a question, regarding the multi-tier model of designing
    > > applications. I'm programming a web-application (Little web-shop) in
    > > VB.net for a project of the university and my question is the
    > > following:
    > >
    > > I have a table "Customer" in the database. Is it intelligent then, if
    > > I'm creating (in the business logic) a VB class called Customer.vb,
    > > which looks like the following:
    > > Namespace Blogic
    > > Public Class Customer
    > > Dim _alias As String
    > > Dim password As String
    > > Dim companyname As String
    > > Dim firstname As String
    > > Dim lastname As String
    > > Dim birthdate As String
    > > Dim street As String
    > > Dim city As String
    > > Dim zipcode As String
    > > Dim country As String
    > > Dim contactTitle As String
    > > Dim email As String
    > > Dim phone As String
    > >
    > > Public Sub New()
    > > MyBase.new()
    > > ....
    > > End Sub
    > > ....
    > > ....
    > > End Class
    > > End Namespace
    > >
    > > The idea is every time i retrieve data about the customer, I create
    > > objects out of that class, filled with the data from the database and I
    > > pass this object then further to the Top-logic or UI logic??
    > > Or would it be better just to pass the data in some kind of collection,
    > > elaborated in the business logic?
    > >
    > > Can someone give me suggestions, since I'm new to ASP.net
    > >
    > > Thanks
    > >
     
    kito, Aug 12, 2006
    #5
  6. kito

    Dave Johnson Guest

    greetings kito,

    whtever u were trying to develop, you should first search for n-layer
    net applications at google or msdn.

    Sharing makes All the Difference

    --
    Sent via .NET Newsgroups
    http://www.dotnetnewsgroups.com
     
    Dave Johnson, Aug 12, 2006
    #6
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. rob

    ASP v2 & 3-tier or 2-tier

    rob, Aug 13, 2004, in forum: ASP .Net
    Replies:
    1
    Views:
    421
    Steve C. Orr [MVP, MCSD]
    Aug 13, 2004
  2. NOSPAM

    2 tier to 3 tier?

    NOSPAM, Oct 14, 2004, in forum: ASP .Net
    Replies:
    1
    Views:
    446
    =?Utf-8?B?Q293Ym95IChHcmVnb3J5IEEuIEJlYW1lcikgLSBN
    Oct 14, 2004
  3. Shantanu Bhattacharya
    Replies:
    2
    Views:
    564
    Christopher Benson-Manica
    Dec 26, 2003
  4. Shantanu Bhattacharya

    Converting a 2-tier application to 3-tier application

    Shantanu Bhattacharya, Dec 25, 2003, in forum: C Programming
    Replies:
    2
    Views:
    467
    Christopher Benson-Manica
    Dec 26, 2003
  5. lobezno

    Multi tier web application security architecture

    lobezno, Jan 13, 2009, in forum: ASP .Net Security
    Replies:
    0
    Views:
    1,177
    lobezno
    Jan 13, 2009
Loading...

Share This Page