-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA512
On 01/31/2014 11:41 AM, Julien Viet wrote:
I looked at it, it looks fine.
Cool, thanks!
However have you tried to make the new mixin extends the
gtn:visible mixin ? I think it would be better as having this mixin
would imply to have the visible mixin.
I was talking with ppalaga about it yesterday, and I'll give it a try
soon.
I'm probably missing something, but it isn't clear to me what would be
the benefits of this approach, other than "it is contextually correct"
(which is in itself a valid reason). I hope to find a possible answer
when I get this implemented, but I couldn't find anything on the
documentation that would explain the difference or perhaps show the
benefits of this approach. Perhaps there's an advantage on how the
data is stored? In data consistency?
In other words, this is how the code looks like in the PR, without the
new mixin inheriting gtn:visible:
// NavigationServiceImpl
Visible visible = sourceNav.adapt(Visible.class);
... // do operations related to Visible.class
if (sourceNav.isAdapted(RestrictAccess.class)) {
... // do operations related to RestrictAccess.class
} else {
chromatticSession.setEmbedded(sourceNav, RestrictAccess.class,
restrictAccess);
}
With the RestrictAccess inheriting Visible, I suppose that the code
would look like this:
if (!sourceNav.isAdapted(RestrictAccess.class)) {
... // it's only Visible, so, probably an old node: replace Visible by
RestrictAccess on the sourceNav
}
// do operations related to Visible.class
// and operations related to RestrictAccess.class
And this is how it currently looks like on NodeData:
if (navigation.isAdapted(Visible.class)) {
... // operations about Visible
}
if (navigation.isAdapted(RestrictAccess.class)) {
... // operations about RestrictAccess.class
}
With the change, the second conditional could be placed inside the
first, saving perhaps an unnecessary check if the *first* renders
false (which, from what I understand, would rarely happen).
Juca.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.22 (GNU/Linux)
Comment: Using GnuPG with Thunderbird -
http://www.enigmail.net/
iQEcBAEBCgAGBQJS64TWAAoJECKM1e+fkPrXKEEIAJBgeDiwGy/L9gVwaU2gNv9i
pPoE+T9GZKQOjetsq7SuJnlKmUxkyz3ilVOKmrZbE6+bMWyZL73EGiEGdHlSBG3U
pZ1Qc/glEfnck0Tjg3zjpGfpbIGzo+Y0Jcs9V9QJC8kQVbuw8PTs2RPrK02DprNG
j2Z+bAqm+ntf7qGdm5LdXcrT97jo6AZylY1mqzdCzGpWsve2gWFInxn3s021OUJ4
oMIb/VVkjcAxudkAh2ZI2wBzHwmgpbHw2yQKjD+xTCHgttPEql/tx2jDeaBwY9at
msJkrj8LoWm8w5jc9HDB32LuG/aBl5Lq6lRzvG/oi22oUM2KpjuGOf2R5dS13WQ=
=kYEX
-----END PGP SIGNATURE-----