Menu

prototype_pattern

Katherine E. Lightsey

Prototype pattern

At first glance the prototype pattern seems to be a natural fit for the SQL "select into" operation as shown below. There are some minor issues as indexes, constraints, and triggers defined in the source table are not transferred to the new table, nor can they be specified in the SELECT...INTO statement.

    select <column_list> 
    into <created_table>
    from <prototype_table>

Implementation of a better fit would require a capability for a table to replicate itself, including DDL. While I can certainly imagine ways of doing this, I cannot imagine reasons to do so. While the use of "select into" does not meet the full definition of a prototype as defined for object oriented languages, I contend that it's more than adequate for the task.



copyright Katherine Elizabeth Lightsey 1959-2013 (aka; my life)

"The act of birth is the first experience of anxiety, and thus the source and prototype of the affect of anxiety." - Sigmund Freud




Related

Wiki: design_pattern