Individual usersGroupsProject rolesIssue roles such as 'Reporter', 'Project Lead' and 'Current Assignee''Anyone' (e.g. to allow anonymous access)A (multi-)user picker custom field.A (multi-)group picker custom field. This can either be an actual group picker custom field, or a (multi-)select-list whose values are group names.
Many other permissions are dependent on this permission
example of dependencies *between* permissions. eg, in this case, work-on-issues permission 'needs' browse-projects permission
could be expressed as a permission hierarchy where if work-on-issues permission is granted, means/implies that user already has browse-projects permission (w-o-i perm 'subsumes' b-p perm)
might imply permission hierarchy
log in options: log in with user name/password and log in with certificate
how to create custom realm and how to handle multi-realm scenario
account credentials and access rights are stored in database. Stored passwords are hashed and salted.
Authorization
If the realm wishes to do also authorization, it has to implement Authorizer interface. Each Authorizer method takes principal as parameter and checks either role(s) or permission(s)
Permissions are supplied either as strings or as permission objects
use WildcardPermissionResolver to convert strings into permission objects
connect application to database and create tables to store all user account data
replace IniRealm with realm able to read from database and salt passwords.
this is one sensible interface naming option, if the interface encapsulates a cohesive set of behaviors
and yes, compared to blindly following the meaningless I+ convention, it requires some thought, but thinking of an appropriate name also forces you to (re)consider the interface's primary responsibility and how it fits into the overall design
imho, a class diagram for a domain model should be almost fluently readable english
Sometimes an Adjective doesn't make sense, but I'd still generally be using interfaces to model behavior, actions, capabilities, properties, etc,... not types.
Also, If you were really only going to make one User and call it User then what's the point of also having an IUser interface?
another anti-pattern... blindly create an interface for every class, even if there's only one implementation!! arrgghhhh!
consider introducing an interface when there are 2-3 well-distinguished, concrete implementations required
if you are going to have a few different types of users that need to implement a common interface, what does appending an "I" to the interface save you in choosing names of the implementations?
prefer not to use a prefix on interfaces:
hurts readability.
interfaces names should be as short and pleasant as possible
Implementing classes should be uglier to discourage their use.
but don’t know how those dependencies are instantiated
And you shouldn’t really care, all that is important is that UserService depends on dao and webservice object.
BDD template given-when-then) tests are easy to read
@Entity
public class User
calling new User(“someName”,”somePassowrd”, “someOtherName”, “someOtherPassword”) becomes hardly readable and maintainable
code duplication
Maintaining this code would turn into a nightmare in no time
running the code above will throw an exception by the JPA provider,
since not-nullable password field was never set.
Joshua Blooch gives fine example of builder pattern.
Instead of making the desired object directly, the client calls a constructor (or static factory) with all of the required parameters and gets a builder object. Then the client calls setter-like methods on the builder object to set each optional parameter of interest. Finally, the client calls a parameterless build method to generate the object, which is immutable. The builder is a static member class of the class it builds.
Coffee
public static class Builder
Builder(CoffeeType type, int cupSize)
Builder withMilk()
Coffee build()
Coffee(this)
private Coffee(Builder builder)
Coffee coffee = new Coffee.Builder(CoffeeType.Expresso, 3).withMilk().build();2}
especially if most of those parameters are optional.
For all entity attributes I create private fields
those that are obligatory become parameters for the public constructor
parameter-less constructor, I create one, but I give him
MDG Technologies allow users to extend Enterprise Architect's modeling capabilities to specific domains and notations. MDG Technologies seamlessly plug into Enterprise Architect to provide additional toolboxes, UML profiles, patterns, templates and other modeling resources.
Free MDG Technology downloads for Enterprise Architect:
EJB
MDG Technology for Enterprise Java Beans allows the user to model EJB entities and EJB sessions, complete with UML profiles for modeling EJB, EJB patterns and Code Management.
(requires Enterprise Architect 4.1 or later)
ICONIX AGILE DDT
ICONIX Agile Developer - Design-Driven Testing (DDT) streamlines the ICONIX modeling process, providing:
Convenient modeling of robustness diagrams
Automatic generation of sequence diagram structures from robustness diagrams
Transformation of robustness control elements to test diagrams
Transformation of sequence diagram elements to test diagrams
Transformation of requirement diagrams to test diagrams
Transformation between test cases and test classes. (JUnit & NUnit)
Built-in model validation rules for ICONIX robustness diagrams
(requires Enterprise Architect 7.5 or later)
Testing
MDG Technology for Testing helps users to rapidly model a wide range of testing procedures including component testing, SUT, Test Cases and more.
(requires Enterprise Architect 4.1 or later)
Instructions for loading an MDG Technology
EXE file:
Download and run the .exe file to install the MDG technology.
Open Enterprise Architect.
Select from the Main Menu Add-Ins | XYZ Technology | Load.
Built-in MDG Technologies:
Most of the MDG Technologies provided by Sparx Systems are built into Enterprise Architect directly. Depending on your edition of Enterprise Architect, some or all of the following MDG Technologies will be available:
In any access control model, the entities that can perform actions in the system are called subjects, and the entities representing resources to which access may need to be controlled are called objects
object-capability model, any software entity can potentially act as both a subject and object
Access control models used by current systems tend to fall into one of two classes:
those based on capabilities
those based on access control lists (ACLs)
Both capability-based and ACL-based models have mechanisms to allow access rights to be granted to all members of a group of subjects (often the group is itself modeled as a subject)
identification and authentication determine who can log on to a system, and the association of users with the software subjects that they are able to control as a result of logging in;
authorization determines what a subject can do;
accountability identifies what a subject (or all subjects associated with a user) did.
Authorization determines what a subject can do on the system
Authorization
Access control models
categorized as either discretionary or non-discretionary
three most widely recognized models are
Discretionary Access Control (DAC)
Mandatory Access Control (MAC)
Role Based Access Control (RBAC)
Attribute-based access control
Discretionary access control
Discretionary access control (DAC) is a policy determined by the owner of an object. The owner decides who is allowed to access the object and what privileges they have.
Every object in the system has an owner
access policy for an object is determined by its owner
DAC systems, each object's initial owner is the subject that caused it to be created
Mandatory access control
Mandatory access control refers to allowing access to a resource
if and only if rules exist
that allow a given user to access the resource
Management is often simplified (over what can be required) if the information can be protected using
hierarchical access control
or by implementing sensitivity labels.
Sensitivity labels
A subject's sensitivity label specifies its
level of trust
level of trust required for access
subject must have a sensitivity level equal to or higher than the requested object
Domain object instance security: In many applications
it's desirable to define Access Control Lists (ACLs) for individual
domain object instances. We provide a comprehensive ACL package with
features including integer bit masking, permission inheritance
(including blocking), an optimized JDBC-backed ACL repository, caching
and a pluggable, interface-driven design.
OpenID Support: the web's emerging single sign-on standard
(supported by Google, IBM, Sun, Yahoo and others) is also supported in Spring
Security
Easy integration with existing databases: Our implementations
have been designed to make it easy to use your existing authentication schema
and data (without modification). Of course, you can also provide your own Data
Access Object if you wish.
Password encoding: Of course, passwords in your authentication
repository need not be in plain text. We support both SHA and MD5 encoding, and
also pluggable "salt" providers to maximise password security.
Caching: Spring Security optionally integrates with Spring's Ehcache factory. This flexibility
means your database (or other authentication repository) is not repeatedly queried
for authentication information when using Spring Security with stateless
applications.
Run-as replacement: The system fully supports temporarily
replacing the authenticated principal for the duration of the web request or
bean invocation. This enables you to build public-facing object tiers with
different security configurations than your backend objects.
Tag library support: Your JSP files can use our taglib to ensure
that protected content like links and messages are only displayed to users
holding the appropriate granted authorities. The taglib also fully integrates
with Spring Security's ACL services, and obtaining extra information about the
logged-in principal.
User Provisioning APIs: Support for groups, hierarchical roles
and a User management API, which all combine to reduce development time and
significantly improve system administration.
Enterprise-wide single sign on using CAS 3: Spring Security
integrates with JA-SIG's open source Central Authentication
Service (CAS)
note, the 'i' here, is mr. MARTIN FOWLER!!
and of course, eric evans hails from domain driven design fame
fundamental horror
it's so
contrary to the basic idea of object-oriented design
combine
data and process together
procedural style design
completely miss the point of what
object-oriented design is all about
It's also worth emphasizing that putting behavior into the domain
objects
should not contradict the solid approach of using layering to
separate domain logic from such things as persistence and presentation
responsibilities
logic that should be in a domain object is
domain logic
validations
calculations
business rules
One source of confusion in all this is that many OO experts do
recommend putting a layer of procedural services on top of a domain
model, to form a Service Layer
this isn't
an argument to make the domain model
void of behavior
service
layer advocates use a service layer in conjunction with a behaviorally
rich domain model.
... and has the *most value* to an organization investing in writing their own software
infrastructure software (eg. user interface, orm, application server-related frameworks) or plumbing code should be treated as commodities where possible, unless, the business consciously decides that a custom, home-grown implementation is absolutely required for patenting or other differentiation reasons and/or that no existing off-the-shelf solution can be used
but these cases should be rare! do not blindly fall for the not-invented-here syndrome