Spring.net抛砖引玉系列(二)用接口来实现HelloWorld
2008-11-11 23:31
549 查看
今天太晚了,费话少说,直接上源码
namespace HelloWorld
<?xml version="1.0" encoding="utf-8" ?>
<objects xmlns="http://www.springframework.net">
<object id="hello1" type="HelloWorld.Hello">
</object>
<object id="hello2" type="HelloWorld.你好">
</object>
</objects>
Hello.cs:实现IHello接口的一个类,这个类用英语将Helloworld显示到控制台。
namespace HelloWorld
你好.cs:实现IHello接口的一个类,这个类用中文将Helloworld显示到控制台。
namespace HelloWorld
Program.cs:主程序,在控制台上分别用英语和中文显示Helloworld。
using Spring.Context;
using Spring.Context.Support;
namespace HelloWorld
OK!让我们运行看看结果:
怎么样,简单吧!好的,别急,最后按例放上源码:
演示Spring.net用接口来实现HelloWorld的实例
namespace HelloWorld
<?xml version="1.0" encoding="utf-8" ?>
<objects xmlns="http://www.springframework.net">
<object id="hello1" type="HelloWorld.Hello">
</object>
<object id="hello2" type="HelloWorld.你好">
</object>
</objects>
Hello.cs:实现IHello接口的一个类,这个类用英语将Helloworld显示到控制台。
namespace HelloWorld
你好.cs:实现IHello接口的一个类,这个类用中文将Helloworld显示到控制台。
namespace HelloWorld
Program.cs:主程序,在控制台上分别用英语和中文显示Helloworld。
using Spring.Context;
using Spring.Context.Support;
namespace HelloWorld
OK!让我们运行看看结果:
怎么样,简单吧!好的,别急,最后按例放上源码:
演示Spring.net用接口来实现HelloWorld的实例
相关文章推荐
- Spring.net抛砖引玉系列(一)下载安装及HelloWorld
- 搭建你的Spring.Net+Nhibernate+Asp.Net Mvc 框架 (三)实现数据库接口层和业务逻辑层(转)
- 搭建你的Spring.Net+Nhibernate+Asp.Net Mvc 框架 (三)实现数据库接口层和业务逻辑层(转)
- springcloud入门系列(2)-Feign、Ribbon实现Rest接口请求和负载均衡
- springcloud入门系列(2)-Feign、Ribbon实现Rest接口请求和负载均衡
- Spring.Net学习系列 - 第一篇HelloWorld
- 搭建你的Spring.Net+Nhibernate+Asp.Net Mvc 框架 (三)实现数据库接口层和业务逻辑层
- 【Spring Boot && Spring Cloud系列】构建Springboot项目 实现restful风格接口
- 搭建你的Spring.Net+Nhibernate+Asp.Net Mvc 框架 (三)实现数据库接口层和业务逻辑层
- .net core系列之《.net core中使用集成IDistributedCache接口的Redis和MongoDB实现分布式缓存》
- Spring.Net学习系列一: 统一异常处理
- Spring boot 实现json和jsonp格式数据,接口共用
- Spring.net整合Lucene.net 实现全文检索(附例程)转载
- ASP.NET 2.0 中实现模板中的数据绑定系列(2)
- Spring Boot系列(十二)Spring Boot整合ActiveQ实现消息收发和订阅
- ASP.NET 2.0 中实现模板中的数据绑定系列
- 支付宝Payto接口的c#.net实现
- Redis总结(五)缓存雪崩和缓存穿透等问题 Web API系列(三)统一异常处理 C#总结(一)AutoResetEvent的使用介绍(用AutoResetEvent实现同步) C#总结(二)事件Event 介绍总结 C#总结(三)DataGridView增加全选列 Web API系列(二)接口安全和参数校验 RabbitMQ学习系列(六): RabbitMQ 高可用集群
- Spring系列(四):Spring AOP详解和实现方式(xml配置和注解配置)