Java Mailing List Archive

http://www.junlu.com/

Google
Google
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
Subjects
JSP editor plugin for eclipse ?
org apache jasper JasperException: Unable to compile class for JSP
Tomcat: Connection reset by peer: socket write error
Cannot retrieve definition for form bean null
Struts Tiles Tutorial (free Struts training)
Where do I download Tomcat 4 0 6?
Data Access Object (DAO) pattern, example DAO 's
Where to download Tomcat v 4 1 24 from?
Tomcat 5 0 16 Requested resource not available
Subject: Servlet : Session invalidate
Oracle Connection Pooling in 3 2 2
Servlet action is currently unavailable
Tomcat/Struts Unicode Encoding/Decoding problems
Subject: Running a Simple JMS Example
Tomcat and webapplication specific java library path
Mapping in workers2 properties
org apache jasper JasperException
problem with html:text bean throwing exception
Cannot find message resources under key org apache struts action
   MESSAGE
Cannot find message resources under key org apache struts action MESSAGE
invalid direct reference problem with solution
Tool for jsp debug Try Sysdeo Eclipse Plugin
Tomcat 5 Cannot load JDBC driver class 'null ' SQL state: null
weblogic ejbc
java properties file
Jboss 3 2 3 Coyote Can 't re
Tomcat 5, Apache2 and mod jk2 integration problem
JBoss example problem new to J2EE
Value attribute of <html:checkbox
url string for connecting jboss to oracle
javax servlet ServletException: BeanUtils populate
5 0 18: Windows XP Pro vs Windows 2000
HTTP Status 404 The requested resource is not available
 
Can you suggest a suitable pattern?

Can you suggest a suitable pattern?

2006-03-22       - By Soms S

 Back
Reply:     1     2     3     4     5     6  

Thanks Kallol and M.Shariff.



The issue (I think) with the XML/Properties file is that all fields
aren't got through the same user interface components - for instance,
one field may have a combo box, other a number rider, some other plan
text and so forth. The validation rule for each of these fields is
complicated to be specified in a XML file (as mentioned before there may
be dependency on the previous field entries). Am I missing something
here? If you have faced with a similar issue and have taken this
approach please explain it in detail.



Thanks, Soms.

__ ____ ____ ____ ____ ____ ____

From: An interest list for Sun Java Center J2EE Pattern Catalog
[mailto:J2EEPATTERNS-INTEREST@(protected)] On Behalf Of Mohammed
Shariff
Sent: Tuesday, March 21, 2006 8:08 PM
To: J2EEPATTERNS-INTEREST@(protected)
Subject: Re: Can you suggest a suitable pattern?



Hi Soms,

  You can use a single class which can derive its properties from a
properties file or an XML file. This class with getters and setters for
each field, should parse an XML file

or read the properties file, within a defined constructor or a method of
its own.



Hope it helps.



Mohammed Shariff



Soms S <somasundram.balakrushnan@(protected)> wrote:

       Design Issue:
 
       Motivation:
       There are as many as 37 config items; each config item has
different
       fields and each field entry has different set of validation
rules. The
       config items are sequentially arranged and have dependency
between each
       other (the next config entry depends on the values provided to
the
       previous config entry). We need a mechanism to configure all 37
config
       items.
 
       One approach is to have a Wizard kind of set up to configure the
items.
       That is, display each config item and its associated fields in
separate
       screens; when user chooses next, based on the current input we
can
       generate the next config item.
 
       But using a Wizard will require 37 screens (one for each config
item)
       and if the GUI is to be generated with a tool (for eg: Netbeans)
then
       using 'Generation Gap' pattern would double the classes required
37 * 2
       = 74 classes! Besides if config items increases that would
increase the
       number of screens which in turn would double the classes
required; this
       obviously is a class explosion!
 
       I guess this is a generic issue and I'm wondering if there is
any
       alternative or a design pattern to address this.
 
       Thanks, Soms.
 
 
====================================================================
       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)


====================================================================
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)

<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft
-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:st1=
"urn:schemas-microsoft-com:office:smarttags" xmlns="http://www.w3.org/TR/REC
-html40">

