[Cosmo-dev] Account activation model, dao, service design
Travis Vachon
travis at osafoundation.org
Mon Nov 20 16:13:52 PST 2006
Hi folks
I'm going to be committing the model, dao, and service level changes
for account activation (bug 4041) this afternoon and bcm requested I
give a brief description of its design before I do that. I'm also
going to be updating
http://wiki.osafoundation.org/bin/view/Journal/AccountActivationDesign
with a cleaned up version of this, and will maintain it at least
until bug 4041 is closed.
Data model changes:
* User model objects now have a persistent property "activationId"
* Before activation, "activationId" is some reasonably unique
string of URL safe characters
* After activation, "activationId" set to null
* A new index on activationId
* User model objects have two new transient methods:
- public boolean isActivated()
- public void activate()
Data access object changes:
* New user lookup method in UserDao "public User
getUserByActivationId(String id)"
Service level changes:
* New service interface "AccountActivationService" with four
methods:
- public String getActivationToken()
- public void initiateActivationProcess(User user)
- public void activateUserFromToken(String activationToken)
- public User getUserFromToken(String activationToken)
* New abstract implementation of AccountActivationService
"AbstractCosmoActivationService" to encapsulate the behavior of our
User model described above (ie, use "User.activate and
UserDao.getUserByActivationId)
- Implemented methods:
* activateUserFromToken
* getUserFromToken
* Temporary default implementation of AccountActivationService
that extends AbstractCosmoActivationService
"AutomaticAccountActivationService"
- getActivationToken returns null,
- initiateActivationProcess(user) calls user.activate()
- will probably remain as AccountActivationService for unit
testing.
* StandardUserService.createUser sets activationId on User object
with activationToken from AccountActivationService.getActivationToken
() and then calls AccountActivationService.initiateActivationProcess()
Frontend changes (in the CMP servlet and spring MVC configuration)
are currently in progress, but I'll update the page linked above with
those details as they come.
Comments very welcome!
-Travis
More information about the cosmo-dev
mailing list