  | Mailing List | | Home | | Forum Home | | JBoss - Java Application Server | | Tomcat - JSP/Servlet container | | Struts - A MVC web framework | | iText - An open source PDF Java Library | | JDOM - JDOM XML Parser | | JSP - A mailing list about Java Server Pages specification and reference | | J2EE - A mailing list for Java(tm) 2 Platform, Enterprise Edition | | J2EE Pattern - An interest list for Sun Java Center J2EE Pattern Catalog | | Servlet - A mailing list for discussion about Sun Microsystem's Java Servlet API Technology | |
Struts & Hibernate
|
|
|
  | | | Design paterns for null arguments | Design paterns for null arguments 2004-05-28 - By Sandeep Kachalia
Back Thanks Ben, I wanted to open APIs for my client. The API users may pass null values as arguments. I have n number of parameters against I need to do null verification. Can we apply some pattern here through which we check the nullability and give customerized messages to user.
e.g. public void myFunction(String a,String b,String c) { Object arguments[] ; // List of argument objects; // patternApplied(Object arguments[]) throws Exception }
I hope I am able to make it clear.
Thanks, Sandeep
Ben Hill wrote:
>On Fri, 2004-05-28 at 07:10, Sandeep Kachalia wrote: > > >>Does exist a pattern for handling null arguments in a method. >>any pointers?? >> >> > >Not a method per se. If you have some sort of idea what the null >handling should do, there may be a pattern to help. > >Cheers, > >Ben > >==================================================================== >Companion Site: http://www.corej2eepatterns.com >J2EE BluePrints: http://java.sun.com/blueprints/corej2eepatterns >List Archive: http://archives.java.sun.com/archives/j2eepatterns-interest.html >Unsubscribing: email "signoff J2EEPATTERNS-INTEREST" to listserv@(protected) > >
==================================================================== Companion Site: http://www.corej2eepatterns.com J2EE BluePrints: http://java.sun.com/blueprints/corej2eepatterns List Archive: http://archives.java.sun.com/archives/j2eepatterns-interest.html Unsubscribing: email "signoff J2EEPATTERNS-INTEREST" to listserv@(protected)
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> <meta http-equiv="Content-Type" content="text/html;charset=ISO-8859 (See http://ISO-8859.ora-code.com)-1"> <title></title> </head> <body text="#330099" bgcolor="#ffffff"> <font size="-1"><font face="Lucida Sans Unicode">Thanks Ben,<br> I wanted to open APIs for my client. The API users may pass null values as arguments.<br> I have n number of parameters against I need to do null verification.<br> Can we apply some pattern here through which we check the nullability and give customerized messages to user.<br> <br> e.g. <br> public void myFunction(String a,String b,String c)<br> { Object arguments[] ; // List of argument objects; <br> // patternApplied(Object arguments[]) throws Exception<br> }<br> <br> I hope I am able to make it clear.<br> <br> Thanks,<br> Sandeep<br> <br> </font></font><br> Ben Hill wrote:<br> <blockquote type="cite" cite="mid1085735389.476.36.camel@(protected)"> <pre wrap="">On Fri, 2004-05-28 at 07:10, Sandeep Kachalia wrote: </pre> <blockquote type="cite"> <pre wrap="">Does exist a pattern for handling null arguments in a method. any pointers?? </pre> </blockquote> <pre wrap=""><!----> Not a method per se. If you have some sort of idea what the null handling should do, there may be a pattern to help.
Cheers,
Ben
==================================================================== Companion Site: <a class="moz-txt-link-freetext" href="http://www .corej2eepatterns.com">http://www.corej2eepatterns.com</a> J2EE BluePrints: <a class="moz-txt-link-freetext" href="http://java.sun.com /blueprints/corej2eepatterns">http://java.sun.com/blueprints/corej2eepatterns</a > List Archive: <a class="moz-txt-link-freetext" href="http://archives.java.sun .com/archives/j2eepatterns-interest.html">http://archives.java.sun.com/archives /j2eepatterns-interest.html</a> Unsubscribing: email "signoff J2EEPATTERNS-INTEREST" to <a class="moz-txt-link -abbreviated" href="mailto:listserv@(protected)">listserv@(protected)</a> </pre> </blockquote> </body> </html> ==================================================================== Companion Site: http://www.corej2eepatterns.com J2EE BluePrints: http://java.sun.com/blueprints/corej2eepatterns List Archive: http://archives.java.sun.com/archives/j2eepatterns-interest.html Unsubscribing: email "signoff J2EEPATTERNS-INTEREST" to listserv@(protected)
|
|
 |