1
General Board / Re: Designing stored procedures
« on: March 06, 2002, 07:43:04 am »
A lot of the modeling I do right now involves stored procedures. The <<table>> stereotype is one of the reasons I picked Enterprise Architect because it's very useful for modeling result sets.
Here are some techniques I've been using (and that I like, so far). Criticism and comments are welcome!
Stored Procs can be modeled as classes with a single "execute" method. You can type in the correct database data types for parameters even though they won't appear in the dropdown list.
If you have separate packages for Stored Procs and Result Sets, the result set can have the same name as the stored proc. Result sets can be modeled as quite well as classes using the <<table>> stereotype. If the stored proc returns multiple result sets, you can create an additional aggregation class in the model to represent this, and model the execute method of the stored proc as "returning" this aggregation class. Setting Multiplicity comes in handy here if the stored proc returns a variable number of "the same" result set (i.e. the same column layout).
If the stored proc calls other stored procs, those can be represented as members of the stored procedure's class.
Hope this gives you some ideas.
Tim Heckman
Here are some techniques I've been using (and that I like, so far). Criticism and comments are welcome!
Stored Procs can be modeled as classes with a single "execute" method. You can type in the correct database data types for parameters even though they won't appear in the dropdown list.
If you have separate packages for Stored Procs and Result Sets, the result set can have the same name as the stored proc. Result sets can be modeled as quite well as classes using the <<table>> stereotype. If the stored proc returns multiple result sets, you can create an additional aggregation class in the model to represent this, and model the execute method of the stored proc as "returning" this aggregation class. Setting Multiplicity comes in handy here if the stored proc returns a variable number of "the same" result set (i.e. the same column layout).
If the stored proc calls other stored procs, those can be represented as members of the stored procedure's class.
Hope this gives you some ideas.
Tim Heckman

