Note that there are some explanatory texts on larger screens.

plurals
  1. PODesign Pattern Questions in Java
    primarykey
    data
    text
    <p>I have a Design pattern Question in Java/J2EE</p> <p>Problem Statement::<br> Suppose there are 2 files as below </p> <blockquote> <p>XYZ.properties file --> name = value pair<br> abc.xml file --> attribute=value pair. </p> </blockquote> <p>Both the above files have <code>&lt;name,value&gt;</code> pairs. </p> <p>The question is "<strong>Design a component/jsp page such that you can read,edit,save the name,value pairs of either a Property file or xml file.?"</strong><br> So which Design pattern would you suggest i should be using in Java.?<br> The name,values pair are then fetched and displayed in another jsp page where i should be able to read,edit,save the name,value pairs such that<br> <strong>1>read operation results in reading the name,value pair</strong><br> <strong>2>Edit operation results in editing the name,value pair</strong><br> <strong>3>Save operation results in saving the value for the corresponding name,value pair in database and consequently updates either the property/xml file.</strong> </p> <p><code>**My Initial Analysis** : i would use a Factory design pattern since i have 2 files which have name,value pairs and at run time decide which one to choose depending on the name of file invoked,Once done i would pass the parameters to jsp file for Read,edit and save operation.Save would save the name,value pair to Database but i dont know how will it update the corresponding value for that name in either the property/xml file as well.</code></p> <p>Is my Understanding correct ? If not please provide a design/solution in java for the same,such that READ,EDIT,SAVE operation for pairs in either ".properties file" or ".xml file" are carried out?</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload