YourKit Java Profiler |
JFacets /
ProfileRepositoryThe ProfileRepository is the cornerstone of JFacets. It's the base building block that allows the framework to know about the application's profiles graph. Encapsulating existing users/roles/groups/etc. modelsMany models, services, data structures etc. exist for managing concepts like users, roles, groups etc. They all have one common thing : you can abstract them by a graph. In JFacets, profiles are linked together through parent/child relations, which makes the whole thing a graph. The framework istelf relies on that graph in order to navigate into it and retrieve facets assigned to nodes (profiles). JFacets only specifies the profiles management system (see the Basically, a profile (a node in the graph) has to be identifiable (unique ID), and is represented by an object implementing the
This is the simple contract that you have to fulfill in order to get JFacets working with your own system, whatever it can be. Injection of your ProfileRepository into JFacets is done using the Spring context. Some examplesLet's think about a few examples to make it more clear. First, a Operating System users/groups management (with groups) : ![]() Now another profiles structure which reflects a company's organisation : ![]() As you can see, in this organisation we've got composite "departments" as well as multiple inheritance for the employee Ma Baker who is in both Sales and Human Resources departments. Of course, these two examples are not exhaustive, and you can virtually model any kind of profiles management systems with this multiple inheritance model. This concept has been implemented in several applications, all backed by their own proprietary user management API, and it always revealed natural and convenient. Getting up and ready quicker : the SimpleProfileRepositoryJFacets includes the SimpleProfileRepository which allows to quickly create a representation of what the graph will look like with almost no coding. This can be helpful when starting a new project, or for evaluating JFacets. Regular Users/Roles modelJFacets provides a less "abstract" path for implementing the Profile Repository, in case your system deals with users and roles. The
As you can see, the graph sructure is still there, but with more self-explanatory concepts. Your implementation of the <!-- Profile Repo for users/roles systems (don't change this one) --> <bean id="profileRepository" singleton="true" class="net.sourceforge.jfacets.usersandroles.UsersAndRolesProfileRepository"> <property name="usersAndRolesManager"><ref bean="usersAndRoles"/></property> </bean> <!-- users/roles datasource : to be configured --> <bean id="usersAndRoles" singleton="true" class="com.xyz.myapp.UsersAndRolesImpl"> <!-- additional config of your bean goes here --> </bean> |