Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

VB.NET and N-Tier, opinions and thoughts.

Posted on 2003-12-04
8
Medium Priority
?
639 Views
Last Modified: 2008-02-01
Hi all,
  we are currently beginning on the path of .NET, previously we have built N-Tier applications using the method of mapping database tables each to a single object and a collection object. By using these objects we built the UI either in VB 6 or ASP.
  All our objects are programmed in VB6 as ActiveX dll projects.
 Our single object would provide functions to load, save, delete etc a single record from a table, it would also have properties that matched to fields in the table. Our collection objects would retreive a collection of single objects using functions.
 We never used databinding on the front-ends, basically all the validation and manipulation of data was done through the objects, and it used recordsets, commands etc to do data updates etc.
 I hope I have made myself clear.
 Now here is the question, from looking at VB.NET, I am now wondering if this is the right way for developing new applications in .NET. I am sure we will not use a lot of the new power of ADO.NET and VB.NET, if we don't use databinding controls such as the datagrid.
 See my previous experience in old VB was not to touch databinding, as you lost a lot of control especially when validating data.
 What are people doing in the real working world with .NET, having objects return datasets and using them? Or building them in wrappers?

 Any thoughts and opinions, would be appreciated.

Thanks

Jetforce
0
Comment
Question by:jetforce
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
8 Comments
 
LVL 22

Assisted Solution

by:_TAD_
_TAD_ earned 200 total points
ID: 9875706


Databinding is the way to go with the new .Net architexture.  you still have a little bit of a control issue since you have to make changes to the under lying object, but databinding in .Net is much faster than it ever use to be and it allows for data to change while not affecting the display object until you refresh.

In a nutshell, one of the more exciting features about .Net is its use of databinding.
0
 
LVL 3

Assisted Solution

by:TwoSide
TwoSide earned 200 total points
ID: 9875912
Hi Jetforce,

I announce you that you entered in a brand new world.

In the real world of .NET N-TIER application, microsof suggest to us to return data object as Dataset form if its possible. There have more then one reasons, a lot of new functionnalities was implemented in the dataset, XML integration, DataRelation, Dataview, multiple table support, disconnected data, transaction ... The dataset really replace at my own opinion the wrapper and it offer stability ,flexibilty and a lot of power.  

My last VB.NET apps use wrapper and with my new skill i think i have made an error!

For the validation, a lots of control events was implemented to permit to you to validate data, it's pretty different of previous version and databinding will help you a lots for saving coding time if you use it correctly. Don't be effraid to use it!

I suggest to you to buy MCAD/MCSD self-placed training kit(Microsoft press) it's a good and cheap way (240 US$ www.amazon.com) to learn good practices in four pretty good books(Developping windows applicatoin with VB.NET and Visual C#, Developping web applicatoin with VB.NET and Visual C#.Net, XML Services and server component, Analysing requirements and defining .NET solution Architechtures.).

I hope that will help you!  
TwoSide
0
 
LVL 4

Accepted Solution

by:
wile_e_coyote earned 400 total points
ID: 9876130
We have an n-tier app (Windows Forms, web services and SQL server) which uses databinding and datasets.   Its been running in a production environment for 1.5 years with over 500 users with good reviews.  

However we are moving away from datasets toward our own data-bindable objects because 1) the XML serialization of  a dataset is very inefficient and 2) using custom objects provides a more Object-oriented programming interface for our front-end developers.   I would recommend this approach over an approach where you "wrap" a custom object around a DataSet.  

I agree with the other posts regarding databinding - they've made it a lot more usable with the control events and the ErrorProvider object.  And the notion of being able to operate in a "disconnected" mode on the client and then post multiple changes to the database is very powerful.

To summarize:
1.  A dataset based architecture can work but you may encounter performance issues if you're using Web Services and/or XML serialization.  We had to limit our result sets to less than 50 rows (and implement nextpage/prev page) in order to keep the response time under 2 seconds.
2.  If you're going to use your own objects instead of DataSets, I recommend going "all the way" and making your objects bindable and serializable.

