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

And "client" means outside the bundle. One often wants to extend a class or interface in the internal implementation but not allow it for clients.

No manual checking is needed: PDE's API Tools checks those tags and issues errors or warnings.

Dani



From:        Lars Vogel <lars.vogel@xxxxxxxxx>
To:        "Eclipse Platform UI component developers list." <platform-ui-dev@xxxxxxxxxxx>
Date:        03.07.2014 07:59
Subject:        Re: [platform-ui-dev] Enforcing inheritance constraints to avoid improper API usage
Sent by:        platform-ui-dev-bounces@xxxxxxxxxxx




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
http://jeandersonbc.github.io

_______________________________________________
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_______________________________________________
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