次のソース スニペットを検討してください。
スニペット #1
StoredProcedure sp = new StoredProcedure( "PROC_NAME", getConnection() );
sp.putParameter( "ID", getId() );
sp.execute();
スニペット #2
StoredProcedure sp = new StoredProcedure( "PROC_NAME" );
sp.setConnection( getConnection() );
sp.putParameter( "ID", getId() );
sp.execute();
スニペット #3
StoredProcedure sp = new StoredProcedure( "PROC_NAME" );
sp.putParameter( "ID", getId() );
sp.execute( getConnection() );
Q: どのスニペットが最もオブジェクト指向で、その理由は?
Q: 各スニペットの長所と短所は何ですか?