Built-in FillAll method?
 
Home My Account Forum Try It! Buy It!
About Contact Us Site Map
StrataFrame Forum
Home      Members   Calendar   Who's On
Welcome Guest ( Login | Register )
      



Built-in FillAll method?Expand / Collapse
Author
Message
Posted 04/10/2008 3:58:00 PM
StrataFrame Novice

StrataFrame NoviceStrataFrame NoviceStrataFrame NoviceStrataFrame NoviceStrataFrame NoviceStrataFrame NoviceStrataFrame NoviceStrataFrame Novice

Group: StrataFrame Users
Last Login: Today @ 10:11:34 AM
Posts: 102, Visits: 229
I am new here so please excuse my ignorance

I have been reading through the help file and I thought it would be a benefit to offer a built-in FillAll() population method which simply reads all records into the BO. I can see quite a large no of BOs in our application (i.e. lookup lists, etc.) that would benefit from this. I know I can add my own FillAll() to each BO but, as I am lazy, it would be nice if it was built-in

Is there a reason why you have decided not to implement it?

Thanks,

Aaron

Post #15508
Posted 04/10/2008 4:19:55 PM
StrataFrame VIP

StrataFrame VIPStrataFrame VIPStrataFrame VIPStrataFrame VIPStrataFrame VIPStrataFrame VIPStrataFrame VIPStrataFrame VIP

Group: StrataFrame Users
Last Login: Yesterday @ 7:28:28 PM
Posts: 1,148, Visits: 2,830
I can't say why the SF team didn't implement this, but I can guess. There is just too much variation in how you might fill a BO for this to make sense in a framework. Also, it is very easy to implement. Third it is very easy to implement so you don't have to implement it for every BO that might need it.

To implement it so you don't have to keep adding the same method to all your list BOs, you could just subclass the BusinessLayer, then inherit from you new class. I.e. (in vb)
Public Class ListBOBase
Inherits BusinessLayer
Public Sub FillAll()
Using cmd As New SqlCommand()
cmd.CommandText = String.Format("Select * From {0}",Me.TableName)
Me.FillDataTable(cmd)
End Using
End Sub
End Class


To use:
Public Class SpecificListBO
Inherits ListBOBase
' Because this class inherits ListBOBase, it has the FillAll() Method...
End Class


Hope this helps!
Post #15509
Posted 04/10/2008 4:30:52 PM
StrataFrame Novice

StrataFrame NoviceStrataFrame NoviceStrataFrame NoviceStrataFrame NoviceStrataFrame NoviceStrataFrame NoviceStrataFrame NoviceStrataFrame Novice

Group: StrataFrame Users
Last Login: Today @ 10:11:34 AM
Posts: 102, Visits: 229
Thanks Greg.

I had thought about subclassing the Business Layer and using the FieldEnums to replace the SELECT * as we intend to use Notification Services.

As you say it isn't a big job, I was just being lazy

By the way, is this forum always so quick with a response? I have come from one where you are lucky to get a reply in days let alone minutes!

Thanks,

Aaron

Post #15510
Posted 04/10/2008 5:15:40 PM


StrataFrame Developer

StrataFrame Developer

Group: StrataFrame Developers
Last Login: Today @ 11:13:06 AM
Posts: 4,104, Visits: 4,176
Aaron,

Greg's response is right on target.  The truth is that a framework is supposed to help in the area of "best-practices" as well as many other things.  Though this wouldn't be that difficult to implement, I think that it would be overused and then there would be a whole series of questions about performance out here...so like Greg, said, it is easy to add and you can do it very easily, but this is one of those things that we have thought about putting in before and keep coming back around to, "it's probably not a good idea."

Post #15511
« Prev Topic | Next Topic »


Reading This TopicExpand / Collapse
Active Users: 0 (0 guests, 0 members, 0 anonymous members)
No members currently viewing this topic.
Forum Moderators: Ben Chase, Trent L. Taylor, Steve L. Taylor

PermissionsExpand / Collapse

All times are GMT -6:00, Time now is 5:58pm

Powered By InstantForum.NET v4.1.4 © 2008
Execution: 0.125. 10 queries. Compression Enabled.
Site Map - Home - My Account - Forum - About Us - Contact Us - Try It - Buy It

Microsoft, Visual Studio, and the Visual Studio logo are trademarks or registered trademarks of Microsoft Corporation in the United States and/or other countries.