Addison-Wesley Java Coding Guidelines, 75 Recommendations for Reliable and Secure Programs (2014) by Robert C. Seacord & Dean F. Sutherland & David Svoboda

Addison-Wesley Java Coding Guidelines, 75 Recommendations for Reliable and Secure Programs (2014) by Robert C. Seacord & Dean F. Sutherland & David Svoboda

Author:Robert C. Seacord & Dean F. Sutherland & David Svoboda
Format: epub
Published: 0101-01-01T00:00:00+00:00


Click here to view code image

* * *

public interface User {

boolean authenticate(String username, char[] password);

}

public interface PremiumUser extends User {

void subscribe(int noOfDays);

}

public interface FreeUser {

void freeService();

}

* * *

Compliant Solution (Make New Method Unusable)

Another compliant solution is to throw an exception from within the new freeService() method defined in the implementing subclass.

Click here to view code image

* * *

class Client implements User {

public void freeService() {

throw new AbstractMethodError();

}

}



Download



Copyright Disclaimer:
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.