Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

SQLDataCommand or not 2

Status
Not open for further replies.

bigfoot

Programmer
May 4, 1999
1,779
US
I've been reading and learning a ton of stuff on this ASP.NET world. I understand the page life cycle and how classes work in the web world. ViewState rocks but don't overuse it. Sessions do too.

I wanted an opinion on this please.

Microsoft hypes the SqlDataControl and the DataView a lot but is it used in the professional world as much as we think?

I started out using it and it works out of the box for simple projects but is it worth learning another method?

When I was doing VB applications (non web) I used to read the database to the screen then read the screen and wrote it back to the database with code.
Is this used in the web world?

Thanks a bunch!

~G
 
I don't know what you mean by read to the screen and then write to the DB. I would stay away from the datasource controls. They are great for a simple page, but we all know simple pages turn more complex at some point. The built in controls are not very flexable and trying to debug a sql problem with them is almost impossible. So my answer would be, no, the sql data source controls would not be a good idea to use in a professional application. We use Microsoft ApplicationBlocks.
 
Oh, sorry. When I said read from the screen and writeit to the database i meant I set up classes that looked like var1 = textbox.text & ""
then build parameters with all of the variables and pass them to a sproc to go to the database.

Microsoft ApplicationBlocks? Oooo just looked that one up. Yes I must have lived under a rock. LOL

These look pretty neat. Thank you.
 
any form of datasource control is evil:) datasource controls are not testable. GUIs should have no knowledge of the a database either.

there are alot of great open source projects out there which are standards for enterprise systems.
NHibernate (ORM)
Castle ActiveRecord (ORM)
Castle Windsor (IoC)
StructureMap (IoC)
Rhino Tools (all inclusive tool set)
Castle MonoRail (web MVC)
MS MVC (web MVC)
Log4Net (logging)

I'm partial to the Rhino Stack which builds on top Castle projects and NHibernate.

Jason Meckley
Programmer
Specialty Bakers, Inc.
 
Hi Jason.

I was out looking at those places.

Didn't know what I was looking at but I noticed it was in C#. We're a VB shop.

Then I looked at Castle too
Looks like C# also.

I appreciate the links but I feel really, really lost. Where do you start?
I used to write some killer apps but now it's all changed.
Patterns? Semi-clueless.

I am now reading this:
 
I wish I could edit my posts. I started tracing this from scratch and I found this:

Ok, this sound pretty cool. I've built something like this back in my VB6 days.

So all this is to convert the database into objects instead. Ahhh I see. Now the records are objects with properties and methods that you can push and pull around then write them back to the tables.
Interesting.
 
jbenson001, I downloaded Microsoft's tools and found a good article on them. I'll start here I think. Next I guess I'll have to learn C# but that looks like fun anyway.


I'm posting also to help anyone else that may be in my position. An old VB guy turning webinator. LOL
 
I appreciate the links but I feel really, really lost. Where do you start?
I used to write some killer apps but now it's all changed.
Patterns? Semi-clueless.
not really these ideas have been around for decades. MS does a great job of keeping developers in the dark about it.

There are 3 core books which changed how I think about code.
1. Head First: Design Patterns (great for beginners)
2. Domain Driven Design (language egnostic)
3. C# 2.0 via CLR (every gory detail)

Didn't know what I was looking at but I noticed it was in C#. We're a VB shop.
the libraries are c#, but it's all .net. you can download libraries, compile and reference in your vb apps.

if your shop says we only use tools written in vb.net this will drastically limit your tool set.

ORM's, IoC, and the like can be overwhelming. If you don't have a basic understanding of patterns or OOP then all this is confusing. Think of it this way each framework attempts to solve a single, usually generic, problem at a macro level. (patterns solve problems at a micro level)

log4net is a logging framework. all it does is write messages to logs. nothing more, nothing less. NHibernate (ActiveRecord) is only concerned about the interaction between objects and databases. Windsor is only concerned about managing (creating, destroying) objects. Rhino-Tools is built on top of the Castle stack. Rhino contains an implementation of the UnitOfWork, Repository and MVP (similar to MVC) patterns.

you will find that if you can read c# you can read java, php, js much easier. The syntax is very similar througout these langauges. For some reason MS made VB very chatty with lots of words.

Jason Meckley
Programmer
Specialty Bakers, Inc.
 
Thank you so much for the explanations.
It's nice when we can help each other.
My true love is 3D graphics. I do whatever I can to help others in the forum.

I have a gift card for Borders Books. I guess I'll be reading more in my spare time.

Just to ramble a bit, I started about 30 years ago with Pascal in my 20's. I used it on an original IMB PC (8088). I was hooked. Since the real world at that time was into COBOL on a mainframe and RPG I learned on an AS/400. Then went to BASICA. (yuck phooy hairball)

Visual Basic came out and I have been using it since version 3. C++ I passed on. Wish I hadn't but C# is taking over I think.

That's how I came to write VB. About version 5 or so, you could write classes. (Yeah something Pascal could do).

Since then I bought a dummies book on C# and the language seems not as wordy as you have said.

I kind of like it but can't use it here at work so I'm stuck playing at home with it.

I went right from applications to ASP.NET. maybe I should try creating a net application (non web)? I do understand most of OOP.


Thanks again for all your help. What do you think of the Microsoft Application Blocks?
These looks truly cool to work with. I thought I'd start there.
 
I started with the MS blocks before I found my current tool set. It's a step in the right direction, but I found it cumbersome to work with. for example logging exceptions takes about 4 libraries. with log4net it takes 1, very small assembly. Not all 3rd party frameworks are so simple. NH requires 2 or 3, active record might be 3 or 4. Windsor has 3 i think. some over lap though.

