Tutorials
All Tutorials
UML Tutorials
UML 2.1 Tutorial
UML Tutorial - Part 1 Intro
UML Tutorial - Part 2 Intro
The Business Process Model
The Component Model
The Dynamic Model
The Logical Model
The Physical Model
The Use Case Model
UML Database Modeling
Enterprise Architect Tutorials
Creating Strategic Models
Diagram Filters
BPEL: Step by Step Guide
Resource Management
Testing Management
Traceability
RTF Documentation
Use Case Metrics
Structured Use Case Scenarios
Video Demonstrations
All Videos
Getting Started
Requirements Management
Modeling & Productivity Tools
Code Engineering and the Debug Workbench
Version Control
Integration (Eclipse, Visual Studio, TFS)
UML Tutorial - Structure
UML Tutorial - Behavior
The Business Process Model
Deployment of EA
MDA Overview
Rich-Text (RTF) Reporting
Version Control Integration
Requirements Management
White Papers & E-Books
Roles
Business Analyst
Database Administrator
Deployment & Rollout
Developer
Project Manager
Software Architects
Software Engineer
Technology Developer
Testers
inner class Builder is in charge of creating Customer instances
mandatory fields – either primitive (e.g. id) or annotated with @NotNull (e.g. lastName) – are part of the builder's constructor
all optional fields setter methods on the builder are provided
newly created Customer instance is validated using the Validator#validate() method
impossible to retrieve an invalid Customer instance
extract the validation routine into a base class:
abstract class AbstractBuilder<T>
T build() throws ConstraintViolationException
protected abstract T buildInternal();
private static Validator validator
Concrete builder classes have to
extend AbstractBuilder
must implement the buildInternal() method:
Builder extends AbstractBuilder<Customer>
@Override
protected Customer buildInternal()
Implementing the Builder Pattern using the Bean Validation API
variation of the Builder design pattern for instantiating objects with multiple optional attributes.
this pattern frees you from providing multiple constructors with the different optional attributes as parameters (hard to maintain and hard to read for clients)
or providing setter methods for the optional attributes
(require objects to be mutable, can leave objects in inconsistent state)
well, dependency injection, but moreover, the soa approach to service design tends to force otherwise intelligent software engineers into doing procedural design
the services just end up being bags of method calls that implement any type of behavior, with the domain objects or entity beans being reduced to mere data structures with little responsibility or behavior beyond persistence. (which, in this anti-pattern, is typically mostly provided by the repository or dao class! ie. domain object crud)
instead of, say, attaching validation 'behavior' directly on, but still decoupled from domain classes themselves (eg. validation rule annotations on jpa entity beans)
dilemma arising from the situation in which
multiple individuals, acting independently and rationally consulting their own
self-interest, will ultimately deplete a shared limited resource even when it
is clear that it is not in anyone's long-term interest for this to happen
stop asking themselves how this solution could be improved upon
It's a very impressive magic trick, and I wish I knew how to do it myself. But then, I'm just not like that. I'm always trying to poke holes in things - whether they were Invented Here or Not.
but that might be too high-level for your taste. Their are other, less-abstract options.
exception handling, this is one area where Spring does a good job: "The Spring Framework's handling of SQLException is one of its most useful features in terms of enabling easier JDBC development and maintenance. The Spring Framework provides JDBC support that abstracts SQLException and provides a DAO-friendly, unchecked exception hierarchy."
Utter nonsense and dishonest false advertising
Automatic connection closing (and other boiler-plate code) is obviously a hard requirement to be handled by the fwk.
Pffffff. It's a trivial requirement which I can solve in my framework with two lines of code in a @Disposes method. Did you see any connection handling in the code above?
I mean, seriously guys. The Spring stuff is trivial and not even very elegant. I guess it's easier for me to see that, since I spent half my career thinking about data access and designing data access APIs. But even so...
I don't understand. You hate the ability to write typesafw SQL that much?
Gavin King
Methods with long argument lists are a code smell.
It's something Spring copied from Hibernate 1.x, back in the days before varargs
It's something we removed in Hibernate2 and JPA.
there are a bunch of people
who don't want to use JPA.
They don't understand, or see the value of, using managed objects to represent their persistent data.
Um. Why? Why would that be a bad thing? I imagine that any app with 1000 queries has tens of thousands of classes already. What's the problem? Why is defining a class worse than writing a method?
Are you working from some totally bizarre metric where you measure code quality by number of classes?
just don't hard-code this eager loading behavior by using jpa's FetchType.EAGER when annotating the entity beans
if you do, you force all clients of said entity beans to *always* eager fetch everything, even if the client doesn't want/need the full depth/breadth of the object graph
to eager load the relations when needed, try fetch joins (see item 5)
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:
"Bean Validation" specification (aka JSR-303) standardizes an annotation-based validation framework for Java
Flex doesn't provide by itself such framework. The standard way of processing validation is to use Validator subclasses and to bind each validator to each user input (see Validating data). This method is at least time consuming for the developer, source of inconsistancies between the client-side and the server-side validation processes, and source of redundancies in your MXML code.
GraniteDS introduces an ActionsScript3 implementation of the Bean Validation specification and provides code generation tools integration so that your Java constraint annotations are reproduced in your AS3 beans
GraniteDS validation framework provides a set of standard constraints
Constraint
Description
AssertFalse
The annotated element must be false
AssertTrue
The annotated element must be true
DecimalMax
The annotated element must be a number whose value must be lower or equal to the specified maximum
DecimalMin
The annotated element must be a number whose value must be greater or equal to the specified minimum
Digits
The annotated element must be a number whithin accepted range
Future
The annotated element must be a date in the future
Max
The annotated element must be a number whose value must be lower or equal to the specified maximum
Min
The annotated element must be a number whose value must be greater or equal to the specified minimum
NotNull
The annotated element must not be null
Null
The annotated element must be null
Past
The annotated element must be a date in the past
Pattern
The annotated String must match the supplied regular expression
Size
The annotated element size must be between the specified boundaries (included)
Constraint annotations must be placed on public properties, either public variables or public accessors