• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • paul wheaton
  • Liutauras Vilda
  • Ron McLeod
Sheriffs:
  • Jeanne Boyarsky
  • Devaka Cooray
  • Paul Clapham
Saloon Keepers:
  • Scott Selikoff
  • Tim Holloway
  • Piet Souris
  • Mikalai Zaikin
  • Frits Walraven
Bartenders:
  • Stephan van Hulst
  • Carey Brown

Application Design change, design question.

 
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

What would be the best way to upgrade current set of interfaces our application uses. the design is as follows:

Our tool currently uses 2 xml files pc.xml and ph.xml to store data with cross references. Xmlbeans is used to provide the data access to these files.

A business requirement now makes it necessary to combine the 2 into one xml file " pm.xml".

Currently, there is one interface that represents the basic functions on each of the xml file. These interfaces are used throughout the code, one of the interfaces method directly return the document instance.

With the xml schema changes, both these interfaces will break as they will not be able to provide an instance of the document.

Just looking for some tips that would help me better design this new interface that it does not repeat the problem the current interfaces have.

thank you.
 
Bartender
Posts: 3648
16
Android Mac OS X Firefox Browser Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
So your real problem is you want only 1 schema (for the new xml file) yet also backward compatible with the other 2 old files?

About the interface... is it java interface or user interface (layout stuff)? If java, what is it returning? the actual xml schema or the file name or something else?

If it's the xml schema, I'm sure there are ways to integrate the old and new schema (meaning all 3 files use the same schema).
 
Adil Fulara
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Yes. You got it right, only one schema would be used moving forward.

I meant the java interfaces.

These interfaces declare methods which return

1. xml object subclasses for the complete xml document.
2. xml object subclasses for parts of the xml document.

I am not sure if the following is the right way but your comments would be welcome.

1. Mark existing legacy apis as deprecated.
2. Define the new interfaces and abstract classes for the new schema.
3. Write static helper utilities that will re-direct old api calls to the new ones.

thank you.
 
K. Tsang
Bartender
Posts: 3648
16
Android Mac OS X Firefox Browser Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Yes your approach is reasonable. But your primary worry should be the actual xml schema. Without that, it doesn't matter what you do on the java side.

If I were you I would first write the xml schema for the new xml file and see if the old xml files need changing. Eg if you say use a date format ... is it separated into 3 fields/parms (year, month, day) or just 1 field formatted yyyy-mm-dd or similiar.

Once you figure the schema check the xml files against it. I found this one pretty goodxml schema validator

If it is the tag names... then you can just add them to the schema without affecting the new xml file I think.

Well I sure make sound this easy Good luck.
 
Lookout! Runaway whale! Hide behind this tiny ad:
New web page for Paul's Rocket Mass Heaters movies
https://coderanch.com/t/785239/web-page-Paul-Rocket-Mass
reply
    Bookmark Topic Watch Topic
  • New Topic