commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Nelson, Laird" <Laird.Nel...@FMR.COM>
Subject RE: [BeanUtils] "Diff" for beans?
Date Wed, 29 Jan 2003 19:45:42 GMT
> -----Original Message-----
> From: Henri Yandell [mailto:bayard@generationjava.com]
> Let's say you ask the class to do a bean-diff. What would you 
> get back?
> How would you represent the three concepts of changed, added, removed?

Well, I'm not sure about the removed part--for this current silly
application I don't have to concern myself with it.

But otherwise, you'd get back a graph whose only contents would be
"containers", and you'd only set properties on those containers that had
changed.

So an Employee might work for a Manager, and might have three properties,
salary among them, and if, given two graphs, only the salary for one
employee in the second graph had changed, you'd return a graph featuring a
Manager (with his employees property set to contain exactly one employee)
whose one Employee would have only one property set, viz. the salary
property (with the new value).

I can't see how removals would work in this case.  Perhaps that's reason
enough to scrap the idea of making this generic and just rolling it myself?
We're almost in set-theory land here, but not quite, which is what makes it
tricky.

Laird

Mime
View raw message