MS blocks rely 100% on xml configs. They claim you can change the configs "on the fly" but you can't because they are part of the app/web.config. if this file changes the whole application is reset. there is little gain. The configs are also very complex and requires a GUI to make any sense of it in a short time.

other frameworks rely on xml too. but there are some differences.
1. xml is not required. you can write the configs in code.
2. there is much less xml
3. the xml configs are seperate from the app/web.config so you don't need to restart the entire application to change settings.

MS if very, very wizard driven. they can't seem to make a tool without a GUI builder. I used to think this was a great practice. now i don't like it because it makes test automation that much more difficult. plus if you need a gui to understand settings then the settings are too complex.

The other thing I really like about these tools is they have proven the test of time. nhibernate, log4net, spring.net, lucene.net (indexing) are all ports from java. (I haven't used spring.net, but it's similar to structure.map and windsor) There is also a very active community around these projects. You have project leads and committees, but everyone is an equal. MS is moving this direction, but it's not the same.

Jason Meckley
Programmer
Specialty Bakers, Inc.
 
Interesting reading on all this stuff! :)


Nhibernate is really interesting to see in action. I wish i had it back when I was doing huge applications.

The biggest thing I do at my company are simple apps that do data entry. Our main system is JD Edwards so I'm not likely to use it here.

I am going to get the book though because java is on my list of languages to learn.

I see what you were saying about configuration too, but the MS Data Access Blocks need no such configs. I sort of have most of that code written in classes. (I'm lazy, I want to write DB code once). LOL

So all this seems to be off time information, unless I can use it for tiny projects too.
It almost seems I am back to binding text boxes to recordsets and writing it to the database. This is a tiny web app compared to things I have worked on in other places.
 
to throw another curve ball in the mix ActiveRecord is built on top of NHibernate. The main difference is ActiveRecord uses attributes to map the domain to the database, instead of xml resources.

ActiveRecord works great for normalized databases. It doesn't work well with legacy databases. This is where NH shines. Mapping a denormalized database to a rich domain model.

Another great feature of NH is that NH is completely seperate from the domain. if you look at the domain there is not a single reference to any type of Database. And with NH requiring objects to be unsealed and members virtual you can easily extend functionality within the domain.

Jason Meckley
Programmer
Specialty Bakers, Inc.
 
Jason, I read your post 4 times before I kinda understood what you meant. Am I that far behind?
Where do I get a crash course in all this?
(Thanks again for your help)

I have been looking for video tutorials on this and NET to fill in the blanks, as I don't have the same time I used to, to read.
I don't need a "this is a loop", more like "I know you did it this way but here's a better way".

Found this article that explains it a bit:

Most of the tutorials on the Microsoft site and the ASP site all use the drag and drop controls. Good for beginners but I never liked them.

A small project although good for the D&D would be a neat test for this new technology.
 
Jason, I read your post 4 times before I kinda understood what you meant.
What doesn't make sense? I'll try to explain better.

Where do I get a crash course in all this?
google [name of framework] tutorial. Most of these tools have documents on there website to review. Sometimes these documents don't match the current version, but the core concepts are there. NH has an FAQ blog (NhibernateFAQ.com or something) which is like a series of posts for getting started. the best practice is to download the framework and build a prototype. the user groups (google groups) are also a great resource.

Am I that far behind?
You have just been exposed to a series of tools you didn't know existed. Of course there will be a learning curve of how these tools work.

David Hayden is a good resource. I don't follow his blog as much now, but when I first got serious about programming this is the first blog I subscribed too.
other mentors of mine :
JP Boodhoo
Jeremy Miller
Ayende Rahien
Jeffery Palmero
Udi Dahan
most of the bloggers on LosTechies and CodeBetter

There methodologies are unlike that of MS. They don't have anything against MS. Some common themes around these guys are unit testing, build automation, "Agile" practices.

Most of the tutorials on the Microsoft site and the ASP site all use the drag and drop controls. Good for beginners but I never liked them.
Yes MS loves drag/drop. The problem for beginners is they learn to use wizards, but don't know what they are doing with code.

Jason Meckley
Programmer
Specialty Bakers, Inc.
 
Yes MS loves drag/drop. The problem for beginners is they learn to use wizards, but don't know what they are doing with code.
I totally agree. If you remember a way earlier post, prob. a few years ago I was tearing my hair out over that data control.
Personally I really like the display controls, like DataView but I code them by hand and feed them with a dataset.


What I didn't understand was:
Another great feature of NH is that NH is completely seperate from the domain. if you look at the domain there is not a single reference to any type of Database. And with NH requiring objects to be unsealed and members virtual you can easily extend functionality within the domain.

When you talk about the domain, is it the application or the doman as in domain user (network).
Unsealed and members virtual are a bit foreign to me too.

Thanks for not making me feel worse then I do. I've been at this for a long time and lately I'm running as fast as I can to keep up but I'm loosing ground fast. LOL
I did get to read up on NUnit last night. it's very cool.


It also seems we both work for similar companies. My current company makes baked goods and pretzels.


 
Domain as defined by Evans in Domain Driven Design. This is the core of a system. It ties into the methodology of Onion Architecture.

Unsealed and members virtual are a bit foreign to me too.
i'm sure these concepts exist in vb with different names.
example. SqlConnection is a sealed class you cannot inherit from this. a virtual member can be overridden when the object is inherited.

Jason Meckley
Programmer
Specialty Bakers, Inc.
 
Yes!!! Ok, I get it. was a bit of C# dialoge that threw me. Guess I'll have to learn a bit more C# so I can talk apples and apples.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top