Closed adrianbanks closed 10 years ago
Good find. Now you describe what it was, it makes perfect sense for the behaviour you described! I've looked over it a bit, but not in full yet. I'll try and get onto it later this afternoon.
It was Ian who gave me a good steer to find it.
Teamwork FTW!
----- Original Message ----- From: "Adrian Banks" notifications@github.com To: "dddeastanglia/DDDEastAnglia" DDDEastAnglia@noreply.github.com Sent: Friday, 27 June, 2014 4:33:42 PM Subject: Re: [DDDEastAnglia] Fix #285 Voting isn't working on the staging site (#287)
It was Ian who gave me a good steer to find it.
Reply to this email directly or view it on GitHub: https://github.com/dddeastanglia/DDDEastAnglia/pull/287#issuecomment-47361239
@philpursglove :+1: :smile:
Before the refactoring, it made sense within the domain - the method to see if a vote had been logged for a particular session in that cookie.... I feel as though information and behaviour has been lost
Before, there was a class that did something that looked sensible, but wasn't actually used anywhere. The only bits that were used were the two properties (which are still on the refactored class).
The refactored class needs more logic to get these two values (name and expiry), as they are no longer hard-coded. To get them requires database access, hence the dependencies. I did consider making them method calls as they had logic in them, but then that looked weird in usage so left it as is.
The refactored class needs more logic to get these two values (name and expiry), as they are no longer hard-coded. To get them requires database access, hence the dependencies.
I would prefer that VotingCookie
became a true Value Object (ideally immutable too), and that something else was responsible for the necessary logic to create them. The interface can then be deleted, because VotingCookie
s will be easy to construct again, with the two pieces of information they expose (name and expiry date).
I've been round in circles with this a few times now due to needing some information from the cookie before I can load the cookie. I think I've now sorted it.
The cookie used to store the votes had an expiry date in the past. I've made it pull the expiry date from the database based on the real conference dates.