There are only two hard things in computer science: cache invalidation, naming things, and off-by-one errors
Arash Babak wrote:But in the future for more cities i definitely go for paginate.
Campbell Ritchie wrote:You may want a Map<Type, List<Hotel>> or similar. But your requirements really are beginning to look like something for a databse.
And when you add another city, you will have no end of work upgrading the system to accommodate it. Why not make the system expandable, particularly if that simply entails good design?Arash Babak wrote:. . . because it's just for one city . . .
Campbell Ritchie wrote:
And when you add another city, you will have no end of work upgrading the system to accommodate it. Why not make the system expandable, particularly if that simply entails good design?Arash Babak wrote:. . . because it's just for one city . . .
Stephan van Hulst wrote:Why is your class so weakly typed? What are the stars and off, distances and virtualTour fields for? From what to what do the mapAddress, rooms, phones and userReview fields map? Why are they inside lists?
Dave Tolls wrote:I can see a number of things there that ought to be classes in their own right.
I assume that stars is a hotel rating. If that is the case, then it makes sense to make it an Integer since it only (typically) has values 1,2,3,4,5.Arash Babak wrote:
1. stars : are stars font icons.
salvin francis wrote:
I assume that stars is a hotel rating. If that is the case, then it makes sense to make it an Integer since it only (typically) has values 1,2,3,4,5.Arash Babak wrote:
salvin francis wrote:Well I still don't agree using String where a number should reside...
Campbell Ritchie wrote:Don't like that code at all. There is something wrong with an array of ints representing options. Not at all an object oriented solution.
Arash Babak wrote:. . . . "1" means ascending and "0" means descending.
Campbell Ritchie wrote:
Arash Babak wrote:. . . . "1" means ascending and "0" means descending.
Campbell Ritchie wrote:
Why would you want to retain records of how a List is sorted? Why would you want to sort the same List twice? You can simply reverse a list already sorted.
Why not have an enumerated type recording sorting orders?
Stephan van Hulst wrote:I'm actually not quite sure why you're doing this sorting stuff manually. Can't you just let table views sort on a column in Android?
salvin francis wrote:... If someone modifies your code and does a setStarsNum() without calling setStars() and all hell breaks loose. An item representing 5 stars can potentially render as 1 star in the UI
Aaaaaand ... we're on the march. Stylin. Get with it tiny ad.
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
|