从哪里开始了解 Seaside 内部结构?
我最近非常迷恋 Seaside Web 框架。我想开始深入研究源代码以弄清楚它是如何工作的。不幸的是,课程太多,我不知道从哪里开始!有谁知道我应该首先尝试理解哪些课程?我认为我应该从某个地方开始使用路由类......
I've become pretty enamored of the Seaside web framework lately. I'd like to start digging into the source to figure out how it works. Unfortunately, there are a lot of classes and I don't know where to start! Does anyone know what classes I should try to understand first? I assume that there's a routing class somewhere that I should start with...
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
斯蒂芬给出了很好的建议。基本上,如果您了解 Seaside 3.x 中的 Seaside-Core 包,您就会了解所有内容是如何组合在一起的:
有两种方法可以研究该框架。要么从您感兴趣的特定事物之一(例如 WAComponent)开始,然后逐步向上到超类。然后对斯蒂芬提到的其他每个课程重复一遍。
我建议采用另一种方式:从我在 Session-Core 中提到的三组抽象类开始。一起查看它们(与 HTTP 和 Document 类结合)将使您了解通用概念以及它们如何组合在一起形成框架。您可以根据需要查看每个具体实现,以将通用概念与实际实现联系起来。
WAServerAdaptor 的子类构成了 Seaside 中请求处理的起点,其中来自特定 Web 框架的请求被转换为 Seaside 请求并分派到适当的处理程序。回调也非常重要,位于 Seaside-Core-Callbacks 中。
如果您了解 Seaside-Core 中的所有内容,那么您基本上就了解了该框架在高层次上的工作原理。一旦您对基本核心概念有了广泛的了解,您就可以通过更详细地检查具体实现来深入了解您感兴趣的每个领域。但请记住,Seaside-Core 中的所有内容都旨在成为子类并插入在一起以扩展框架。
Stephan gives good suggestions. Basically, if you understand the Seaside-Core package in Seaside 3.x, you understand how everything fits together:
There are really two ways of approaching studying the framework. Either start with one of the specific things you are interested in (say WAComponent) and work your way up the superclasses. Then repeat with each of the other classes Stephan mentions.
I'd suggest the other way: starting with the three sets of abstract classes I mentioned in Session-Core. Looking at them together (combined with the HTTP and Document classes) will give you an idea of the generic concepts and how they plug together to form the framework. You can look at each of the specific implementations as needed to relate the generic concepts to the actual implementation.
Subclasses of WAServerAdaptor form the starting point of request handling in Seaside, where a request from a specific web framework is converted into a Seaside request and dispatched to an appropriate handler. Callbacks are also pretty important and are in Seaside-Core-Callbacks.
If you understand everything in Seaside-Core, you basically understand how the framework works at a high level. Once you have a broad understanding of the basic core concepts, you can then proceed to get a deep understanding of each area that interests you by examining the concrete implementations in more detail. But keep in mind that everything in Seaside-Core is intended to be subclasses and plugged together to extend the framework.
我想你已经读过《海边的书》了?:
如果您想深入了解,只需查看源代码,从类 WAComponent 和 WARenderCanvas+WAHtmlCanvas 开始。路由类是 WAAdmin,意思是“这是注册不同 Seaside 应用程序的地方”。
I assume you have read the Seaside-Book?:
If you want to go deeper just look at the source, starting with the classes WAComponent and WARenderCanvas+WAHtmlCanvas. The routing class is WAAdmin in the sense as "this is the place where different Seaside-apps are registered".
有几个部分很有趣。从
WARenderCanvas
开始了解html生成dsl是如何构建的。WAComponent
是包含call:
和answer:
的复合页面结构的起点。WAApplication
表示 Seaside 应用程序,WASession
表示会话,WAServerAdapter
将 Seaside 框架连接到 http 服务器,WARequestHandler
句柄http 请求。Grease
包处理 Smalltalk 方言之间的差异。您正在使用不同的浏览器(类和层次结构)、类注释、发送者和实现者,不是吗?
There are several parts that are interesting. Start from
WARenderCanvas
to understand how the html generating dsl is build.WAComponent
is the starting point for the composite page structure withcall:
andanswer:
.WAApplication
represents a Seaside application,WASession
a session,WAServerAdapter
connects the Seaside framework to a http server andWARequestHandler
handles http requests. TheGrease
package handles differences between Smalltalk dialects.You are using the different browsers (class and hierarchy), class commments and senders and implementors, aren't you?