dddeastanglia / DDDEastAnglia

DDD East Anglia website
https://www.dddeastanglia.com
7 stars 10 forks source link

Fix #285 Voting isn't working on the staging site #287

Closed adrianbanks closed 10 years ago

adrianbanks commented 10 years ago

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.

alastairs commented 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.

adrianbanks commented 10 years ago

It was Ian who gave me a good steer to find it.

philpursglove commented 10 years ago

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

alastairs commented 10 years ago

@philpursglove :+1: :smile:

adrianbanks commented 10 years ago

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.

alastairs commented 10 years ago

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 VotingCookies will be easy to construct again, with the two pieces of information they expose (name and expiry date).

adrianbanks commented 10 years ago

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.