suitable representation of data in OO programs.




I have a question I would like some feedback on:

My basic problem here is that I need to create a configuration module, that can parse both a configuration file and a configuration web page. The input from the file can be a string or a stream but the input from a web page is dependant on the framework used and needs to be converted.

So...

With regards to data beeing passed around in a program, such as configuration data or web form data, I cant seem to make up my mind on what representation of this data is best. I have seen people creating an interface to represent the data in specialised data objects while others just use HashMaps.

- The arguments for specialised data objects are that it is more object oriented, and it gives benefits such as, single method call and no casting of return data.
- The arguments of HashMap is KISS.

- A negative consequence of specialised data objects is that if the dataset changes, you have to change both the interface and the objects implementing that interface. This creates more work than needed. Additionally this kind of approach to designing an application just feeds more complexity into the code.
- The negative consequenes of a HashMap approach is that one needs to convert the data at every use point into the correct data type to be able to use it.

I suppose it all depends on the use, so for configuration information I would think a Properties object is the best. But for web query data, such as a web form, I am not sure which is easier, since you might easily change the name of a forms field or add/remove a field.

Anybody have any thoughts?

.



Relevant Pages

  • Re: suitable representation of data in OO programs.
    ... What I mean about this is 1) you have to take considerations about something you would not have to do when using a hashmap, i.e. hashmaps are plug and play, objects are plug, configure interface, configure object, and then finally play... ... I am programming a server which needs 99.999% uptime, so the servers configuration needs to be reloadable during run-time. ... HashMap so you don't have to write "extra" code. ...
    (comp.lang.java.help)
  • Re: suitable representation of data in OO programs.
    ... My basic problem here is that I need to create a configuration module, ... configuration data or web form data, I cant seem to make up my mind on ... The arguments for specialised data objects are that it is more ...
    (comp.lang.java.help)
  • 2.6.18.3 Lockup on Athlon MP
    ... I am sure it's not just a hardware issue, though, ... as well as the kernel configuration I am using. ... # ACPI (Advanced Configuration and Power Interface) Support ...
    (Linux-Kernel)
  • Slow Point to Point T1 Access Please Help
    ... interface FastEthernet0/0 ... DRAM configuration is 64 bits wide with parity disabled. ... minute output rate 7000 bits/sec, 7 packets/sec ... output buffer failures, ...
    (comp.dcom.sys.cisco)
  • Re: Slow Point to Point T1 Access Please Help
    ... interface FastEthernet0/0 ... DRAM configuration is 64 bits wide with parity disabled. ... minute output rate 7000 bits/sec, 7 packets/sec ... output buffer failures, ...
    (comp.dcom.sys.cisco)