| Ultimate enterprise design pattern for 3 tiered apps |
|
 |
Index ‹ java-programmer
|
- Previous
- 1
- Four Mobile Phone Makers to Create Linux Platform
Roy Schestowitz wrote:
> Mobile phone companies join forces on Linux
>
> ,----[ Quote ]
> | Four mobile handset makers are teaming up with two cellular operators
> | to develop a new Linux software platform for mobile devices.
> |
> |
> | Cell phone makers Motorola, NEC, Panasonic Mobile Communications and
> | Samsung Electronics, along with mobile operators NTT DoCoMo and Vodafone,
> | expect to announce on Thursday plans to form an independent foundation to
> | develop a common mobile Linux-based platform. They will use this platform
> | to develop new products, applications and features.
> |
> | Linux, an open-source operating system, is already available on a wide
> | range of mobile handsets. Motorola alone says it has shipped more than
> | 5 million Linux-based handsets, mostly on smart phones, such as the
> | Ming model shipped in China. In addition, Motorola just launched the new
> | Rokr E2 music phone in Asia, which also uses Linux. The Rokr E2 will
> | soon ship in Europe.
> `----
>
> http://news.com.com/2100-1039_3-6083883.html?part=rss&tag=6083883&subj=news
>
> If this is not proof of GNU/Linux taking over, I don't know what is... Nokia,
> Palm and others are no exception.
Symbian is by far the dominant mobile OS worldwide and don't see that
changing soon, although tons of linux phone shipments to china, which
has the largest mobile subscriber base in the world holds hope.
As always, Java ME is the application platform for all these devices.
*Posted from my u know what...
- 5
- Play audio clip in an ApplicationI'm trying to play an audio clip by using Applet's newAudioClip()
method. That method takes a URL. The .wav file is located in a jar file
(the only jar file). For example:
if myJar.jar is the only jar file
"java -jar myJar.jar" launches the application correctly and everything
is wonderful. My audio clip won't play because I don't know how to
access the .wav file from the jar file.
This code snippet works fine when I'm not running from the jar file:
try
{
File currentDir = new File(".");
URL currentDirURL = currentDir.toURL();
URL url = new URL(currentDirURL, fileName);
AudioClip clip = Applet.newAudioClip(url);
clip.play();
}
catch (Exception e)
{
e.printStackTrace();
}
It knows to look for the sound file in the current directory. How do I
adjust this code to look for the sound file in the jar.
I have a feeling it's an easy answer involving class.getResource().....
- 5
- tomcatI just installed Tomcat 5.5 and went to http://127.0.0.1:8080/. Then I
clicked on Servlet Examples to see what examples it comes with, but I
got a 404 File not found error. Anyone know what the deal is? Are the
servlet examples separate?
- 7
- How to convert a C++ Object to a JNI jobject in order to use GetObjectClassI have an interface object of type ISubscribe and I am trying to cast
the ISubscribe object to a jobject so I can call GetObjectClass in
order to proceed with a callback using JNI.
ISubscribe * s
jclass cls = env->GetObjectClass(s);
Does anyone know how I can do this in C++? I tried using
reinterpret_cast<jobject>(s) but GetObjectClass does not like that. Any
ideas would be appreciated.
Thanks,
Vijayk
- 8
- using jsp:setProperty on non-simple types.Hi,
I'm currently having a small problem with my application. I'm using
some simple classes that wraps simple types to help me provide multiple
representation. For example, a DateCBO calls wraps the Date type and
gives me the oportunity to have various 'getters' like
getDateShortFormat(), getHtml(), getDateLongFormat() and so on.
My beans are using this kind of wrappers as their properties.
I have already made a custom tag to retrieve information that i use
instead of the standard jsp:getProperty
Now, i'm trying to use the jsp:setProperty to initialise the bean
property, but i have 'Could not coerce String to non-primitive type
StringCBO without bean property editor (JSP 1.2: 2.13.2.1) at line 13'
error.
Is there an interface that i can use to allow direct usage of
'jsp:setProperty', or should i create a custom tag as well.
thanks.
- 9
- 9
- load servlet mappings at runtime in tomcatCan anyone suggest a way to achieve dynamic servlet mappings in tomcat 5.5.
What I want to do is run a web app with any number of paths all pointing to
one servlet. These paths would be loaded from a database and extra paths
can be added at runtime by the user. So an example would be
www.domain.com/sample and www.domain.com/anothersample would both execute
the same servlet.
Another option I thought of was having a custom 404 servlet that would check
the request supplied and then redirect.
- 11
- mouseClicked vs. mousePressed on Apple vs. WindowsI'm writing a Swing component which must function similarly on Apple
and Windows; and am having trouble with which event to fire off of
(this is effectively a toggle button which would ideally just be
interested in mouseClicked). For a variety of other reasons, I don't
want to make my code act on the mousePressed event.
Originally, our QA person asserted that it was busted because she was
clicking (and moving the mouse > 10 pixels) and it wasn't getting
"toggled" (this was on Windows). I won the battle there by saying
"don't move it 10 pixels; that's a drag, not a click". (after
debugging and figuring out that if you moved the mouse more than
approximately that much, the mouseClicked never came in).
However, she now claims that on Apple (OSX) that the button fails to
toggle if you move the mouse even one pixel while pressing the button.
(i.e. if you are not perfectly still while clicking).
Obviously this would be a different story. I don't have immediate
access to an Apple machine, so was wondering if anybody else had seen
this behavior. When I worked on the AWT on OS/2 at IBM, it was fairly
clear that the mouse events were determined based on native operating
system events (i.e. when Windows says it is a click, we'll say it is a
click). Don't know if that's true now or not, since I haven't seen the
code since Java 1.1.8.
---
Mike Dahmus
m dah mus @ at @ io.com
- 11
- Eclipse 3.3 - external tool arguments issue.
I run the WebSphere command line wsadmin java tool as external tool in
Eclipse. It works fine except where an External tool argument has an
"=" sign as in "-javaoption -Dcom.ibm.ws.management.standalone2=xxxx".
Wsadmin picks up the "-Dcom.ibm.ws.management.standalone2" variable
but not the value. Seems that the Eclipse "arguments" dialog
truncates values after the "=" sign. Is there a way around this.
The arguments are listed below.
-user 1234 -password xyz
-lang jacl -host 11.11.11.11. -port 1111
-javaoption -Dcom.ibm.ws.management.standalone2=xxxx
-wsadmin_classpath C:\WASAdminSBV\WSAdmin\WAS5.1\JACL\proclib.jar
-f ${resource_loc}
The problem does not occur when Wsadmin is run from the command line.
- 12
- jni gcc mangled names//Crapo.java
public class Crapo {
static {
System.loadLibrary("Crapo");
}
native public static int magicNumber(int n);
public static void main(String... args) {
System.out.println(magicNumber(246));
}
}
//Crapo.c
typedef long long __int64;//gcc doesn't recognize __int64
#include "Crapo.h"
/*
* Class: Crapo
* Method: magicNumber
* Signature: (I)I
*/
JNIEXPORT jint JNICALL Java_Crapo_magicNumber(JNIEnv * env, jclass c,
jint n) {
return 47;
}
//run gcc -mno-cygwin -Wl,--add-stdcall-alias -shared -o Crapo.dll -I
"C:\Program Files\Java\jdk1.6.0\include" -I "C:\Program
Files\Java\jdk1.6.0\include\win32" Crapo.c
//output of nm Crapo.dll
10003040 b .bss
10003020 b .bss
10003000 b .bss
//............ 30+ lines of this crap
1000505c i .idata$5
//..........................
100011d0 T _DllMain@12
10001000 T _DllMainCRTStartup@12
100011c0 T _Java_Crapo_magicNumber@12//<-----------------
10001360 T __CTOR_LIST__
10001368 T __DTOR_LIST__
U __RUNTIME_PSEUDO_RELOC_LIST_END__
U __RUNTIME_PSEUDO_RELOC_LIST__
//................... more crap; to me at least
//it was my understanding that --add-stdcall-alias when passed to the
linker should remove the @12 of _Java_Crapo_magicNumber@12
//run gcc -mno-cygwin -shared -o Crapo.src -S -I "C:\Program
Files\Java\jdk1.6.0\include" -I "C:\Program
Files\Java\jdk1.6.0\include\win32" Crapo.c
//remove @12 from Crapo.src
//run as -o Crapo.obj Crapo.src
//run ld -shared -o Crapo.dll Crapo.obj
//run nm Crapo.dll
U .bss
U .data
10001000 t .text
10001000 T _Java_Crapo_magicNumber
10001010 T __CTOR_LIST__
10001018 T __DTOR_LIST__
10002000 A __RUNTIME_PSEUDO_RELOC_LIST_END__
10002000 A __RUNTIME_PSEUDO_RELOC_LIST__
10001010 T ___CTOR_LIST__
10001018 T ___DTOR_LIST__
//... more crap
// by manually removing the @12 from the assembly source produced by
gcc and then separately assembling and linking solves the problem.
//I like the fact that their are far fewer unnecessary symbolic names.
Yet I was hoping their was a one step command-line option to be sent,
like --add-stdcall-alias? Any reason that doesn't seem to work for me?
//It's my understanding that -Wl,--add-stdcall-alias command-line
option is sent to the linker by gcc, and then subsequently sent to
dlltool where the option should result in the @nn's being removed from
the table of symbolic names. Is this correct?
- 15
- ... to see if I can post ...
I attempted to respond to the response to my latest post,
or to thank him twice, but not shown. What is going on?
- 15
- JDialog focusHi,
Is it possible to ensure that, upon setVisible(true), a JDialog pop-up
jumps on top of all other windows including other applications?
Many thanks in advance!
Aaron Fude
- 16
- Opportunities in U.K./Great Britain?I have a friend who recently moved to Madrid. He had a Dutch passport
so EU access was relatively easy for him. We both lived in D.C., but
I remain US citizen by birth.
My question is, he says it's becoming more popular for J2EE
development in Great
Britain and the UK. I'm wondering how good is the market? (in
relation to US) How good is it for US programmers? (any demand for US
borne skills) And if any of these are true, how hard it is securing
work permit? (etc) Finally is there any idea what standard of living
might be like?
Given all of this would there be sacrifices, or would it just be
better overall simply to stay in US?
- 16
- ain't java grand ?I just got this error message from the java 4.2 compiler.
---
Consulting.java:152: cannot resolve symbol
symbol : variable $
location: class Consulting
perchance you meant '.'
---
Ain't it just the coolest message you've ever seen?
- 16
- Regular expressions question!I'm trying to parse HTML tables, so I need to find following pieces of text!
<table .....anything between this ..... /table> and
<tr ........ /tr> and
of course
<td> 'part that I need' </td>
I do not know how to put that into regular expression!
Thanks!
|
| Author |
Message |
timasmith

|
Posted: 2006-7-4 20:08:00 |
Top |
java-programmer, Ultimate enterprise design pattern for 3 tiered apps
So, I feel I am close here is what I have so far.
Goal: Database driven selection of controls on forms
Goal: Business rules only aware of interfaces
Goal: Presentation layer only aware of interfaces
Database Table Person: Name, BirthDate, Gender, CreateDate, CreatedBy
Value Object:
public class Person {
private String name;
private DateTime birthDate;
private int gender;
private DateTime createDate;
private int createdBy;
}
Business Layer Object:
public interface IPersonModel {
public boolean isTeenager();
public boolean isMale();
public boolean isFemale();
}
Presentation layer Multi Column List control
public interface ITableList {
public int rowCount();
public Object getItemAtRow(int row);
public Object getValueAtRowColumn(int row, int column);
}
public interface ITableItem {
public Object getValueAtColumn(int column);
}
The most complex part is storing in a database table which fields on
the value object will be presented in the multi column list control.
It needs to be user friendly and maintainable.
One time I tried having each value object with a switch statement for a
unique number for each field. So the database contents and source code
are kept in synch e.g. 266 in the database means 'Person CreateDate'
and the value object returns that when implementing ITableItem.
It worked but relies on a code generator to make it all work.
This time around I thought I could keep a script in the database so the
user would pick the first column to be person.getCreateDate(), the
second to be person.getName() etc.
Using reflection I could generate on the fly which attribute will be
displayed in which column.
Anyone think of other options?
The other thing I need to change is it seems an unecessary dependency
for the value object to implement ITableItem - there probably needs to
be another class which does it and depending on the database values
pulls the data from the value object.
The same goes for the value object implementing the business rules.
While probably not too bad if it does, perhaps mapping the values to
something that does might work better.
Apart from the value object I am trying to anything else in all the
code knowing about fields which are only used for CRUD e.g. createDate.
CreateDate may never be used for logic - in my app - ever - so why
pass it around as business objects - better to only have things
implementing interfaces where needed.
What do you think so far?
|
| |
|
| |
 |
Frans Bouma

|
Posted: 2006-7-5 16:58:00 |
Top |
java-programmer >> Ultimate enterprise design pattern for 3 tiered apps
email***@***.com wrote:
> So, I feel I am close here is what I have so far.
>
> Goal: Database driven selection of controls on forms
> Goal: Business rules only aware of interfaces
> Goal: Presentation layer only aware of interfaces
Unless motivation is given for these goals, they're pretty useless,
IMHO. Don't over-engineer just because some book told you to apply
pattern ABC because it's soooooo great. A simple app should be a simple
app, not a complex framework build upon framework build upon... just
because you can.
> Database Table Person: Name, BirthDate, Gender, CreateDate, CreatedBy
>
>
> Value Object:
>
> public class Person {
> private String name;
> private DateTime birthDate;
> private int gender;
> private DateTime createDate;
> private int createdBy;
> }
>
>
> Business Layer Object:
>
> public interface IPersonModel {
> public boolean isTeenager();
> public boolean isMale();
> public boolean isFemale();
> }
Interfaces are meant to define multiple-TYPE inheritance. If you're
never going to use an interface for more than one implementation, you
can as well use the class doing the implementation, and get rid of the
interface.
> Presentation layer Multi Column List control
>
> public interface ITableList {
> public int rowCount();
> public Object getItemAtRow(int row);
> public Object getValueAtRowColumn(int row, int column);
> }
> public interface ITableItem {
> public Object getValueAtColumn(int column);
> }
Why re-invent the wheel? GUI controls should be grabbed from the
shelve, not programmed yourself, that's just a waste of time.
> The most complex part is storing in a database table which fields on
> the value object will be presented in the multi column list control.
> It needs to be user friendly and maintainable.
why do you want to store in the DB which fields to show? After all, if
you want logic in those forms as well, that logic has to know what's on
the form to do something.
FB
--
------------------------------------------------------------------------
Lead developer of LLBLGen Pro, the productive O/R mapper for .NET
LLBLGen Pro website: http://www.llblgen.com
My .NET blog: http://weblogs.asp.net/fbouma
Microsoft MVP (C#)
------------------------------------------------------------------------
|
| |
|
| |
 |
timasmith

|
Posted: 2006-7-5 21:04:00 |
Top |
java-programmer >> Ultimate enterprise design pattern for 3 tiered apps
So I guess I could have qualified the project but I dont see the
relationship to the design
a) This is a large project - tens of thousands of requirements
b) This is an extremely complex domain - not a store front or banking
app...
c) This is regulated and must be executed under design control,
traceability etc.
So I hardly would say Presentation being unaware of business objects is
useless... and I considering the complexity of the domain it is
*impossible* to determine all the data elements required to capture on
forms.
Forms which capture custom content only for a single site should not
(can not) be aware of the content. Events and data entry rules can be
executed by custom scripting specific to the site implementation.
The interfaces I refer to would be used for > 100 objects.
The controls need to be stored in the db so the users can choose which
to configure on the forms.
Frans Bouma wrote:
> email***@***.com wrote:
>
> > So, I feel I am close here is what I have so far.
> >
> > Goal: Database driven selection of controls on forms
> > Goal: Business rules only aware of interfaces
> > Goal: Presentation layer only aware of interfaces
>
> Unless motivation is given for these goals, they're pretty useless,
> IMHO. Don't over-engineer just because some book told you to apply
> pattern ABC because it's soooooo great. A simple app should be a simple
> app, not a complex framework build upon framework build upon... just
> because you can.
>
> > Database Table Person: Name, BirthDate, Gender, CreateDate, CreatedBy
> >
> >
> > Value Object:
> >
> > public class Person {
> > private String name;
> > private DateTime birthDate;
> > private int gender;
> > private DateTime createDate;
> > private int createdBy;
> > }
> >
> >
> > Business Layer Object:
> >
> > public interface IPersonModel {
> > public boolean isTeenager();
> > public boolean isMale();
> > public boolean isFemale();
> > }
>
> Interfaces are meant to define multiple-TYPE inheritance. If you're
> never going to use an interface for more than one implementation, you
> can as well use the class doing the implementation, and get rid of the
> interface.
>
> > Presentation layer Multi Column List control
> >
> > public interface ITableList {
> > public int rowCount();
> > public Object getItemAtRow(int row);
> > public Object getValueAtRowColumn(int row, int column);
> > }
> > public interface ITableItem {
> > public Object getValueAtColumn(int column);
> > }
>
> Why re-invent the wheel? GUI controls should be grabbed from the
> shelve, not programmed yourself, that's just a waste of time.
>
> > The most complex part is storing in a database table which fields on
> > the value object will be presented in the multi column list control.
> > It needs to be user friendly and maintainable.
>
> why do you want to store in the DB which fields to show? After all, if
> you want logic in those forms as well, that logic has to know what's on
> the form to do something.
>
> FB
>
>
> --
> ------------------------------------------------------------------------
> Lead developer of LLBLGen Pro, the productive O/R mapper for .NET
> LLBLGen Pro website: http://www.llblgen.com
> My .NET blog: http://weblogs.asp.net/fbouma
> Microsoft MVP (C#)
> ------------------------------------------------------------------------
|
| |
|
| |
 |
Nick Malik [Microsoft]

|
Posted: 2006-7-5 22:54:00 |
Top |
java-programmer >> Ultimate enterprise design pattern for 3 tiered apps
Hi Tina,
I read your other response, so I saw that you are building an enterprise
system. However, I have to agree with Frans on some points.
<email***@***.com> wrote in message
news:email***@***.com...
> So, I feel I am close here is what I have so far.
>
> Goal: Database driven selection of controls on forms
Interesting. I would say that you need to have metadata (form display
control data) in the database to accomplish this. Not unreachable. The
site that Microsoft presents to some supply chain partners has this feature.
There are pros and cons to this design.
First, about the concept:
Page request comes in from. Authenticate the user.
Download a base page with controls and LOTS of javascript
The page asks for it's metadata.
Ajax Service sends metadata that reflects the user's authorization. Some
controls appear. Others do not.
The page asks for it's initial data based on the original request.
Ajax Service requests data for the page of the business objects
Business objects tailor the request with authorization information.
Database sends back only the rows and columns that the user has the right
to see
Business objects convert to an appropriate format for sending to the page
(*Don't assume XML*)
Ajax Service sends formatted data
Page script gets data and fills in the page
User performs manipulations and submits data
Ajax Service receives the data and decides if a data manipulation has
occurred. Calls appropriate business layer object to save changes.
Pros: You get a highly flexible interface. The site that I spoke of has
features that are available based on a large number of very narrowly defined
classes of partners. For example, very large partners in China may need
some things that very small partners in Argentina do not. Microsoft has
literally thousands of partners using these tools, and they are not a simply
heirarchy. In other words, some partners work with other partners. We
offer tools to multiple points in the supply and distribution chains.
Therefore, it is sometimes appropriate for a company to see a small amount
of the data of another company. Auth/Auth is very important on a row-by-row
and column-by-column basis. This also gives us a LOT of flexibility in
building many different types of apps, all using this same pattern. By
developing common tools that can be used by each of the web-part
applications, we reduce the need for overhead on each application, and
reduce the cost and error rates of small changes. We have apps that assist
with order management, inventory management, supply chain controls,
invoicing, and financial adjustments under this design. That's a pretty
wide set.
Cons: This is a lot of engineering. Most of the existing controls require
some extensions to use this pattern (we extended existing controls rather
than wrote new ones). This may be appropriate if you have 50 engineer-years
that you expect to expend on your sites. We do. I don't know if that
applies to you. This mechanism also has difficulty being performant. The
MSN Live site experienced some difficulties early on with performance, and
one of the biggest factor turned out to be the XML (the 'X' in Ajax). For
some systems, switching the data transfer format to JSON has had some
success in speeding up the site. My suggestion: create a working prototype
with a grid that runs end-to-end through your proposed stack and put in on a
database and run it for the users to see. Our prototypes were end-to-end on
the process parts, but were shell apps when it came to working the stack, so
we didn't see the performance impacts until later than I would have liked.
> Goal: Business rules only aware of interfaces
Not sure if I agree. If you mean: business rules are applied consistently,
in a carefully constrained way, and defined in a way that allows them to
change with a minimum of recoding effort, then I agree. If you are
implementing that goal by applying the business rules only to data that is
represented by a messaging contract, then I may agree, depending on the
rules. If you are saying that this particular implementation is 'ultimate'
or should be used by all apps, then I disagree. It is OK to have multiple
tools in the toolbelt. Just because a hammer works, that doesn't mean I
discard my screwdriver.
> Goal: Presentation layer only aware of interfaces
If you change the word 'interfaces' to 'messaging contract' then I'd
understand and agree. As it is, I worry a little. If you mean 'interface'
in the OO sense, then you are sharing class, not contract, and that is the
opposite of SOA-based patterns. Perhaps you meant 'contract' and not
'class'?
> Database Table Person: Name, BirthDate, Gender, CreateDate, CreatedBy
>
>
> Value Object:
>
> public class Person {
> private String name;
> private DateTime birthDate;
> private int gender;
> private DateTime createDate;
> private int createdBy;
> }
>
This is going to be hard to do if the ability for a particular column to
appear, based on metadata, is database driven. I'd suggest a more generic
DTO (Data Transfer Object integration pattern), like a .Net DataSet.
>
> Business Layer Object:
>
> public interface IPersonModel {
> public boolean isTeenager();
> public boolean isMale();
> public boolean isFemale();
> }
>
OK, as long as you are handling the situation where some method's values are
undefined since the underlying data may not always be available. Not sure I
can see how these particular methods would be useful though. Perhaps you
were just be illustrative?
>
> Presentation layer Multi Column List control
>
> public interface ITableList {
> public int rowCount();
> public Object getItemAtRow(int row);
> public Object getValueAtRowColumn(int row, int column);
> }
> public interface ITableItem {
> public Object getValueAtColumn(int column);
> }
>
If you are on the Microsoft platform, these capabilities are built in to the
ASP.Net controls out of the box, with support for a broad array of browsers.
Please avoid writing 'yet another set of controls' if you can. MS released
a set of Ajax controls this year that are pretty good. There are competing
sets of Ajax controls, as well as more traditional server-side controls, in
abundance. Please don't reinvent this wheel.
>
> The most complex part is storing in a database table which fields on
> the value object will be presented in the multi column list control.
> It needs to be user friendly and maintainable.
Yes, this is a problem. In the portal I described above, we have created a
'metadata editor' to allow us to maintain the complex rules.
>
> One time I tried having each value object with a switch statement for a
> unique number for each field. So the database contents and source code
> are kept in synch e.g. 266 in the database means 'Person CreateDate'
> and the value object returns that when implementing ITableItem.
> It worked but relies on a code generator to make it all work.
Yuck. This also has the problem of driving complexity into the display
controls.
>
> This time around I thought I could keep a script in the database so the
> user would pick the first column to be person.getCreateDate(), the
> second to be person.getName() etc.
> Using reflection I could generate on the fly which attribute will be
> displayed in which column.
A generic DTO will take care of the column selection for you by returning,
in the data structure, the column names that are coming back and their
relative position. A control designed to work with the same generic DTO
will be able to consume that data with minimal modifications. This is a
better route from a standpoint of testability and Time To Value (TTV).
>
>
> The other thing I need to change is it seems an unecessary dependency
> for the value object to implement ITableItem - there probably needs to
> be another class which does it and depending on the database values
> pulls the data from the value object.
A generic DTO (Data Transfer Object) removes this need. Even if I assume
your design, I would definitely want to avoid passing the ITableItem
implementation all the way down the stack to the value object.
>
> The same goes for the value object implementing the business rules.
> While probably not too bad if it does, perhaps mapping the values to
> something that does might work better.
IMO, value objects do not implement business rules... business objects do
and, for the sake of efficiency for set-based operations and network data
load, you can and should move some of those rules into the database layer.
Not in the value objects.
>
> Apart from the value object I am trying to anything else in all the
> code knowing about fields which are only used for CRUD e.g. createDate.
> CreateDate may never be used for logic - in my app - ever - so why
> pass it around as business objects - better to only have things
> implementing interfaces where needed.
No reason to pass them around normally. I have occasionally seen fields
passed to the U/I and back that were not used by the presentation layer, but
were used instead for data synchronization and concurrency control. Those
are valid purposes. Passing the last date changed and the id of the person
who changed it could be factored out if you think it is better. I guess it
depends on whether you want to use the same objects for the audit system as
you use for the transactional components. That's a tradeoff. Your call.
I hope this helps,
--
--- Nick Malik [Microsoft]
MCSD, CFPS, Certified Scrummaster
http://blogs.msdn.com/nickmalik
Disclaimer: Opinions expressed in this forum are my own, and not
representative of my employer.
I do not answer questions on behalf of my employer. I'm just a
programmer helping programmers.
--
|
| |
|
| |
 |
Robert Martin

|
Posted: 2006-7-7 2:17:00 |
Top |
java-programmer >> Ultimate enterprise design pattern for 3 tiered apps
On 2006-07-04 07:08:12 -0500, email***@***.com said:
> Goal: Database driven selection of controls on forms
> Goal: Business rules only aware of interfaces
> Goal: Presentation layer only aware of interfaces
It seems to me that you are looking for a meta-data approach. The
database, or some kind of configuration file[set] could describe the
fields to be maintained, and the controls that access them. Once you
have that worked out, these three goals become pretty simple to achieve.
In essense you will be creating a domain specific language for your
application. At first (according to goal #1 above) this DSL will
simply specify the controls on the forms, but I guarantee you that you
will find ways to start encoding business rules into that metadata.
This is not necessarily a bad thing, especially if the business rules
are volatile.
--
Robert C. Martin (Uncle Bob)牋| email: email***@***.com
Object Mentor Inc.?????牋| blog:牋www.butunclebob.com
The Agile Transition Experts牋| web:牋爓ww.objectmentor.com
800-338-6716????????牋|
|
| |
|
| |
 |
| |
 |
Index ‹ java-programmer |
- Next
- 1
- Java Web Start from CDRoedy Green wrote:
> On Sun, 19 Oct 2003 04:10:19 +0100, "Mike"
> <email***@***.com> wrote or quoted :
>
>>I don't recall having to do that once JWS is installed on the client. The
>>only thing that springs to mind is setting the mime type on a web server:
>
> I got friend to do a JRE install on a Java virgin machine, and lo to
> my delight, it set up the association.
>
> I now how have a self installing Java Web Start CD. I am 99% there. I
> think the problem has to do when you use trailing / and when you
> don't.
>
> You just put it in, and up comes the familiar dialog box about "do you
> Trust this Roedy Green fellah with this certificate."
>
> The key is this little C: program that autorun.inf
> kicks off.. It is crude but simple. It depends on 26 variants of the
> JNLP file being automatically generated.
In a platform-portable language, this is unbelievable. You've prevented use
of your product on anything but Windows.
--
Paul Lutus
http://www.arachnoid.com
- 2
- Advanced Tooltips in JavaHi
I want to implement dynamic interactive tooltips in java so that the
user can expand / collapse them. Also, if there are hyperlinks in the
tooltip text, the user should be able to follow up this link. For the
same purpose, I need to be able to catch any events associated with
tooltips.
I tried to search a lot on how to customize the behavior of tooltips in
Java, however couldn't find any useful information. Does anyone know
about how to proceed about this? Any suggestions / pointers would be
greatly appreciated.
Thanks,
Shraddha
- 3
- JSpinner causes trouble to JB 2005 designer...X-No-Archive: yes
Hi.
I try to build a GUI with the JB 2005 designer (JB 2005
Enterprise-Trial/Fondation version).
Basically it works until I want to add a JSpinner component. Then this
error happens: "null processing BeanInfo class
javax.swing.JSpinnerBeanInfo"
The component is not added. So I add it manually. But the rest of the
GUI components (following the JSpinner member variable) is mixed up
then.
Is there a workaround to this? Thanks.
-ric
- 4
- [encoding]Stupid question regarding encodingI have written a java plugin for an application that reads a file to execute
a series of actions ; when I parse my text file I check for the existence
of the following line "#HEADER" ; it works fine on my equipment ; on
Windows somebody working with the text file encoded in utf-8 told me that
there is problem as the line containing "#HEADER" is not found !
Now I am a little bit puzzled about all this :
(a) when you write java code and compile it what happens to the
string "#HEADER" because it will be used in the following test :
if (line.equals("#HEADER") {...}
where line is read from the text file with encoding as is on the machine
where the class is executed ? in other words you are comparing what to
what ?
(b) when with a Java app you read a text file can you get its encoding
format like utf-8 or ANSI or whatever to decide about some actions to be
taken ?
I think the problem could be easily solved by replacing "#HEADER"
by "_HEADER" but I have to go to the bottom of this to understand what is
going on.
Thanks
- 5
- Weird Problem w/ DecimalFormatThe following code snippet:
static DecimalFormat nf=new DecimalFormat("#####.00");
System.out.println(nf.format(1000.10));
sometimes stops working properly and instead of seeing 1000.10 I see 1000,10
(note the comma). I can't for the life of me figure out what is going on...
I'm using Java 1.3.1 on a Sun workstation.
Any ideas?
Cliff
- 6
- Serial Port CommunicationsI have a java application that I wrote that collects data from a
serial port on a laptop from a data collection device. Program works
well.
My bosses would like certain conditions to draw more attention than
just using the laptop's monitor. They would like two lights and a horn
to be controlled as well.
Tackling the serial input device was pretty easy, but I am not sure
where to start with this request.
1) I only have one serial port on the Laptop, but they want to control
4 devices (horn, light 1, light 2, data collection device). So how
do I handle that?
2) Where would I go to buy the other devices and what device would I
have my java program talk to in order to control them?
Thanks,
Larry
- 7
- Is Java really faster than Obj-C ? Should Apple dump Obj-C and go with Java?The old notion that Java on desktops is slow might have to go out the
window if more studies show this:
http://homepage.mac.com/spullara/rants/C1464297901/E775622191/index.html
Again, this points out the fact that there will probably be a
renaissance of Java on desktops as it percolates on Linux and Macs and
Windows desktops. We use Mac OS X iMacs at work and Java apps as
MoneyDance (a personal finance software that runs on all 3 desktops,
although it looks sorta crappy in windows) are very good looking and
extremely fast.
Now, if only IBM's open source eclipse made better looking SWT apps on
Mac and Linux...
- 8
- Socket error Windows getInputStreamHello,
Java version is 1.5.0_09. I am trying to connect from a Windows
machine to another Windows machine using sockets . Getting a socket
error for the following line. and throws EOFException
Socket s = null;
ObjectInputStream sin = null;
ObjectOutputStream sout = null;
s = new Socket( host, port );
sout = new ObjectOutputStream( s.getOutputStream() );
//write data to socket
sout.writeObject( req );
sout.flush();
InputStream is = s.getInputStream() );
sin = new ObjectInputStream( is ); // This line gives error
If I step into ObjectInputStream, I see:
public ObjectInputStream(InputStream in) throws IOException {
verifySubclass();
bin = new BlockDataInputStream(in);
handles = new HandleTable(10);
vlist = new ValidationList();
enableOverride = false;
readStreamHeader(); // This line gives error
bin.setBlockDataMode(true);
}
However, the same code works when I try to connect from Linux(Red Hat
Enterprise Linux WS release 4 (Nahant Update 5)) to Windows. Turned
off Windows firewall but no luck.
On the Windows Server I am trying to connect to a server agent waiting
on port 2002 that helps me connect to Citrix running on that machine.
The agent runs as a Windows service.
What could be wrong here?
Stack Trace
java.io.EOFException
at java.io.ObjectInputStream
$PeekInputStream.readFully(ObjectInputStream.java:2228)
at java.io.ObjectInputStream
$BlockDataInputStream.readShort(ObjectInputStream.java:2694)
at java.io.ObjectInputStream.readStreamHeader(ObjectInputStream.java:
761)
at java.io.ObjectInputStream.<init>(ObjectInputStream.java:277)
...
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:
202)
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:
173)
at
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:
213)
at
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:
178)
at
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:
126)
at
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:
105)
at
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:
107)
at
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:
148)
at
org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:
869)
at org.apache.coyote.http11.Http11BaseProtocol
$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:
664)
at
org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:
527)
at
org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:
80)
at org.apache.tomcat.util.threads.ThreadPool
$ControlRunnable.run(ThreadPool.java:684)
at java.lang.Thread.run(Thread.java:595)
- 9
- FREE JAVA GUIDE- free Java, j2ee, sql and plsql tutorialsThis site lists General Java tutorials and tutorials on specific Java
programming topics. This site lists fully documented java tutorials, java
servlets, JSP pages, and related Java technologies like sql tutorials and
plsql tutorials
All this at http://www.freejavaguide.com
--
Message posted via JavaKB.com
http://www.javakb.com/Uwe/Forums.aspx/java-setup/200604/1
- 10
- newbie with compilingHi
I am new to Java world, I download java version j2sdk1.4.1_01 to my
computer, and install it
when I try to compile program from command line type javac tst.java, I got
the following error
"Exception in thread "main" java.lang.NoClassDefFoundError:
com/sun/tools/javac/Main"
however, I can use textPad to compile it, when I try to run from textPad, I
got same error:
Thanks advance
Libin
- 11
- [OT] Project documentationWell, they _are_ all Java projects... but it's OT, I know. I need to get a
handle on project documentation. Can someone toss out some options for
generating documentation? What is (or could be) behind the numbered
chapter/section/subsection format of the various PDF files (specifications
and manuals) that I download?
I have so far adopted the xml and xsl transform found in many Apache and
Jakarta projects, and that has helped tremendously for HTML documentation,
but I need to be able to hand over a document and say 'this is what I'm
building'.
Thanks,
Wendy
- 12
- DOM tree questionHi all,
For code sample domEcho02.java, every element node will have an empty text
node like below. looks like there is no direct method in the treemodel impl
or in the adaptor class that I can control this. how can I get rid of it?
// sample xml node
<pnode attr1='0'>
<cnode1 att1='attr'><value>blah</value></cnode1>
</pnode>
// will be translated in tree nodes
element: pnode
text: (empty, unnecessary)
element: cnode1
text: (empty, unnecessary)
element: value
text: blah
//should be
element: pnode
element: cnode1
element: value
text: blah
TIA
-d
- 13
- Accessing the name of the CLASS/JAR file invokedHello,
I am trying to pack all my files into a JAR - this includes CLASS
files and other textual files such as help, std configs, etc.
I would like to be able to extract them from the Java app straight out
of the JAR - and for this I need to know what the name of the JAR file
invoked was (it might have been renamed for X reasons)
Is there any sure way to do this? (the alternative is to have an
external file to contain said data, but I want to know if a way to
have everything self-contained exists, first)
Thanks,
Andrew
- 14
- JSP web hosting companies?I have account at http://www.eatj.com/index.jsp. It is good one.
Daniel wrote:
> Does anyone know of web hosting companies supporting JSP?
- 15
- JButton layout - equal width with no absurd stretchThank you for taking the time to enlighten me. I have been searching
and trying different things but nothing seems to work for me. All I
want to do is have a column of JButtons to the left of a JScrollPane.
I want the buttons to have equal widths (the widest button at its
minimum text-fitting width, all others stretched to an equal width) and
be only as high as they need to be for their text. The scroll pane can
fill the rest of the width (and height for that matter). Something
like this:
+----------------------------------+
| |
| +--------+ +-------------------+ |
| | A | | | |
| +--------+ | | |
| | ABCDEF | | | |
| +--------+ | JScrollPane | |
| | ABCD | | | |
| +--------+ | | |
| | | |
| +-------------------+ |
| |
+----------------------------------+
I tried box layout, but then the buttons are not equal widths. Border
layout makes the buttons equal widths, but stretches them to be as high
as the scroll pane. Grid layout stretches them both vertically and
horizontally. I think I tried gridbag layout and had the same problem
as grid layout. The type of layout I want for the buttons reminds me of
how a table would layout in an HTML document. I want to avoid using
literal size values because of L&F issues on other platforms. Shrinking
the height of the scroll pane is not an option. Does anyone have any
suggestions?
|
|
|