Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase 123»»»

The Enterprise Library for .NET Framework 2.0 Expand / Collapse
Author
Message
Posted Monday, August 14, 2006 4:54 PM
SSCrazy

SSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazy

Group: General Forum Members
Last Login: Yesterday @ 9:35 AM
Points: 2,749, Visits: 1,407
Comments posted to this topic are about the content posted at temp

LinkedIn Profile
Post #301744
Posted Sunday, August 20, 2006 8:06 AM
Grasshopper

GrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopper

Group: General Forum Members
Last Login: Thursday, February 01, 2007 4:01 PM
Points: 22, Visits: 1

Excellent article, easy read. 

I am not a dot NET developer, but am trying mightily to come up to speed on it.  I have been involved in relational databases since the days of SQL/DS on VM and DB2 V1 on MVS.  This is the first I've heard of the Enterprise Library.  I had been slogging through the samples. etc.  in the Express sandboxes so conveniently furnished by MSFT and, while comfortable with the concepts, was getting bogged down with the detailed implementations.

I look forward to messing with this new library.

Thanks for a good read.

Post #302788
Posted Monday, August 21, 2006 12:44 AM
Grasshopper

GrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopper

Group: General Forum Members
Last Login: Monday, March 31, 2008 8:12 AM
Points: 13, Visits: 3

Nice article!

Just a quick point.
I know the author isn't from a .Net background, but a slight improvement to the code would be to use a class level variable to store the return from DatabaseFactory.CreateDatabase(). This can then be used throughout a complete "data tier" class.

eg.

Public Class DataAccessLayer
Private dB As Database

Sub New()
'Instantiates the database factory class. This decouples the database
'methods from the underlying database, making it easier to change
'database types, e.g. SQL to Oracle
dB = DatabaseFactory.CreateDatabase()
End Sub

Public Function GetPreviousStatus(ByVal PurchaseOrderNumber As Long) As Integer

Dim objCommandWrapper As DBCommandWrapper = _
dB.GetStoredProcCommandWrapper("dbo.StoredProcedure")

objCommandWrapper.AddInParameter("@Parameter", DbType.Int64, PurchaseOrderNumber)

Try
Return dB.ExecuteScalar(objCommandWrapper)
Catch exc As Exception
Throw New Exception("An Error Occured whilst querying the Database")
End Try
End Function
End Class



Post #302817
Posted Monday, August 21, 2006 8:18 AM
SSCertifiable

SSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiable

Group: Moderators
Last Login: Thursday, May 09, 2013 12:38 PM
Points: 6,462, Visits: 1,384

I agree with your architect, the time saved is worth the minimal performance hit. Abstraction layers like these are very much worth doing. Standarding data access is a key concept and all the better if you're using something that developers coming from other companies will understand.

As much as I like abstraction, I do think it's pretty important that developers spend some time working with the raw components of ADO.Net first, then they'll both appreciate the power/simplicity of the abstraction layer and they'll be able to bypass it if/when it ties their hands too much.



Andy
SQLShare - Learn One New Thing Each Day
SQLAndy - My Professional Blog
Connect with me on LinkedIn
Follow me on Twitter
Post #302908
Posted Monday, August 21, 2006 9:00 AM


SSC Veteran

SSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC Veteran

Group: General Forum Members
Last Login: Tuesday, May 07, 2013 10:43 AM
Points: 287, Visits: 213
If you follow Neil's advice and keep a reference to the Database object then the "slight performance hit" should only apply the first time the procedure is called. This is a little more complicating with ASP .NET apps based on the caching method but for WinForms apps it's pretty awesome.

Bryant E. Byrd, BSSE MCDBA MCAD
Business Intelligence Administrator
MSBI Administration Blog
Post #302933
Posted Monday, August 21, 2006 10:26 AM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Monday, March 12, 2007 5:17 PM
Points: 9, Visits: 1
The editor should have edited the text "For simplicity stake..." to "For simplicity's sake...".

N'est-ce pas?



Kindest Regards,

Enrique

Post #302966
Posted Monday, August 21, 2006 12:48 PM
Hall of Fame

Hall of FameHall of FameHall of FameHall of FameHall of FameHall of FameHall of FameHall of FameHall of Fame

Group: General Forum Members
Last Login: Monday, July 30, 2012 10:42 AM
Points: 3,434, Visits: 519
Very Nice! Good Job!


Regards,
Yelena Varshal

Post #303000
Posted Wednesday, August 23, 2006 6:25 AM
SSCertifiable

SSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiable

Group: Moderators
Last Login: Thursday, May 09, 2013 12:38 PM
Points: 6,462, Visits: 1,384
We do a very light edit on most articles, compared to a much more intense edit for articles in the SQL Server Standard Magazine. Online is a little less formal and we let the authors have some leeway around grammar and spelling!

Andy
SQLShare - Learn One New Thing Each Day
SQLAndy - My Professional Blog
Connect with me on LinkedIn
Follow me on Twitter
Post #303467
Posted Monday, August 28, 2006 5:28 AM
SSCrazy

SSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazy

Group: General Forum Members
Last Login: Yesterday @ 9:35 AM
Points: 2,749, Visits: 1,407
My apologies for "Simplicity Stake". Guess who wrote the article late at night on using a cheap keyboard?

LinkedIn Profile
Post #304384
Posted Monday, August 28, 2006 4:16 PM
Grasshopper

GrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopper

Group: General Forum Members
Last Login: Friday, December 23, 2011 8:00 AM
Points: 10, Visits: 20

I dunno about others but I really hate it that things like Connection Strings are stored in plain text in the web.config file.  What bugs me even more is that things like the enterprise library build upon that assumption and do not seem to allow for exceptions for how you might rather handle it.  For instance, I at the very least want to encrypt my password but it doesn't allow for that.  I haven't checked out the latest version (we are using an older version) but this still seems to be the case.  The example here used a different security context so it wasn't an issue but most connections are going to require a userid and password that you want to run your queries or procs under.  Does anyone have any thoughts or ideas about how best to use the enterprise library to accomplish a more secure connection string?  I know no one can get at the config file from outside the company but I think someone inside a given company could easily know where to look to get at credentials for sql server given this approach.  All they got to do is gain access to the machine or to source safe etc...And knowing that this is how most vb and asp applications work (even without using the enterprise library) seems to make it all the more easier for people to know where to find this info.  This "rant" is more an issue for dot net forum so I apologize in advance.  But I would like to hear if others have the same concern.




Post #304593
« Prev Topic | Next Topic »

Add to briefcase 123»»»

Permissions Expand / Collapse