Hello,
I'm new to CSLA. It is a very impressive framework. I bought the book after I discovered your site, and I intend to use it in developing my software. While reading the book, I came to the part where a ProjectResource get updated (page 441). Paging back (page 438) I discovered that the connection is opened by the ProjectResource, UpdateAssignment() is called, passing the connectionstring, then the commandobject is created, DoAddUpdate is called and the command is executed. In fact the insert and delete commands work the same way.
My question is; Could the Connection.Open() be called within DoAddUpdate() instead, by passing is the connection as a parameter.
Or am I missing the big picture here.
However, thanx for the great work.
Ton Smeets.
PS. I am from the Netherlands, and cann't figure out what 'leveraging' means. Please help me out here to.
Wow,
Thank you for responding so quickly. I thought it might mean something like that.
Anyway, thank you.
The key thing to remember when looking at Project Tracker is that it is just a sample - it is only one way to build and use BOs.
For Example here is what some Fetch code looks like in one of my BOs:
Protected Overrides Sub DataPortal_Fetch(ByVal criteria As Object)As you can see - I call a Protected Overridable Sub called DoFetch which creates the connection (using my own DAL code which creates a SQL or Oracle connection as needed), opens it and passes it as a parameter to 4 other methods which are all Protected Overridable.
Using this style of code, I can use Codesmith to generate a Base class.
Then in my final type I can hand write code and Override any of the methods to add functionality.
If I need to use the Base functionality the Overriden method will make the call to MyBase and then add whatever it needs. If I need to change it completely, I just omit the call to MyBase.
Hope that helps.
Joe
Yes, I get the picture.
Reading further in Rocky's book some thing got clear to me.
Thank you for your response.
Copyright (c) Marimer LLC