<head>
<meta http-equiv=Content-Type content="text/html; charset=us-ascii">
<meta name=Generator content="Microsoft Word 11 (filtered medium)">
<!--[if !mso]>
<style>
v\:* {behavior:url(#default#VML);}
o\:* {behavior:url(#default#VML);}
w\:* {behavior:url(#default#VML);}
.shape {behavior:url(#default#VML);}
</style>
<![endif]--><o:SmartTagType
namespaceuri="urn:schemas-microsoft-com:office:smarttags" name="PersonName"/>
<!--[if !mso]>
<style>
st1\:*{behavior:url(#default#ieooui) }
</style>
<![endif]-->
<style>
<!--
/* Font Definitions */
@(protected)
       {font-family:Tahoma;
       panose-1 (See http://ose-1.ora-code.com):2 11 6 4 3 5 4 4 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
       {margin:0in;
       margin-bottom:.0001pt;
       font-size:12.0pt;
       font-family:"Times New Roman";}
a:link, span.MsoHyperlink
       {color:blue;
       text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
       {color:purple;
       text-decoration:underline;}
span.EmailStyle17
       {mso-style-type:personal-reply;
       font-family:Arial;
       color:navy;}
@(protected) Section1
       {size:8.5in 11.0in;
       margin:1.0in 1.25in 1.0in 1.25in;}
div.Section1
       {page:Section1;}
-->
</style>

</head>

<body lang=EN-US link=blue vlink=purple>

<div class=Section1>

<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>Thanks Kallol and M.Shariff.<o:p></o:p><
/span></font></p>

<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'><o:p>&nbsp;</o:p></span></font></p>

<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>The issue (I think) with the
XML/Properties file is that all fields aren&#8217;t got through the same user
interface
components - for instance, one field may have a combo box, other a number rider,
some other plan text and so forth. The validation rule for each of these fields
is complicated to be specified in a XML file (as mentioned before there may be
dependency on the previous field entries). Am I missing something here? If you
have faced with a similar issue and have taken this approach please explain it
in detail.<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'><o:p>&nbsp;</o:p></span></font></p>

<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>Thanks, Soms.<o:p></o:p></span></font></p>

<div>

<div class=MsoNormal align=center style='text-align:center'><font size=3
face="Times New Roman"><span style='font-size:12.0pt'>

<hr size=2 width="100%" align=center tabindex=-1>

</span></font></div>

<p class=MsoNormal><b><font size=2 face=Tahoma><span style='font-size:10.0pt;
font-family:Tahoma;font-weight:bold'>From:</span></font></b><font size=2
face=Tahoma><span style='font-size:10.0pt;font-family:Tahoma'> <st1:PersonName
w:st="on">An interest list for Sun Java Center J2EE Pattern Catalog</st1
:PersonName>
[mailto:J2EEPATTERNS-INTEREST@(protected)] <b><span style='font-weight:bold'>On
Behalf Of </span></b>Mohammed Shariff<br>
<b><span style='font-weight:bold'>Sent:</span></b> Tuesday, March 21, 2006 8:08
PM<br>
<b><span style='font-weight:bold'>To:</span></b>
J2EEPATTERNS-INTEREST@(protected)<br>
<b><span style='font-weight:bold'>Subject:</span></b> Re: Can you suggest a
suitable pattern?</span></font><o:p></o:p></p>

</div>

<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'><o:p>&nbsp;</o:p></span></font></p>

<div>

<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'>Hi Soms,<o:p></o:p></span></font></p>

</div>

<div>

<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'>&nbsp;&nbsp; You can use a single class which can derive its properties
from a properties file or an XML file. This class with getters and setters for
each field,&nbsp;should parse an XML file<o:p></o:p></span></font></p>

</div>

<div>

<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'>or read the properties file, within a defined constructor or a method
of its own.<o:p></o:p></span></font></p>

</div>

<div>

<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'>&nbsp;<o:p></o:p></span></font></p>

</div>

<div>

<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'>Hope it helps.<o:p></o:p></span></font></p>

</div>

<div>

<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'>&nbsp;<o:p></o:p></span></font></p>

</div>

<div>

<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'>Mohammed Shariff<o:p></o:p></span></font></p>

</div>

<div>

<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'><br>
<br>
<b><i><span style='font-weight:bold;font-style:italic'>Soms S
&lt;somasundram.balakrushnan@(protected)&gt;</span></i></b> wrote:<o:p></o:p><
/span></font></p>

</div>

<blockquote style='border:none;border-left:solid #1010FF 1.5pt;padding:0in 0in
0in 4.0pt;
margin-left:3.75pt;margin-top:5.0pt;margin-bottom:5.0pt'>

<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'>Design Issue:<br>
<br>
Motivation:<br>
There are as many as 37 config items; each config item has different<br>
fields and each field entry has different set of validation rules. The<br>
config items are sequentially arranged and have dependency between each<br>
other (the next config entry depends on the values provided to the<br>
previous config entry). We need a mechanism to configure all 37 config<br>
items.<br>
<br>
One approach is to have a Wizard kind of set up to configure the items.<br>
That is, display each config item and its associated fields in separate<br>
screens; when user chooses next, based on the current input we can<br>
generate the next config item. <br>
<br>
But using a Wizard will require 37 screens (one for each config item)<br>
and if the GUI is to be generated with a tool (for eg: Netbeans) then<br>
using 'Generation Gap' pattern would double the classes required 37 * 2<br>
= 74 classes! Besides if config items increases that would increase the<br>
number of screens which in turn would double the classes required; this<br>
obviously is a class explosion!<br>
<br>
I guess this is a generic issue and I'm wondering if there is any<br>
alternative or a design pattern to address this.<br>
<br>
Thanks, Soms.<br>
<br>
====================================================================<br>
Companion Site: http://www.corej2eepatterns.com<br>
J2EE BluePrints: http://java.sun.com/blueprints/corej2eepatterns<br>
List Archive: http://archives.java.sun.com/archives/j2eepatterns-interest.html
<br>
Unsubscribing: email &quot;signoff J2EEPATTERNS-INTEREST&quot; to
listserv@(protected)<o:p></o:p></span></font></p>

</blockquote>

<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'><br>
==================================================================== 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 &quot;signoff J2EEPATTERNS-INTEREST&quot; to listserv@(protected)<o:p><
/o:p></span></font></p>

</div>

</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)

©2008 junlu.com - Jax Systems, LLC, U.S.A.