/**
* Interface a<br>
* This interface has 5 methods, F1~f5
*
* @author 88250
* @version 1.0.0, 2007-8-31
*/
public interface Interfacea
{
public void F1 ();
public void F2 ();
public void F3 ();
public void F4 ();
public void F5 ();
}
Package cn.edu.ynu.sei.defaultAdapter;
/**
* Default Adapter role <br>
* This abstract class provides a default implementation for <code>InterfaceA</code>
*
* @author 88250
* @version 1.0.0, 2007-8-31
*/
Public abstract class Adapterc implements Interfacea
{
@Override
public void F1 ()
{
TODO auto-generated Method Stub
}
@Override
public void F2 ()
{
TODO auto-generated Method Stub
}
@Override
public void F3 ()
{
TODO auto-generated Method Stub
}
@Override
public void F4 ()
{
TODO auto-generated Method Stub
}
@Override
public void F5 ()
{
TODO auto-generated Method Stub
}
}
Package cn.edu.ynu.sei.defaultAdapter;
/**
* Inherited from <code>adapterc</code>, and F1 ()
*
* @author 88250
* @version 1.0.0, 2007-8-31
*/
public class CLASSB extends Adapterc
{
@Override
public void F1 ()
{
Overwrite implementation
}
}
3. SummaryThis is the "mediocre" form of the adapter pattern, which allows the class to be inspected without implementing the part of the interface that is not needed. In Java, the implementation of this pattern using the interface and the characteristics of abstract classes, about their characteristics, we must all have their own understanding and experience bar:-)
4. Reference Documents"Design Patterns", "Java and Mode"
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.