juliocamarero/liferay-portal — pull request #1868 by KocsisDaniel (2013-05-29 13:42:22+00:00)
Title: LPS-35643

Hey Julio,

as we agreed yesterday I am sending this pull for a "pre-review", mainly to ask your opinion about this incomplete solution.

If you remember I faced an issue with turning User into StagedModel because the existing StagedModel interface inherits some methods from AuditedModel interface that can not be implemented in case of User. Namely the userId and userName getters and setters, because User already has these attributes. So our idea with the guys is to make the current StagedModel interface a bit more lightweight and doesn't require to inherit all the AuditedModel only the core methods we use currently, what fortunately doesn't contain the user related ones. In this way we don't need to change the current API what is heavily rely on this type.

The new interface hierarchy looks like this:
StagedModel (extends ClassedModel and subset od AuditedModel methods) -> StagedAuditedModel (extends AuditedModel and StagedModel) -> StagedGroupedModel (extends StagedAuditedModel and GroupedModel)

With this change the User immediately turned into StagedModel without any other changes, and all the StagedModels become StagedAuditedModel's.

I started to implement the minimal UserStagedModelDataHandler, but since the doExport... and doImport methods are abstracts we have to implement them. I think an empty method body might not be the best solution, so I started the development when I realized the Contact should be handled as a Dependency and should be Exported somehow (since the add User will always create a new Contact implicitly, so we don't need to import it), but for that I have to turn the Contact to StagedModel as well. So I am at this point now, and I am curious what is your opinion before I go too far:)

So my questions:
1, are you OK with the new interface hierarchy?
2, can I continue the work on contacts and finish the SMDH? or for now we are OK with the empty Export/Import methods so don't need to take care of contacts?

thanks and sorry for this long description,
Daniel