Data Portal Connections

Data Portal Connections

Old forum URL: forums.lhotka.net/forums/t/482.aspx


david.wendelken posted on Tuesday, June 27, 2006

I've been learning the CSLA framework, and there's a lot about it that's really great.

But the way we connect to the database seems to be much more complicated than I need.

I'm used to defining a few connection strings in my web.config or app.config files and having the objects connect to the database in a pretty standard and simple way.  They just create a connection object that uses the appropriate connection string.

No COM files to create, sign and install, no web services to create, just plain and simple connections.

Does CSLA support POCOs (Plain Old Connection Objects Smile [:)] )?  I couldn't figure out where/how to configure it that way.

ajj3085 replied on Tuesday, June 27, 2006

To use Csla, you don't need to create any COM interop files or web services or remoting.  Those are all optional (but supported) features, there if you need them, and causing little to no overhead if you don't.

You can use Ado.Net connections without any of those configured; you'll just be using the SimpleDataPortal.  The thing you should do though is make sure that any Ado.Net stuff is ONLY contained within the DataPortal_XXX methods within your business class.  Your UI should never be able to see Ado.Net at all.

The 'default' configuration is to use the SimpleDataPortal, so to use it, just dont' configure it in the .config file.

HTH
Andy

david.wendelken replied on Tuesday, June 27, 2006

ajj3085:

The 'default' configuration is to use the SimpleDataPortal, so to use it, just dont' configure it in the .config file.

I'm not sure I understand how to make this work.

Are you saying I should add the PTracker and Security configuration settings to the ProjectTracker.Library app.config file, and disable the CslaDataPortalProxy settings in PTWeb's config file (etc.)?

If so, could you provide a sample of the entries in the library app.config file?

If not, please explain further.  This configuration stuff is very new to me. 

 

 

ajj3085 replied on Tuesday, June 27, 2006

In PTWeb's configuration file, just remove this line:

    <add key="CslaDataPortalProxy"
             value="EnterpriseServicesHost.EnterpriseServicesProxy, EnterpriseServicesHostcs"/>


That should make the application use the simple data portal.  The ProjectTracker.Library assembly doesn't need a configuration file at all (and in my download, it doesn't include one).

The PTracker and Security settings can stay in the PTWeb application. 

for your application, you don't need two seperate database connection strings; there's no requirement that prevents the Security database couldn't be merged into the PTracker database.  It was split just to show you can use more than one database at a time.

If you don't already, I recommend you buy the book, as you'll learn how the framework is built, and why.

HTH
Andy

david.wendelken replied on Tuesday, June 27, 2006

ajj3085:
In PTWeb's configuration file, just remove this line:

    <add key="CslaDataPortalProxy"
             value="EnterpriseServicesHost.EnterpriseServicesProxy, EnterpriseServicesHostcs"/>

That should make the application use the simple data portal.  The ProjectTracker.Library assembly doesn't need a configuration file at all (and in my download, it doesn't include one).

The PTracker and Security settings can stay in the PTWeb application. 

Thanks!  Will try that.

ajj3085:
for your application, you don't need two seperate database connection strings; there's no requirement that prevents the Security database couldn't be merged into the PTracker database.  It was split just to show you can use more than one database at a time.

If you don't already, I recommend you buy the book, as you'll learn how the framework is built, and why.

Already understood on the two databases.  I agree, it is an excellent book, very well written, and worth every penny even if I never used CSLA at all.

My problem is that my brain is just plain full already - new to ASP.Net, C#, VB, SqlServer, and OO in addition to Windows configuration stuff.  The configuration stuff, being the most different from my prior skill set, is the hardest for me to pick up, given that I only have time to learn (piecemeal) how to solve the immediate configuration problem before moving onto the next design/programming task to master.

ajj3085 replied on Tuesday, June 27, 2006

Wow, quite a bit to absorb all at once.  Do you have time to sleep?

One of the good things is that Csla will help you make the right OOD decisions, since it is built to facilitate good OOD.

When you say 'Windows configuration stuff' is that configuration of the OS itself, or the .Net configuration?


david.wendelken replied on Tuesday, June 27, 2006

Sleep?  I have vague recollections of that...

CSLA and the associated forums and book have really helped me start to think in OO terms.  I'm building a small prototype project to test out my understanding.

What did I mean by "Windows configuration stuff"?  OS, .Net, SqlServer, Reporting Services, DTS Services, Analysis Services, CSLA, DotNetNuke, etc.

Most of the books/manuals for this stuff all get to a certain point where they say, "Ask your system admin for this critical piece of information without which nothing will work at all".  Well, when I'm learning at home, I *am* my system admin and I often didn't have a clue.   

Copyright (c) Marimer LLC