dimanche 28 décembre 2014

Creating objects from xml and csv files - which OOP-Pattern? (Java) [on hold]

Let's say i have got a class called Car with attributes like seats or top speed and i want to create some cars based on xml and csv files.


The xml file could look like this:



<cars>
<car seats="4" top-speed="100" />
<car seats="2" top-speed="200" />
</cars>


csv:



2;150
5;110




Which classes you would create? Don't forget that there could be a third datasource later!


My problem is'nt the parsing of the files, but finding good names/structe for my classes. Are there two factories (XmlFactory/CsvFactory)? Or are they builders? Or readers? Is CarXmlFactory better than XmlCarFactory?


I can't find descriptive names.


Thank you!


Aucun commentaire:

Enregistrer un commentaire