什么是“Facet”?在JavaEE中?
我不仅想知道什么是 Facet,还想知道“在物理层面”什么是 Facet(据我所知,它不是一个单独的罐子,但是什么?)?
我还想知道部署后它对我的应用程序有何影响。我将用真实的例子来解释:
我有 2 个 Facet(由 IDE 创建):Spring Facet 和 Web Facet(用于 jsf)。我将其部署到 Tomcat 并且我的应用程序运行良好。
然后我(通过 IDE)又添加了一个方面 - JPA Facet。我重新部署了应用程序并且......它仍然工作正常:)
所以,我只是好奇那是什么以及为什么我们需要它?
I wonder not only what is Facet but also what is Facet 'in physical level' (as I understand it's not a separate jar, but what?)?
I also wonder how can it affect my application after deploying. I'll explain on real example:
I had 2 facets (which were created by IDE): Spring Facet and Web Facet (for jsf). I deployed it to Tomcat and my application worked fine.
Then I added (by means of IDE) one more facet - JPA Facet. I redeployed application and.. it still worked fine :)
So, I'm just curious what is that and why do we need it?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
这与 Java EE 无关。这是IDE相关的。该术语本身与编程无关。
来自 http://www.thefreedictionary.com/facet
它是 4。
在这种特定情况下,它只是项目中要使用的一个方面,以便 IDE 可以拦截它的有关生成器、向导、自动包含库等的内容。例如,如果您添加 JPA 方面,那么您将获得更多选择JPA 的 IDE 魔法。
This is not Java EE related. This is IDE related. The term is at its own not programming related.
From http://www.thefreedictionary.com/facet
It's 4.
In this specific case it's just an aspect which is to be used in the project, so that the IDE can intercept on it with regard to generators, wizards, auto-include libraries and so on. If you add for example the JPA facet, then you will get more options to do the IDE-magic with JPA.
正如 BalusC 所说,这与 Java EE 无关,而是与 IDE 相关。这允许以灵活的方式向项目添加“特性”。
来自 面向 Eclipse 用户的 IntelliJ IDEA 问答(因为您提到了 IDEA):
是的,Eclipse 也使用“Facets”:
AFAIK,NetBeans 没有t (请参阅问:如何配置 Web 框架对于我的项目?)。
As BalusC said, this is not Java EE related but IDE related. This allows to add "characteristics" to a project in a flexible way.
From the IntelliJ IDEA Q&A for Eclipse Users (because you mentioned IDEA):
And yes, Eclipse uses "Facets" too:
AFAIK, NetBeans doesn't (see Q: How do I configure a web framework for my project?).
如 日食 & Intellij 文档,Facets 定义特性和要求(某些配置,特定于特定框架/技术)。
当您向项目添加构面时,该项目将被配置为执行特定任务、满足特定要求或具有特定特征。
简而言之,您必须遵循某些结构来实现某些框架/技术。 IDE 可以为您提供实施选项,让您的生活更轻松。
为了详细阐述它,我将直接从 Eclipse 文档中提供一些完整的详细信息。这是 Eclipse 特定的。
而 < strong>创建项目您将可以选择为您的项目实施facet。例如,EAR 方面通过添加部署描述符并设置项目的类路径来设置项目以充当企业应用程序。
要将另一个方面添加到已存在的项目,请完成以下步骤:
注意:仅列出对项目有效的方面。
某些方面可能无法协同工作。因此,您还可以 从预设列表中选择预设的构面组合。
Facets 在 Eclipse 中也有版本号。 只要不超出构面的要求,您就可以更改构面的版本号。
要更改项目中构面的版本,请完成以下步骤:
您可以使用切面做更多事情。为了让您更好地理解,我举了一些例子。有关详细信息,请参阅您喜欢的 IDE 的文档。
As explained in Eclipse & Intellij documentation, Facets define characteristics and requirements (certain configuration, specific for a particular framework/technology).
When you add a facet to a project, that project is configured to perform a certain task, fulfill certain requirements, or have certain characteristics.
In Brief You Have to Follow Some structure to Implement some framework/technology. IDEs have options to implement it for you to make your life easier.
To elaborate it in details I am giving some thorough details directly from Eclipse Documentations. This is Eclipse specific.
While creating a project you will get the option to implement facet for your project. For example, the EAR facet sets up a project to function as an enterprise application by adding a deployment descriptor and setting up the project's classpath.
To add another facet to a project that already exists, complete the following steps:
Note: Only the facets that are valid for the project are listed
Some facets may not work together. Thus, you can also choose a preset combination of facets from the Presets list.
Facets also have version numbers in Eclipse. You can change the version numbers of facets as long as you stay within the requirements for the facets.
To change the version of a facet in your project, complete the following steps:
You can do more things with the facets. I have given the examples for your better understanding. For details, please go through the documentation of your favorite IDE.
Facets 是一个 Web 应用程序框架,它在服务器端利用简单的 MVC 架构,在客户端利用功能丰富的 Javascript 组件模型。这两个部分旨在无缝集成,适用于非常动态的 AJAX 风格应用程序
Facets is a web application framework that leverages a simple MVC architecture for the server side and a feature-packed Javascript component model for the client. The two pieces are designed to be seemlessly integrated for very dynamic AJAX-style apps