I am building a small project and I would like to get some inputs about the way I design my project. I would be more then happy to know if my way of thinking is good or bad, and if it bad so what can I do to improve that and why my design isn't good(and how to improve it if you can ofcourse)
I got 3 classes one is Street which got two properties: area and number of building.
The second class is City and it got a Map - the string is StreetName.
The third class is Contry and it got a Map - the string is CityName.
Now I want to compare two Contries and create report.
If 2 cities(from different Contries) got the same CityName so check if they got the same StreetName if they have so compare the area and number of building. If they don't have so write to the report someting like this: "the contries got the same city name but one got 20 building and the second got 55"(also when they are have the same area and number of building, write something to the report).
This is the way I was thinking to do it:
Create 3 classes: ContryReport, CityReport and StreetReport.
ContryReport, will have a list of CityReport and will have method of cityCompareReport(Contry, Contry).
The method will accept 2 Contries and if the got the same CityName it create a object of CityReport and compare those Cities.
CityReport will have a list of StreetReport and will have method of streetCompareReport(City, City).
The method will accept 2 Cities and if the got the same StreetName it create a object of StreetReport and compare those streets.
StreetReport will compare the area and number of building and provide a suitable report.
please let me know if it's the right way to do it and if not please let me know where did I go wrong(I want to learn :))
Thank you all, even if you just read it :)
Aucun commentaire:
Enregistrer un commentaire