`
igogogo9
  • 浏览: 247096 次
  • 性别: Icon_minigender_1
  • 来自: 海口市
社区版块
存档分类
最新评论

Method stub and skeleton

阅读更多
stub:桩;存根  skeleton:框架;骨架

A method stub or simply stub in software development is a piece of code used to stand in for some other programming functionality. A stub may simulate the behavior of existing code (such as a procedure on a remote machine) or be a temporary substitute for yet-to-be-developed code. Stubs are therefore most useful in distributed computing in addition to general software development and testing.

A stub is this:

public String someMethod(int i) {
// yet to be implemented
return "a String";
}


Just a method that's declared, but not implemented. Skeleton IIRC is a class consisting of stubs.

> >Skeleton IIRC is a class consisting of stubs.
>
> IIRC ?

If I Remember Correctly.

No, the method's not implemented. It's just declared, and not in an interface, but not in a class. It has no usable body and always returns the same value. Would you think that

public Date getDateFromDatabaseTable(int key) {
// TODO needs to be implemented
return new Date();
}


counts as a valid implementation? Nope. But you might need the method in your design, to test your other classes or to implement an interface that requires it, even though the database isn't set up yet. It's simply a very minimal method declaration just so the compiler won't complain.
> It's just declared,
> and not in an interface, but in a class.
分享到:
评论

相关推荐

    soapdoc2(gSOAP 2.7.8 User Guide)

    8 Using the gSOAP Stub and Skeleton Compiler 9 The gSOAP Remote Method Specification Format 10 gSOAP Serialization and Deserialization Rules 11 SOAP Fault Processing 12 SOAP Header Processing 13 ...

    JDK命令详解

    rmic 为远程对象生成 stub 和 skeleton。 语法: rmic [ options ] package-qualified-class-name(s) 补充说明: rmic 编译器根据编译后的 Java 类(含有远程对象实现)名,为远程对象生成 stub 和 skeleton...

    android service demo

    // TODO Auto-generated method stub Log.e(TAG, " onBind "); return null; } @Override public void onCreate() { // TODO Auto-generated method stub Log.e(TAG, " onCreate "); super....

    cpp-stub 中文使用手册

    单元测试打桩开源库 cpp-stub 使用手册 中文版本,这是从git上直接下载的,git上下载的源代码在arm上调用Stub.reset方法会引发段错误,在资源cpp-stub开源代码(下载地址:...

    gtest stub 详细用法,附件用例,链接

    gtest stub 详细用法,附件用例,链接

    cpp-stub 开源代码

    这是一个单元测试打桩开源代码,在git上下载的代码在ARM平台上有一个BUG,使用stub.h中的reset方法时,会引起段错误,该资源对这个bug进行了修复。

    Android实验报告生命周期.doc

    } public class MyBtnClickListener implements OnClickListener { //重写点击事件处理方法 public void onClick(View arg0) { // TODO Auto-generated method stub Intent intent = new Intent(AlifecycleActivity...

    android webview调用系统相机和图库

    // TODO Auto-generated method stub return super.shouldOverrideUrlLoading(view, url); } @Override public void onPageStarted(WebView view, String url, Bitmap favicon) { // TODO ...

    com.stub.StubApp.apk

    com.stub.StubApp.apk

    j2me rms 通讯录

    // TODO Auto-generated method stub } protected void pauseApp() { // TODO Auto-generated method stub } protected void startApp() throws MIDletStateChangeException { // TODO Auto-generated...

    grpc-stub-1.24.0-API文档-中文版.zip

    赠送jar包:grpc-stub-1.24.0.jar; 赠送原API文档:grpc-stub-1.24.0-javadoc.jar; 赠送源代码:grpc-stub-1.24.0-sources.jar; 赠送Maven依赖信息文件:grpc-stub-1.24.0.pom; 包含翻译后的API文档:grpc-stub-...

    安卓音频播放器带进度条

    // TODO Auto-generated method stub musicStop(); } }); player.setOnCompletionListener(new OnCompletionListener() { @Override public void onCompletion(MediaPlayer mp) { // ...

    1037571306982519com.stub.StubApp.apk

    1037571306982519com.stub.StubApp.apk

    com.stub.StubApp.apk.1

    com.stub.StubApp.apk.1

    Android应用:StubView显示与隐藏

    Android源代码 启动时隐藏StubView,点击Show按钮显示StubView,点击Hide隐藏StubView.

    pageDate封装参数,不用实体类

    // TODO Auto-generated method stub return map.entrySet(); } public boolean isEmpty() { // TODO Auto-generated method stub return map.isEmpty(); } public Set keySet() { // TODO Auto-...

    J2ME分别显示四个图像

    // TODO Auto-generated method stub } } protected void keyPressed(int keyCode) { // TODO Auto-generated method stub dir=getGameAction(keyCode); repaint(); } } ...

    各种布局按钮

    TODO Auto generated method stub boolean isCheacked Switch v isChecked ; if isCheacked { Toast makeText OnOffActivity this "开启" 1 show ; } else { Toast makeText OnOffActivity...

    手机充值卡充值

    // TODO Auto-generated method stub return (Card)this.getHibernateTemplate().get(Card.class, cardPass); } @Override public void updateCard(Card card) { // TODO Auto-generated method stub ...

Global site tag (gtag.js) - Google Analytics