On Tue, 27 Apr 2004 17:37:52 +0200
"Henner Kollmann" <[EMAIL PROTECTED]> wrote:
HK> > HK> Yes, we should change the DbEventInterceptorSupport so
HK> > that it will
HK> > HK> support the old methods and the new methods. Simply add the
HK> > HK> old style post interceptor as empty method and call it from
HK> > HK> the new interceptor methods.
HK> > HK>
HK> > HK> So nobody must change their interceptor classes!
HK> > HK>
HK> >
HK> > Only people who extends directly the interface must change
HK> > methods.
HK> >
HK> > If normally people extends DbInterceptorSupport we can make
HK> > bigger changes without affecting old classes. We can put the
HK> > old methods as @deprecated and create new methods which call
HK> > the old methods with the old parameters.
HK>
HK> That's the idea..... Philipp was a little bit angry that we have
HK> changed the interfaces without backwards compatibility - so i will
HK> not do this again...
HK>
But when calling interceptor, we must check if the class is based on
DbInterceptorSupport use new methods, when its only based on
DbEventInterceptor use old behaviour. Then we can define a timeframe
(maybe 3.x) to move new methods to DbEventInterceptor and remove the old
methods.
This you make people happy because the change will be made in 2 steps.
HK> >
HK> > What you think about creating a class to encapsulate the
HK> > parameters and pass only a single parameter to the
HK> > interceptors ? This will make easy to add pass new parameters
HK> > to interceptors in the future.
HK>
HK> Any suggestion about the parameter?
this class or something like this will be the parameter :
/*
* $Header: $
* $Revision: $
* $Date: $
*
* DbForms - a Rapid Application Development Framework
* Copyright (C) 2001 Joachim Peer <[EMAIL PROTECTED]>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
USA
*/
package org.dbforms.config;
import javax.servlet.http.HttpServletRequest;
import java.sql.Connection;
/****
* <p>
* This class encapsulate data about context when an interceptor is
called
* </p>
*
*
* @version $Revision: $
* @author Ivan F. Martinez <[EMAIL PROTECTED]>
*/
public class InterceptorData {
/**
* Current request
*/
private HttpServletRequest request;
/**
* Table where operation will/was performed
*/
private Table table;
/**
* Field values for the operation
*/
private FieldValues fieldValues;
/**
* DbForms configuration
*/
private DbFormsConfig config;
/**
* Database connection
*/
private Connection connection;
/**
* Construct a new instace
*
* @param request current request
* @param table table where operation will/was performed
* @param fieldValues field values for the operation
* @param config DbForms configuration
* @param connection Database connection
*/
public InterceptorData(HttpServletRequest request, Table table,
FieldValues fieldValues, DbFormsConfig config, Connection
connection) {
this.request = request;
this.table = table;
this.fieldValues = fieldValues;
this.config = config;
this.connection = connection;
}
/**
* @return HttpServletRequest current request
*/
public HttpServletRequest getRequest() {
return request;
}
/**
* @return Table where operation will/was performed
*/
public Table getTable() {
return table;
}
/**
* @return FieldValues for the current operation
*/
public FieldValues getFieldValues() {
return fieldValues;
}
/**
*
* @return current DbFormsConfig
*/
public DbFormsConfig getConfig() {
return config;
}
/**
* get Connection used in the operation
*
* @return current Connection
*/
public Connection getConnection() {
return connection;
}
}
--
Ivan F. Martinez
-------------------------------------------------------
This SF.net email is sponsored by: The Robotic Monkeys at ThinkGeek
For a limited time only, get FREE Ground shipping on all orders of $35
or more. Hurry up and shop folks, this offer expires April 30th!
http://www.thinkgeek.com/freeshipping/?cpg=12297
_______________________________________________
DbForms Mailing List
http://www.wap-force.net/dbforms