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?
A Facet is an Eclipse WebTools Project concept which essentially means a capability attached to an Eclipse project.
Facets are software components which implement a single functionality, have a single publicly callable interface and have no residual state. A functionality can be considered a single well-defined task in an application.
For developing framework-specific applications, IntelliJ IDEA features facets. Facets contain libraries, dependencies, and technologies, and they provide you with additional UI elements for configuring framework-specific settings. Note that not all facets are available out of the box.
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
fac·et (fst) n.
- One of the flat polished surfaces cut on a gemstone or occurring naturally on a crystal.
- Anatomy A small, smooth, flat surface, as on a bone or tooth.
- Biology One of the lenslike visual units of a compound eye, as of an insect.
- One of numerous aspects, as of a subject. See Synonyms at phase.
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.
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):
Q: Facets — what they are for?
A: To streamline the project configuration.
Facets encapsulate the support for a variety of frameworks, technologies and languages. For example, to enable Spring in your project, you only have to add the corresponding facet. All libraries are downloaded and configured, you get the full range of coding assistance, refactorings, etc. Moreover, the code model is also recognized, so you are completely free from worrying about any configuration issues.
In most cases, you can add more than one facet of the same type to your project. For example, you can have multiple Web facets for deploying the application to different servers, or several EJB facets, each for its own EJB version. (See also Project Configuration.)
And yes, Eclipse uses "Facets" too:
AFAIK, NetBeans doesn't (see Q: How do I configure a web framework for my project?).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With