Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [platform-ui-dev] Enforcing inheritance constraints to avoid improper API usage

AFAIK the idea is that the framework should guide the user to avoid certain things but it should not prevent doining them.

Best regards, Lars

Am 03.07.2014 06:00 schrieb "Jeanderson" <jeandersonbc@xxxxxxxxx>:
Hello folks,

I'm currently working in a GSoC project to add Generics support for JFace viewers.
While reviewing some code, I noticed the following pattern:
------------------------------------------------------------------------------------
/**
 * (...)
 *
 * @since (...)
 * @noextend This class is not intended to be subclassed by clients.
 *
 */
public class A [extends B [implements C]] { ... }
------------------------------------------------------------------------------------

Is there any special reason to not use "final" keyword? In addition, I'm not sure but I guess there are some methods documented like the former example.

I know that our work is reviewed by someone to prevent the addition of improper code (including the case that someone use bad sub-typing). 
However, why waste time manually checking such constraints while the compiler could save time doing this?

I don't know if this is an issue at all, I would like to know your thoughts about this.

Best regards,
Jeanderson Barros Cândido

_______________________________________________
platform-ui-dev mailing list
platform-ui-dev@xxxxxxxxxxx
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://dev.eclipse.org/mailman/listinfo/platform-ui-dev

Back to the top