0
Learn Veeam advantages over legacy backup

Every day, more and more legacy backup customers switch to Veeam. Technologies designed for the client-server era cannot restore any IT service running in the hybrid cloud within seconds. Learn top Veeam advantages over legacy backup and get Veeam for the price of your renewal

 
LVL 27

Assisted Solution

by:Dabas
Dabas earned 100 total points
ID: 9877094
Hi jetforce:
> . I am sure we will not use a lot of the new power of ADO.NET and VB.NET, if
> we don't use databinding controls such as the datagrid.

I partly disagree with the other posters, and have a similar approach to yours:
I do not trust databinding, and after trying it out with datagrids in .NET, I still distrust it.

Good news is that .NET has some nifty nice new features and improvements over VB6 that make the non-binding approach quite attractive.

For example: The Tag property is not a String but an Object.
At first I was dissapointed that the DataField property was removed in .NET. I use this property in VB6 to traverse through the controls and update them with the value of the current record.
In .NET, the Tag property can be used for this purpose AND any other purpose you would want to use it for. You can create a class, store an instance of this class in the Tag property and then use the different values in any of the control's events.

A better example is the combo. The comboitems once again are objects, not strings. This means that when you build a (not bound) combo, and add items to it, you can actually store a complete DataRow in it, or an instance of your own class.
In the class definition, override the ToString function to return the one value you would like displayed when a comboitem gets selected. Cool!


Dabas
0
 
LVL 22

Expert Comment

by:_TAD_
ID: 9877585


Intersting approach Dabas...

I may look into that for quick and easy programs instead of messing around with Databinding.  
0
 
LVL 29

Assisted Solution

by:David H.H.Lee
David H.H.Lee earned 100 total points
ID: 9879960
jetforce,
I'm not good in give you advices related to your problems(afraid give you wrong directions). But, I believe this article will guide you from top to bottom about N-Tier design problems In .NET architecture design. I'm sure you'll get clear explanations from Microsoft's article.
http://msdn.microsoft.com/architecture/default.aspx?pull=/library/en-us/dnbda/html/BOAGag.asp
0
 
LVL 3

Author Comment

by:jetforce
ID: 9881008
Thanks for all the replies,
  is there any good examples on the web, so I can see the pros & cons.

Thanks

 
0
 
LVL 29

Expert Comment

by:David H.H.Lee
ID: 9881014
jetforce ,
Here's the sample application web using 3 tier design pattern
http://msdn.microsoft.com/architecture/default.aspx?pull=/library/en-us/dnbda/html/PetShop3x.asp
0

Featured Post

Nothing ever in the clear!

This technical paper will help you implement VMware’s VM encryption as well as implement Veeam encryption which together will achieve the nothing ever in the clear goal. If a bad guy steals VMs, backups or traffic they get nothing.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Welcome my friends to the second instalment and follow-up to our Minify and Concatenate Your Scripts and Stylesheets (http://www.experts-exchange.com/Programming/Languages/.NET/ASP.NET/A_4334-Minify-and-Concatenate-Your-Scripts-and-Stylesheets.html)…
For those of you who don't follow the news, or just happen to live under rocks, Microsoft Research released a beta SDK (http://www.microsoft.com/en-us/download/details.aspx?id=27876) for the Xbox 360 Kinect. If you don't know what a Kinect is (http:…
In this video, Percona Solutions Engineer Barrett Chambers discusses some of the basic syntax differences between MySQL and MongoDB. To learn more check out our webinar on MongoDB administration for MySQL DBA: https://www.percona.com/resources/we…
In response to a need for security and privacy, and to continue fostering an environment members can turn to for support, solutions, and education, Experts Exchange has created anonymous question capabilities. This new feature is available to our Pr…

610 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question