Dismiss
InnovationQ will be updated on Sunday, Oct. 22, from 10am ET - noon. You may experience brief service interruptions during that time.
Browse Prior Art Database

New Java feature - using annotation to mark method default implementation in interface

IP.com Disclosure Number: IPCOM000199291D
Publication Date: 2010-Aug-30
Document File: 2 page(s) / 47K

Publishing Venue

The IP.com Prior Art Database

Abstract

Java uses single inheritance syntax which make Java simple, straightforward and easy to use. In case of multiple inheritance scenario, Java implements multiple interfaces to simulate multiple inheritance. This causes Java class often need implement all methods of multiple interfaces, usually dozens of interface methods need implementing in spite of only a few of the functional methods of them really do. This invention introduces some annotations to mark interface methods so that they won't need implementing when a class implements corresponding interfaces.

This text was extracted from a PDF file.
This is the abbreviated version, containing approximately 62% of the total text.

Page 1 of 2

-

New Java feature

-- using annotation to mark method default implementation in interface

using annotation to mark method default implementation in interface

Java's single inheritance syntax makes the Java class structure is simple, straightforward and easy to use. In some actual cases, which need multiple inheritance ,Current solution is using multiple interfaces to simulate multiple inheritance. Considering a class which need inherit one framework class and other business classes. In this situation, Java usually makes the class extend the framework class and implement other business interfaces. If theses interfaces have tens of methods or even more, it must implement them even most of them are implemented as empty methods or only contain throw new NotImplementedException() etc.

Our Invention is to use kinds of annotations to indicate the default implementation of methods in interfaces so they won't need be implemented in one class which implements such interfaces.

The core idea of our invention is that we introduce some annotations into one interface's source code. When a developer write a class which implements several interfaces, now he can only implements those methods which are not marked with annotation in the interface definition and which are shared among interfaces and left others implemented by java compiler.

First, if we write 2 interfaces IA and IB, use annotations to mark the default implementation of methods which we select.
public interface IA {

@E...