惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

TaoSecurity Blog
TaoSecurity Blog
Jina AI
Jina AI
雷峰网
雷峰网
月光博客
月光博客
The GitHub Blog
The GitHub Blog
WordPress大学
WordPress大学
B
Blog RSS Feed
美团技术团队
C
CXSECURITY Database RSS Feed - CXSecurity.com
小众软件
小众软件
Security Latest
Security Latest
Microsoft Azure Blog
Microsoft Azure Blog
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
C
Cybersecurity and Infrastructure Security Agency CISA
Last Week in AI
Last Week in AI
A
Arctic Wolf
Latest news
Latest news
Attack and Defense Labs
Attack and Defense Labs
I
Intezer
F
Fortinet All Blogs
罗磊的独立博客
MongoDB | Blog
MongoDB | Blog
Webroot Blog
Webroot Blog
S
Secure Thoughts
Help Net Security
Help Net Security
Apple Machine Learning Research
Apple Machine Learning Research
博客园_首页
V
Visual Studio Blog
P
Proofpoint News Feed
博客园 - 【当耐特】
P
Privacy International News Feed
V
Vulnerabilities – Threatpost
Stack Overflow Blog
Stack Overflow Blog
Know Your Adversary
Know Your Adversary
云风的 BLOG
云风的 BLOG
Hacker News: Ask HN
Hacker News: Ask HN
L
LINUX DO - 最新话题
H
Help Net Security
爱范儿
爱范儿
酷 壳 – CoolShell
酷 壳 – CoolShell
S
SegmentFault 最新的问题
Forbes - Security
Forbes - Security
T
Tailwind CSS Blog
量子位
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
T
Tenable Blog
Cloudbric
Cloudbric
N
News and Events Feed by Topic
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
Hugging Face - Blog
Hugging Face - Blog

博客园 - Adrian H.

Hello in 2025 Hello World 为Silverlight控件添加鼠标滚轮支持 - Adrian H. - 博客园 LINQ表达式中关于显式范围变量的Bug jQuery太好使了 一次性下载.NET源码和pdb,并在VS2005中进行调试 Windows Server 2008: Server Core初体验 - Adrian H. C# Future Focus: 动态查找(Dynamic Lookup) Volta : Democratizing the Cloud, 1st CTP Released! Parallel Extensions for .NET 3.5 CTP! Silverlight 2.0, .NET类库源码, ASP.NET MVC... VS 2008与老版本插件的兼容性问题导致Crash Silverlight Tools for VS 2008 RTM [C# 3.0] 传递匿名类型对象的问题 Visual Studio 2008 RTM! 在 .NET Framework x (x < 3.5) 环境下运行带有扩展方法(Extension Method)的程序 使用ActionScript 3中的反射,实现单元测试TestRunner ASP.NET MVC Framework Announced .NET Framework 源代码将于今年发布
N-Tiers?
Adrian H. · 2007-10-02 · via 博客园 - Adrian H.

最近自己在写一个AJAX+WebService的个人Portal,设计的功能比较多但都很简单,无非是对N个表的CRUD操作,一些Join和一些存储过程。但写到WebService和JavaScript这块觉得有许多代码都是重复的,比如:
业务逻辑层有个AddUser方法:
UserAccess.AddUser,而这个方法实际是调用了一个更底层的DatabaseProxy.Insert<>。
然后是WebService里的方法,姑且可以把它认为是“用户接口层”,某个Service的class里又是几乎相同的方法:
UserService.AddUser,显然这个方法调用了UserAccess里的AddUser。
好,终于从Service side上浮到了浏览器里,又是JavaScript的编码,直接和用户接触的“表现层”:
function AddUser() { ....UserService.AddUser(....);... }
。。。
这些代码中除了业务逻辑层的必要的,其他的代码都是直接调用更底层的代码,一个方法往往就是2-3行,但如果继续这样写下去,数量却是很大的。于是我想可以用代码生成来生成Service和JavaScript的代码啊。。可生成代码。。。总让人觉得没有安全感。。我不想看到冗余的东西。
想到几个月前在Channel 9看的一段介绍“Codename Volta”的视频,Volta的目标似乎就是消灭这中在N层代码中的冗余:

From Web "Meijer doesn't envisage having to distribute a runtime engine such as .NET, the JVM (Java Virtual Machine) or Flash. Rather, he wants to use what is already available. Therefore he envisages .NET IL (intermediate language) binaries becoming a universally executable format. The runtime could be the CLR (Common Language Runtime), or the JVM, or the Flash player, or the browser. This would be transparent to the developer, because some intermediate piece would translate the .NET IL to JavaScript, or Java, or a Flash SWF. or somehing else." 

"You can write code that targets Silverlight, as an example, and if the target browser doesn’t support Silverlight, the code will be “converted” to a DHTML / CSS / Javascript implementation on the fly. In fact, that implementation can be tailored to the unique requirements of the browser, and functionality can be boosted or reduced depending on what that browser can handle."

原来Volta就是一个帮你生成那些客户端代码的东西,可惜它还没有一个preview版本提供试用。
觉得现在的软件开发还是有许多的不理想的地方,有许多的无用功,幸好已经有很多技术和工具已经在慢慢改变那些不足了。但愿10年后,Software Engineer已经完全是另外一个意义的工作,“代码工人”这个称呼将不复存在。。。

PS:发现Channel 9页面上的播放器改成Silverlight的了~,在我的Firefox上运行良好。~