简体   繁体   English

BeansBinding,JGoodies Binding,JFace还是釉面列表?

[英]BeansBinding, JGoodies Binding, JFace, or Glazed Lists?

I started to investigate beans binding and my head is starting to spin. 我开始研究豆子的结合力 ,我的头开始旋转。 There are so many options, but it's a central design decision that sounds hard to change. 有很多选择,但这是一个中央设计决策,听起来很难更改。 I have a set of interrelated POJOs that I want to edit with a GUI. 我有一组要使用GUI编辑的相互关联的POJO。 What is my best option for a stable, simple deployment? 对于稳定,简单的部署,我最好的选择是什么? If there's not one good solution, do these options play nice together? 如果没有一个好的解决方案,那么这些选项能否很好地配合使用?

Here are the current contenders: 以下是目前的竞争者:

Please share your experiences with these libraries. 请与这些库分享您的经验。 Especially if you tried one and switched to another. 特别是如果您尝试了一个然后又切换到另一个。

I've used all of the above except JFace. 除了JFace,我已经使用了所有上述内容。 Started with JGoodies, and found it to be a bit tough to use. 从JGoodies开始,发现它很难使用。 BeansBinding was easier to understand, but it's support for list operations is pretty poor. BeansBinding更容易理解,但是它对列表操作的支持却很差。 Enter Glazed Lists. 输入釉面列表。 GL is one of the best open source libraries I've ever used. GL是我使用过的最好的开源库之一。 Recently, they added a PluggableList implementation that allows GlazedLists lists to be bound to list properties from POJOs using BeansBinding. 最近,他们添加了一个PluggableList实现,该实现允许使用BeansBinding将GlazedLists列表绑定到POJO中的列表属性。 The result is the best of both worlds. 结果是两全其美。

We also frequently use the Calculations API (part of Glazed Lists) to compute list-wide properties, and bind the results (using BB) to POJOs, GUI widgets, etc... Adding a label that shows the number of elements in a list (or any other calculation) is crazy simple. 我们还经常使用Calculations API(釉面列表的一部分)来计算整个列表的属性,并将结果(使用BB)绑定到POJO,GUI小部件等。...添加标签以显示列表中元素的数量(或其他任何计算方法)非常简单。

I will say that BB has a lot of room for improvement, and indeed, it has been forked to BetterBeansBinding - I'd recommend that you work with BBB moving forward if you can. 我会说BB有很多改进的空间,并且确实,它已经改用BetterBeansBinding-如果可以的话,我建议您与BBB合作。

We have several applications using the combination of BB and GL (one of which is a very large, complex GUI app), and have been delighted with the results. 我们有几个结合使用BB和GL的应用程序(其中一个是非常大的,复杂的GUI应用程序),并且对结果感到满意。

I do suggest that you take the time to play around with bindings before you really start using it. 我确实建议您在真正开始使用绑定之前先花些时间尝试一下绑定。 Shifting to a declarative programming style takes some practice, but once you've done it, the results are nearly miraculous. 转换为声明式编程风格需要一些实践,但是一旦完成,结果几乎是奇迹。 I suggest a minimum of 3 small, but complete projects so you can get your head around it (if you can introduce Presentation Model concepts into your design, that will also have huge payback down the road). 我建议至少有3个小型但完整的项目,这样您才能着手解决(如果您可以将Presentation Model概念引入设计中,那么这也将带来巨大的回报)。

We use the JGoodies Binding framework and it's pretty good. 我们使用JGoodies Binding框架,它非常好。 That's mainly with simple properties though - if you want to do anything more complex you do have to write a bit of glue code. 不过,这主要是具有简单的属性-如果您想做更复杂的事情,则必须编写一些粘合代码。 Not sure how whether other frameworks would do that better. 不知道其他框架是否会做得更好。

It doesn't support things like nested properties though, I've heard that the binding in the Spring RCP project is better. 尽管它不支持嵌套属性,但我听说Spring RCP项目中的绑定更好。 I'd suggest investigating that first over JGoodies. 我建议先对JGoodies进行调查。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM