Results 1 to 4 of 4

Thread: [RESOLVED] Programming or dragging bound controls

  1. #1

    Thread Starter
    PowerPoster
    Join Date
    Sep 2005
    Location
    Modesto, Ca.
    Posts
    4,480

    Resolved [RESOLVED] Programming or dragging bound controls

    In an earlier post today http://www.vbforums.com/showthread.php?t=663054 jmcilhinney in post #9 says,
    If you're going to use a DataSet at all then there's no reason not to use a typed DataSet. I would not recommend dragging items from the Data Sources window directly onto a form but that is not a requirement of using a Data Source.
    I was wondering what is the down side of dragging items onto the form. I don't mind doing the manual programming, I would just like to know the reason I'm doing it.

    Thanks for any replies

  2. #2
    .NUT jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    105,040

    Re: Programming or dragging bound controls

    If you're going to pollute your forms with data access code then you may as well drag and drop from the Data Sources window. We all tend to build our apps that way to begin with, but it's not the "proper" way to do it. In that case there's no real advantage to writing any code yourself unless you need something tricky that can't accomplished using drag and drop.

    The "proper" way to build applications requires that your forms contain no code that doesn't relate specifically to presentation and calling Fill and Update on TableAdapters does not qualify. All the saving and retrieving of data should be done in other classes and, possibly, other projects.

  3. #3

    Thread Starter
    PowerPoster
    Join Date
    Sep 2005
    Location
    Modesto, Ca.
    Posts
    4,480

    Re: Programming or dragging bound controls

    jmc,
    Do you mean an n-Tier application? If so, is this also the "proper" way for simple single user apps as well as complicated multiuser apps or if they are on a stand alone computer or a large network. Is the main benefit maintainability or are there performance benefits.

    I've never spent much time studying n-Tier, I had my hands full just teaching myself .Net after years of VB6. Maybe it's time to take the plunge.

    Thanks for the reply

  4. #4
    .NUT jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    105,040

    Re: Programming or dragging bound controls

    Yes I do mean n-tier. In large enterprise apps you will often find more layers and the layers will often be separated into multiple projects and sometimes even run on multiple machines. For simpler apps, it's still generally advisable to use an n-tier approach, although the architecture would be much simplified. For really basic apps it is probably OK to throw everything into your forms but maintenance is always easier if you obey good design principles. Data access code in forms breaks the Single Responsibility Principle.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width