CRUD via Stored Procedures or not?


Author
Message
Charles Thomas Blankenship...
Charles Thomas Blankenship
StrataFrame User (448 reputation)StrataFrame User (448 reputation)StrataFrame User (448 reputation)StrataFrame User (448 reputation)StrataFrame User (448 reputation)StrataFrame User (448 reputation)StrataFrame User (448 reputation)StrataFrame User (448 reputation)StrataFrame User (448 reputation)
Group: Awaiting Activation
Posts: 172, Visits: 12K
I've been using StrataFrame for over five years now and I've never pondered this question too hard ... until now.

You have two options when choosing the methods to perform an Update, Insert and Delete ... either provide a CRUD stored procedure (automatically generated by the DDT) or let the framework handle it.

I've currently made the choice to used Stored Procedures ... but I am beginning to doubt my decision for the following reasons:  1) it loads up the stored procedure list with the number of tables times three 2) I have to set six additional properties on each of the BOs. 

As everyone knows, the more code there is and the more properties modified the more opportunities there are to introduce bugs into the system.

So, the big question is this:  Why would anyone choose to go the stored procedure route?

PS:  If one looks at the Table Properties for one of the RBS tables like SFSRoles, the M4 guys use the stored procedure option.  So, what is their reasoning for it?

Thanks,

Charles T. Blankenship
Senior Consultant
Novant Consulting, Inc.
704.975.7152
http://www.novantconsulting.com
StrataFrame Team
S
StrataFrame Developer (4.2K reputation)StrataFrame Developer (4.2K reputation)StrataFrame Developer (4.2K reputation)StrataFrame Developer (4.2K reputation)StrataFrame Developer (4.2K reputation)StrataFrame Developer (4.2K reputation)StrataFrame Developer (4.2K reputation)StrataFrame Developer (4.2K reputation)StrataFrame Developer (4.2K reputation)
Group: StrataFrame Developers
Posts: 3K, Visits: 2.5K
It's really all semantics.  We went the route of stored procedures initially, but we have since switched over to just letting the BOs generate the dynamic SQL.  In SFv2, the dynamic SQL is much better than v1.  For instance, updates only include the fields that have changed rather than blindly updating all fields.

The real reasons you would want to use stored procedures are:

1. Using an indexed view instead of a table for the business object; you would need to use an "instead of" trigger or a sproc to update the multiple tables
2. A DBA is running the database and wants to control CRUD access to individual users based upon permissions on the stored procedures.

SF uses parameterized queries, so the execution plan is cached off just like a sproc is, so the performance isn't really different between the two.  

Some people just like using sprocs or have a DBA that requires the use of sprocs, so we give you the option of using them.
Edhy Rijo
E
StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)
Group: StrataFrame Users
Posts: 2.4K, Visits: 23K
Hi Ben,

Ben Chase (5/20/2013)
It's really all semantics.  We went the route of stored procedures initially, but we have since switched over to just letting the BOs generate the dynamic SQL.  In SFv2, the dynamic SQL is much better than v1.  For instance, updates only include the fields that have changed rather than blindly updating all fields.

That is an excellent enhancement since I have been bitten before in a multi-user application where some flag fields are updated from different forms and then noticed some of my data changed without knowing the reason, so I had to create stored procedures to handle these flag fields updates.

Edhy Rijo

GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...




Similar Topics

Reading This Topic

Login

Explore
Messages
Mentions
Search