接口定义 图中两个节点之间是用“关键字”联系起来的,但是数据库还没有设计好。“设计实现该技术点时,要抛开数据库,留接口。”这里的关系怎样用“接口”进行定义。 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 interface person{ string name; string country; ....... string[] void getRelationShip(); ........} interface IPerson{ string name; string country; ....... ArrayList getRelationShip(); ........}publi class ChenHu: IPerson{ string name; string country; ArrayList friends=new ArrayList(); ....... ArrayList getRelationShip() { return friends; } void setRelationShip(IPerson p) { this.friends.add(p) } ........} 首先看图中的关键字球,有两种类型,一种是人,一种是国家,那么可以定义一个统一的关键字接口IKeyBehavior,然后让人和国家都继承这个统一的接口,然后再看,这些关键字之间都是有着各种各样的关系,那么就必然有个关系接口,定义为IKeyRelation,然后在IKeyBehavior接口中有个指向IKeyRelation的引用集合List<IKeyRelation>,最后在IKeyRelation中有个指向IKeyBehavior引用的关联对象(意思是指有关系的东西)。public interface IKeyBehavior{ string name; //关键字名称 List<IKeyRelation> relats; //有关系的关键字集合}public interface IKeyRelation{ string name; //关系名称 IKeyBehavior object; //有关系的关键字} 定义JS接口操作Cookie完成客户端交互,然后使用WCF完成服务器交互。 新闻页跳转 关于vs2005调用jquery 运行后台。 asp.net中怎么用移动控件做列表 sql语句,怎样判断一个字段中是否存在某一个值 html控件radio 怎么样调用UpdatePanel的更新方法呢?? 怎么给DataTable添加合计行 请教一个ASP的问题,很简单,初学,大家帮帮我. 方案征集:音视频存储和播放下载网站方案:)可以合作,可以购买技术! 今天必须解决,urlEncode编码问题 ASP.NET中有无通讯方面的控件? 新球求教 关于GridView Command事件的一个问题 在网页中使用OCX
string name;
string country;
.......
string[] void getRelationShip();
........
}
string name;
string country;
.......
ArrayList getRelationShip();
........
}publi class ChenHu: IPerson{
string name;
string country;
ArrayList friends=new ArrayList();
.......
ArrayList getRelationShip()
{
return friends;
}
void setRelationShip(IPerson p)
{
this.friends.add(p)
}
........}
public interface IKeyBehavior
{
string name; //关键字名称
List<IKeyRelation> relats; //有关系的关键字集合
}
public interface IKeyRelation
{
string name; //关系名称
IKeyBehavior object; //有关系的关键字
}