Just to cite an example: for .NET apps there are the CAB (Composite Application Block) and the Composite Application Guidance for WPF. Both are mainly implementations of a set of several design patterns focused on modularity and loose coupling between components similar to a plug-in architecture: you have an IOC framework, MVC base classes, a loosely coupled event broker, dynamic loading of modules and other stuff.
So I suppose that kind of pattern infrastructure is what you are trying to find, just not specifically for .NET. But if you see the CAB as a set of pattern implementations, you can see that almost every language and platform has some form of already built-in or third party frameworks for individual patterns.
So my take would be:
Study (if you are not familiar with) some of those design patterns. You could take as an example the CAB framework for WPF documentation: Patterns in the Composite Application Library
Design your architecture thinking on which of those patterns you think would be useful for what you want to achieve first without thinking in specific pattern implementations or products.
Once you have your 'architectural requirements' defined more specifically, look for individual frameworks that help accomplish each one of those patterns/features for the language you decide to use and put together your own application framework based on them.
I agree that the hard part is to make all this platform independent. I really cannot think on any other solution to choose a mature platform independent language like Java.
Everyone around here seems to think that Mono is great, but I still do not think it is ready for industry use, I would equate mono to where wine is, great idea; when it works it works well, and when it doesn't...well your out of luck. mod_mono for Apache is extremely glitchy and is hard to get running correctly.
You can build window, linux, mac all under the same code and all UI components are native to the OS. And RCP wins in modularity hands down, it has a plug-in architecture that is unrivaled (from what I have seen)
I have worked with RCP for 1.5 years now and I dunno what else could replace it, it is #1 in it's niche.
If your totally opposed to java I would look into wxWidgets with either python or C++
If you want platform independence, then you'll have to trade off between performance and development effort. C++ may be faster than Java (this is debatable FWIW) but you'll get platform independence a lot more easily with Java. Python and Ruby are in the same boat.
I doubt that .NET would be much faster than Java (they're both VM languages after all), but the big problem with .NET is platform independence. Mono has a noble goal and surprisingly good results so far but it will always be playing catch-up with Microsoft on Windows. You might be able to accept its limitations but it's still not the same as having identical multiplatform environments that Java, Python, and Ruby have. Also: the .NET development and support tools are heavily skewed towards Windows, and probably always will be.
IMO, your best bet is to target Java... or, at the very least, the JVM. If you don't like the Java language (and as a C# dev I'm guessing that's not the case) then you at least have options like Jython, JRuby, and Scala. With the JVM, you get very good platform independence, good performance, and access to a huge number of libraries and support tools. There's almost always a Java library, port or implementation that will do what you need it to do. I don't think any other platform out there has the same number of options; there's real value in that flexibility.
As for modularity: that's more about how you build the software than what platform you use. I don't know much about plugin architectures like you describe but I'm guessing that it will be possible in pretty much any modern platform you pick.
例如,OS X 可能是最不同的 - 首选项通常以 .plist 形式存储在 ~/Library/Prefernces/ 中,UI 是通常基于浮动窗口,单个菜单栏停靠在屏幕顶部。
我想这就是模块化发挥作用的地方。通过上面的首选项示例,您可以拥有一个类 UserConfig,其中您有特定于操作系统的版本。 Windows 将配置数据存储在适当的 Application Data 文件夹或注册表中。 Mac OS 使用 ~/Library/Preferences/ 上的 .plist 文件,unix'y 使用 ~/.dotfiles。
For desktop applications, writing it in an interpreted language, and using a cross-platform UI toolkit like wxWidgets will get you a long way towards platform independence (you just have to be careful not to use any other modules that aren't cross-platform, use things like Python's os.path module, in place of doing things like config_path = "/home/$USER")
That said, to make a good cross-platform application, you will have to do some things differently on each platform..
For example, OS X is probably the most different - preferences are usually stored in ~/Library/Prefernces/ as .plists, UI's are generally based around floating windows, with a single menu-bar docked at the top-of-screen.
I suppose this is where the modularity comes into play.. With the preferences example above, you could have a class UserConfig, of which you have OS-specific versions of. The Windows one stores config data in the appropriate Application Data folder, or the registry. The Mac OS one uses .plist files on ~/Library/Preferences/, and the unix'y one uses ~/.dotfiles.
With my limited Mono experience I can say I'm quite sold on it. The fact that there is active development and a lot of ongoing effort to bring it up to spec with the latest .Net technologies is encouraging. It is incredibly useful to be able to use existing .Net skills on multiple platforms. I had similar issues with performance when attempting to accomplish some basic tasks in Python + PyGTK -- maybe they can be made to perform in the right hands but it is nice to not have to worry about performance 90% of the time.
发布评论
评论(6)
仅举一个例子:对于 .NET 应用程序,有 CAB(复合应用程序块)和 WPF 复合应用程序指南。 两者主要是一组几种设计模式的实现,这些设计模式侧重于类似于插件架构的组件之间的模块化和松散耦合:您有一个 IOC 框架、MVC 基类、松散耦合的事件代理、模块的动态加载和其他东西。
所以我认为这种模式基础设施就是您想要找到的,但不是专门针对 .NET 的。 但是,如果您将 CAB 视为一组模式实现,您会发现几乎每种语言和平台都具有某种形式的针对各个模式的内置框架或第三方框架。
所以我的看法是:
我同意困难的部分是使所有这些平台独立。 我真的想不出任何其他解决方案来选择像 Java 这样成熟的平台独立语言。
Just to cite an example: for .NET apps there are the CAB (Composite Application Block) and the Composite Application Guidance for WPF. Both are mainly implementations of a set of several design patterns focused on modularity and loose coupling between components similar to a plug-in architecture: you have an IOC framework, MVC base classes, a loosely coupled event broker, dynamic loading of modules and other stuff.
So I suppose that kind of pattern infrastructure is what you are trying to find, just not specifically for .NET. But if you see the CAB as a set of pattern implementations, you can see that almost every language and platform has some form of already built-in or third party frameworks for individual patterns.
So my take would be:
I agree that the hard part is to make all this platform independent. I really cannot think on any other solution to choose a mature platform independent language like Java.
您正在计划桌面应用程序还是网络应用程序?
这里的每个人似乎都认为 Mono 很棒,但我仍然不认为它已经准备好用于工业用途,我将 Mono 等同于葡萄酒,好主意; 当它工作时,它工作得很好,而当它不工作时......那么你就不走运了。 Apache 的 mod_mono 非常容易出问题,并且很难正确运行。
如果您的目标是桌面,那么没有什么比 eclipse RCP(富客户端平台)框架更好的了: http:// /wiki.eclipse.org/index.php/Rich_Client_Platform。
您可以在相同的代码下构建 window、linux、mac,并且所有 UI 组件都是操作系统本机的。 RCP 在模块化方面轻而易举地获胜,它具有无与伦比的插件架构(据我所知)
我已经使用 RCP 1.5 年了,我不知道还有什么可以取代它,它是它的利基市场中的第一名。
如果你完全反对 java 我会用 python 或 C++ 来研究 wxWidgets
Are you planning a desktop or web application?
Everyone around here seems to think that Mono is great, but I still do not think it is ready for industry use, I would equate mono to where wine is, great idea; when it works it works well, and when it doesn't...well your out of luck. mod_mono for Apache is extremely glitchy and is hard to get running correctly.
If your aiming for the desktop, nothing beats the eclipse RCP (Rich Client Platform) framework: http://wiki.eclipse.org/index.php/Rich_Client_Platform.
You can build window, linux, mac all under the same code and all UI components are native to the OS. And RCP wins in modularity hands down, it has a plug-in architecture that is unrivaled (from what I have seen)
I have worked with RCP for 1.5 years now and I dunno what else could replace it, it is #1 in it's niche.
If your totally opposed to java I would look into wxWidgets with either python or C++
如果您想要平台独立性,那么您必须在性能和开发工作之间进行权衡。 C++ 可能比 Java 更快(这是有争议的 FWIW),但使用 Java 可以更轻松地获得平台独立性。 Python 和 Ruby 处于同一条船上。
我怀疑 .NET 是否会比 Java 快得多(毕竟它们都是 VM 语言),但 .NET 的大问题是平台独立性。 Mono 有着崇高的目标,并且迄今为止取得了令人惊讶的好成绩,但它在 Windows 上将永远追赶 Microsoft。 您也许能够接受它的局限性,但它仍然与 Java、Python 和 Ruby 拥有相同的多平台环境不同。 另外:.NET 开发和支持工具严重偏向 Windows,而且可能永远如此。
IMO,你最好的选择是针对 Java……或者至少是 JVM。 如果您不喜欢 Java 语言(作为一名 C# 开发人员,我猜情况并非如此),那么您至少可以选择 Jython、JRuby 和 Scala。 使用 JVM,您可以获得非常好的平台独立性、良好的性能以及对大量库和支持工具的访问。 几乎总有一个 Java 库、端口或实现可以满足您的需要。 我认为没有任何其他平台具有相同数量的选项; 这种灵活性具有真正的价值。
至于模块化:更多的是关于如何构建软件而不是使用什么平台。 我对您所描述的插件架构了解不多,但我猜测它在您选择的几乎任何现代平台上都是可能的。
If you want platform independence, then you'll have to trade off between performance and development effort. C++ may be faster than Java (this is debatable FWIW) but you'll get platform independence a lot more easily with Java. Python and Ruby are in the same boat.
I doubt that .NET would be much faster than Java (they're both VM languages after all), but the big problem with .NET is platform independence. Mono has a noble goal and surprisingly good results so far but it will always be playing catch-up with Microsoft on Windows. You might be able to accept its limitations but it's still not the same as having identical multiplatform environments that Java, Python, and Ruby have. Also: the .NET development and support tools are heavily skewed towards Windows, and probably always will be.
IMO, your best bet is to target Java... or, at the very least, the JVM. If you don't like the Java language (and as a C# dev I'm guessing that's not the case) then you at least have options like Jython, JRuby, and Scala. With the JVM, you get very good platform independence, good performance, and access to a huge number of libraries and support tools. There's almost always a Java library, port or implementation that will do what you need it to do. I don't think any other platform out there has the same number of options; there's real value in that flexibility.
As for modularity: that's more about how you build the software than what platform you use. I don't know much about plugin architectures like you describe but I'm guessing that it will be possible in pretty much any modern platform you pick.
对于桌面应用程序,用解释性语言编写它,并使用像 wxWidgets 这样的跨平台 UI 工具包将使您在实现平台独立性方面走得更远(您只需小心不要使用任何其他不跨平台的模块) ,使用 Python 的
os.path
模块之类的东西,而不是像config_path = "/home/$USER"
那样的东西) 跨平台应用程序,您必须在每个平台上做一些不同的事情。
例如,OS X 可能是最不同的 - 首选项通常以 .plist 形式存储在 ~/Library/Prefernces/ 中,UI 是通常基于浮动窗口,单个菜单栏停靠在屏幕顶部。
我想这就是模块化发挥作用的地方。通过上面的首选项示例,您可以拥有一个类
UserConfig
,其中您有特定于操作系统的版本。 Windows 将配置数据存储在适当的Application Data
文件夹或注册表中。 Mac OS 使用~/Library/Preferences/
上的 .plist 文件,unix'y 使用 ~/.dotfiles。For desktop applications, writing it in an interpreted language, and using a cross-platform UI toolkit like wxWidgets will get you a long way towards platform independence (you just have to be careful not to use any other modules that aren't cross-platform, use things like Python's
os.path
module, in place of doing things likeconfig_path = "/home/$USER"
)That said, to make a good cross-platform application, you will have to do some things differently on each platform..
For example, OS X is probably the most different - preferences are usually stored in ~/Library/Prefernces/ as .plists, UI's are generally based around floating windows, with a single menu-bar docked at the top-of-screen.
I suppose this is where the modularity comes into play.. With the preferences example above, you could have a class
UserConfig
, of which you have OS-specific versions of. The Windows one stores config data in the appropriateApplication Data
folder, or the registry. The Mac OS one uses .plist files on~/Library/Preferences/
, and the unix'y one uses ~/.dotfiles.以我有限的 Mono 经验,我可以说我非常喜欢它。 事实上,我们正在积极开发并付出大量努力使其符合最新 .Net 技术的规范,这一事实令人鼓舞。 能够在多个平台上使用现有的 .Net 技能非常有用。 当我尝试用 Python + PyGTK 完成一些基本任务时,我也遇到了类似的性能问题——也许它们可以在正确的人手中执行,但很高兴 90% 的时间都不必担心性能。
With my limited Mono experience I can say I'm quite sold on it. The fact that there is active development and a lot of ongoing effort to bring it up to spec with the latest .Net technologies is encouraging. It is incredibly useful to be able to use existing .Net skills on multiple platforms. I had similar issues with performance when attempting to accomplish some basic tasks in Python + PyGTK -- maybe they can be made to perform in the right hands but it is nice to not have to worry about performance 90% of the time.
如果你打算进行 python 开发,你可以随时使用 pyrex 优化一些较慢的部分。
If you plan on doing python development, you can always use pyrex to optimize some of the slower parts.