编程与软件工程martinfowler.com编辑精选
GUI 架构(2006)
GUI Architectures (2006)
2012 — 2017,它一次次回到首页
黑点是上首页(≥ 50 分)的那次投稿,空心点是没冲上去的投稿,点越大分数越高。
导读
Martin Fowler 在这篇 2006 年的文章中梳理 GUI 架构的几种经典模式,从 MVC 出发讨论视图与模型如何分离、控制器或呈现器承担什么职责,以及 MVP、Presentation Model 等变体。文章关注的是界面代码的组织方式,而不是某个具体框架。
为什么经久不衰:它提供了理解今天前端 MV* 框架与命名争论的模式谱系,许多职责划分问题仍可回溯到这篇经典梳理。
HN 评论精选
文章因年代未覆盖 FRP,评论者看好 FRP 带来客户端开发变革。
一开始我很惊讶文中没有提到函数式响应式编程(FRP)。不过这篇文章写于 2006 年,当时还没有快速、强大且实用的 FRP 框架。我猜测未来几年客户端开发会出现某种革命——复杂度大幅降低,程序员生产力大幅提升。
kmicklas查看英文原文
At first I was amazed there is no mention of Functional Reactive Programming. Then again this is from 2006 when there were no fast, powerful, and practical FRP frameworks. I suspect we will see somewhat of a revolution in terms of client side development in the coming years - with a vast reduction in complexity and huge increase of programmer productivity.
用 Web 比喻重新解读原始 MVC 中模型、视图与控制器的角色分工。
当你读 Trygve Reenskaug 1979 年的原始论文《MODELS - VIEWS - CONTROLLERS》——它很短、简单、清晰——就能明白他的意思:模型像 Web 服务器,视图像浏览器,控制器像 Windows 开始菜单。他字面写道:视图(=浏览器)附着于模型(=服务器),通过提问(=提交查询)从模型获取展示所需数据;它也可通过发送适当消息更新模型(=提交)。控制器(=开始菜单)通过安排相关视图(=窗口)在屏幕适当位置呈现,为用户提供输入(=菜单项)。
narribbi查看英文原文
When you read Trygve Reenskaug's original 1979 paper "MODELS - VIEWS - CONTROLLERS" -- it is very short, simple, and crystal-clear -- (http://heim.ifi.uio.no/~trygver/1979/mvc-2/1979-12-MVC.pdf), it obvious what Trygve meant: * The MODEL is something like a web server * The VIEW is something like a browser * The CONTROLLER is something like the Windows start menu Trygve literally writes: "A view (=browser) is attached to its model (=server) and gets the data necessary for the presentation from the model by asking questions (=submitting queries). It may also update the model (=posting) by sending appropriate messages. A controller (=start menu) provides the user with input (=menu items) by arranging for relevant views (=windows) to present themselves in appropriate places on the screen."
设想 WebAssembly 让传统 GUI 应用以类似 X Window 的方式跑在浏览器里。
有了 WebAssembly,我们应该能编译用 Qt/GTK/SDL 编写的应用,用 JavaScript 把它们的 GUI 渲染到 canvas,并把鼠标事件回传给应用;HTML 则只作为布局引擎来放置这些应用,类似 X Window。
jlebrech查看英文原文
with WebAssembly we should be able to compile applications written in qt/gtk/sdl and use javascript to render their gui to a canvas and send the mouse events back the the apps, and html will just be a layout engine that places those apps, similar to xwindows.
质疑模式命名正确性是否重要,框架常重新诠释 MV*。
把这件事“做错”的真正代价是什么?例如 Backbone.js 遵循 MVP 模式,更具体地说是被动视图变体。问题在于 Backbone.js 把 Presenter 叫作 View,把 View 叫作 Template。我们应该在此鼓励“正确性”,还是接受每个新的 MV* 框架都重新诠释这些模式?
camwest查看英文原文
What is the real cost of getting this "wrong"? For example: Backbone.js is following the MVP pattern, more specifically the passive view variant. The catch is that Backbone.js calls Presenters Views and Views Templates. Should we be encouraging "correctness" here or is it ok that every new MV* framework reinterprets these patterns?
历次讨论
同类还值得读
开源应用架构
The Architecture of Open Source Applications
《开源软件架构》(AOSA)是一本在线免费书,邀请知名开源项目的作者亲自剖析其内部设计,涵盖 SQLAlchemy、LLVM、Audacity、Apache、Bash 等系统。
编程与软件工程上首页 9 次 · 2011–2024aosabook.org编辑精选编程语言简史:简短、不完整且多半错误
A Brief, Incomplete, and Mostly Wrong History of Programming Languages
一篇以戏谑、故意不准确的方式回顾编程语言史的博客文章,用夸张轶事和讽刺定义串起 Lisp、C、C++、Java、JavaScript、PHP 等语言。
编程与软件工程上首页 8 次 · 2009–2021james-iry.blogspot.comSQLite 是如何测试的
How SQLite is tested
SQLite 官方文档页,系统介绍 SQLite 的测试体系:多种测试方法(TCL 测试、模糊测试、回归测试、静态分析等)和海量测试用例,展示了这个小型开源项目如何靠极致测试获得…
编程与软件工程上首页 8 次 · 2009–2025sqlite.org编辑精选高级编程语言(2009)
Advanced programming languages (2009)
Matt Might 的经典文章,按用途推荐“高级编程语言”:如果追求就业就选主流语言,如果追求表达力、学术研究或创业,则推荐 Haskell、OCaml、Scala 等函数式语…
编程与软件工程上首页 8 次 · 2009–2022matt.might.net我的 Forth 与栈机器经历
Yosefk - My history with Forth & stack machines
作者以亲身经历回顾了使用 Forth 语言和栈式机器的历程:既赞叹其简洁优雅、代码量小、可自举的优点,也坦率指出栈操作在实际编程中的痛苦,以及 Forth 社区文化中的问题。
编程与软件工程上首页 8 次 · 2010–2024yosefk.com编辑精选