Standards around Model / UI project dependencies

14 views
Skip to first unread message

Jang Vijay Singh

unread,
Oct 29, 2009, 2:13:07 PM10/29/09
to ADF Enterprise Methodology Group
Hello Everyone,

This is my first post to the group and I look forward to exchanging
ideas with all of you. I am very passionate about getting this
excellent technology widely adopted and in the right way.

I did search the group for existing posts on this topic but didn't
find any.

I think one point that merits an addition to the standards is for
model projects not to have any UI / Faces dependencies (and hence no
public_html and web.xml in a model project) and vice versa, i.e. a
UI / ViewController project to not be initialised for business
components.

First of all, it promotes a clean MVC implementation and no improper
usage of API's creeps in.
Secondly, while OC4J never complained, I think weblogic has a problem
with web components in model projects.

Any thoughts on this?

Thanks,
JV Singh

Avrom Roy-Faderman

unread,
Oct 29, 2009, 7:58:27 PM10/29/09
to adf-met...@googlegroups.com
Moreover, as your projects grow, maintaining a strict discipline about
dependencies is the only reliable way to prevent loops.

I *think* this is actually published somewhere in official Oracle material
as a best practice. But in any case, I agree with you: Your Model project
should never refer directly to anything in your ViewController project,
and should never use any APIs intended for UI development (e.g., Faces
APIs).

I'll go a step farther--while your ViewController project certainly can
(indeed, must) depend on your Model project, you should keep these
couplings as loose as possible. With only a *very* small number of
exceptions, code references to anything in any jbo.* package except
domains and Exceptions don't belong in your ViewController project outside
of your bindings files; all business access should go through those
bindings.

Best,
Avrom
--
Avrom’s Java EE and Oracle ADF Blog
http://www.avromroyfaderman.com

Reply all
Reply to author
Forward
0 new messages