Robert Wright

Greenhorn
+ Follow
since May 01, 2002
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Robert Wright

>> You can encapsulate the conversational state in an object and have it passed to the middle tier service? The middle tier can update the state and return it to the client. The client can update the state object and retry the invocation.

Yes this is a good idea. I have been thinking in this direction.
>>"conversation" in your last paragraph is what jumps out. We usually like true "service" components to be stateless.


Yes, "conversation" does present some problems. I have stateless session beans serving as the gateway to the middle tier so I can't really keep up with any sort of "conversation" there. Cookies are a pill but I am using JSF so I have a lot of persistent objects where I can stuff things.

One idea I had was this:

Webapp calls the back end. Back end throws a "MissingConfirmationException" when it sees a potentially dangerous operation. The exception contains the error message along with a key that identifies the confirmation uniquely.

Webapp displays the error message and the user gives an 'OK' on the confirmation.

Webapp makes up a "Confirmation" object with the key inside and passes it as a param into a new method call. The back end code looks into the "Confirmation" object and sees that the dangerous operation is OK and does not throw the exception a second time.

I was thinking about having this Confirmation object being passed back and forth with each call for multiple errors but Ilja's point about it being like a validation process argues for having the back end check for all such problems up front which would mean that if the process generated multiple confirmations they would all come back at once and could be confirmed at once.
>>Mhh, it sounds a little bit like all the conversation could actually happen before you start with the actual processing of the request? In that case, it sounds very similar to a validation process, doesn't it?

Yes it does, and that brings up a good point. I could require that programmers of the business logic processes look for these problems up front, before processing begins.
I am looking for some design pattern ideas for handling confirmations that are needed by potentially unsafe middle-tier business processes.

In the case of stock confirmations such as "Are you sure you wish to delete X?" that are always displayed, these are simply programmed into the UI. However there are some warnings that are generated in the middle tier and need to be passed back to the UI so that the user can read the warning and indicate that he wishes to perform this potentially unsafe action. There is also the potential that a process could generate more than one warning that need to be overridden.

Let's say a sales person places an order that would put someone over their credit limit. The sales person tries to enter the order and a warning is displayed that the order goes over limit. He indicates that he wishes to place the order anyway. Then a warning appears that an item in the order is out of stock and has no anticipated delivery date. The sales person indicates that he wishes to bypass this warning as well and the order is then placed.

There needs to be some sort of conversation here between the middle tier and the front end regarding these warnings and confirmations. The middle tier needs to pass the warning back to the UI. Doing this as an exception is the obvious way to do it. But then the IU needs to communicate to the middle tier business logic that the warning has been displayed and that the user wishes to proceed in spite of the particular wrinkle(s).

Can anyone point to a pattern that applies here? Keeping business logic and presentation separate is essential here.
Consider the following:
System.out.println(new BigDecimal(Float.MAX_VALUE));
produces the following:
340 282 346 638 528 859 811 704 183 484 516 925 440 (spaces added by me)
the line:
System.out.println(new BigDecimal(Integer.MAX_VALUE));
produces the following :
2 147 483 647 (spaces added)
Why is Float.MAX_VALUE so much larger than Integer.MAX_VALUE? Both are signed, 32 bit numbers, it seems that they would be about the same with Float holding a little less information since it has to keep track of where its decimal point is. This makes no sense to me.
This does come from a practical application, I am writing a routine to automatically extract size and precision information from db2 and then set up appropriate variables to receive the data.
20 years ago
Offhand I would say that the WebSphere certification would have more value right now. WebSphere was behind WL for a long time but they are now even in terms of market share.
This would tend to create more demand for WS people against a smaller supply.
You could also go for the core certifcations that Sun offers, Programmer, Web Component Developer and Architect.
Congratulations, that's an excellent score.
This is good article that matches up to my experiences in passing the exam.
http://www.javaworld.com/javaworld/jw-12-2002/jw-1206-architect.html?
"Consistent characteristics of successful and unsuccessful exam submissions" and "Top Submission Mistakes" is right on the mark and includes some things that I thought were important, but are not much mentioned in other places (neatness counts! Watch those typos!)
Give it a read if you are working on the exam.
Why don't you post some things about your submission, maybe we can give you some pointers on why it was weak. I am sure you can pass on your second attempt.
Read over the notes of people that passed and see how your submission compares.
I would definitely read Pet Store, not all of the source code but at least the architecture documents and see how they did things.
The book (and other useful resources) can be found at:
http://java.sun.com/blueprints/

Originally posted by Sanjeev Shahi:
Robert,
Congrats and thanks for your advice. Qustion
Book 2 metioned in following site
http://groups.yahoo.com/group/scea_j2ee/files/arch.htm
Book 2: Designing Enterprise Applications with the Java2 Platform, Enterprise Edition (Sun Microsystems Press). This book is a fairly easy read, and is the SUN BIBLE on architecturing J2EE applications. I would call you A FOOL if your submission did not follow the basic approaches detailed in the book (even if you don't agree with them.) The way I look at it, there is NO WAY Sun can fail your submission when you base it heavily on there own architecture book.

Is it free downloadable from internet If yes could you please send me an url for that.
thanks for your help.
Shivani

Originally posted by Yogesh Deshpande:

Can I ask you a question?How much experience you have in J2EE or IT as a whole?
Yogesh Deshpande


I've worked with Java/J2EE for some time, I was certified at the programmer level in 1998, developer level in 2000 with many years of experience in IT before that.
Very little formal training though, and no college. Mostly self-taught.
I just got back a 100% score on part II/III. Many thanks to those in this group; you�ve been a great help to me.
Here�s my advice.
JUST GET STARTED. Don't spend a lot of time wondering how much detail or what patterns or things like that. This is a "learn by doing experience" not "learn by thinking". Move through the complete design several times, improving it on each pass. It's OK if the first pass is awful, just keep refining it. Don't be afraid to tear it apart and start over if that is what is needed. You'll be surprised how much you will learn about design just by doing it.
Document your design clearly. I had several pages of written documentation. I included:
-- My assumptions (there were many)
-- Naming conventions (I had a clear set of conventions that I followed throughout the project)
-- Explanations of how the classes interacted and what jobs they did
-- What patterns I had used
-- Brief justifications of design decisions
Read carefully through the doc and make sure that you actually address each requirement that they give you at some point. Don't skip anything. Look over the "ilities" (Scalability, Maintainability, Reliability, Availability, Extensibility, Manageability) and see how your design addresses these.
COMMUNICATE. I spent a lot of time making the drawings look good. Use the same font family for everything and limit the number of styles and sizes that you use. Go for a simple, clean look. Make sure EVERYTHING lines up down to the pixel. (I used SmartDraw for the drawings). I didn't put a whole lot in each drawing; I broke them down into logical sections. Make sure your written docs read well, are cleanly organized and have no typos. Write, edit, re-write and edit again. Don't use any unnecessary verbiage. Make your English teacher proud. A major part of the job of an architect is to COMMUNICATE his design effectively. The person you have to communicate this design to is the examiner. MAKE THEIR JOB EASY.
Go over your materials for part I and apply them to part II. You will find a lot of things you can use.
I did everything "The Java Way," using patterns and solutions extracted from Sun documentation. I mostly did this because I treated the whole thing as a learning exercise. If I ran into a problem that I didn't know how to solve, I looked at the approaches taken in the Sun docs. I was always able to find a pattern that made sense to me (even within the Sun docs there is often more than one way to solve a problem.) Use the solutions that others have developed, don't just mis-understand what others have done and then spin off into "creative solutions."
Think things out for yourself. Can't decide whether to store client state in HTTPSession or Stateful Session Beans? How did others do it? What are the arguments for each approach? How do they affect your design? Work it out, make your decision and then put your reasons in your docs.
My best advice is to make a clear, well-organized presentation of a design that you feel confident in.
Resources
***
This was the best set of notes that I found.
http://groups.yahoo.com/group/scea_j2ee/files/arch.htm
You will probably have to join this Yahoo group to get access, it's free and it's a good group.
***
UML Distilled
http://www.amazon.com/exec/obidos/tg/detail/-/020165783X/qid=1039053826/sr=8-1/ref=sr_8_1/102-8314460-2186525?v=glance&s=books&n=507846
Don't get too fancy with your UML. Keep it simple. Spend some time checking over the UML in your diagrams and make sure it's "by the book."
***
This is the Sun study guide. It's not everything you need but it's worth the price.
http://www.amazon.com/exec/obidos/tg/detail/-/0130449164/ref=pd_sim_books_1/102-8314460-2186525?v=glance&s=books
****
Core J2EE Patterns
http://www.amazon.com/exec/obidos/tg/detail/-/0130648841/qid=1039054093/sr=1-1/ref=sr_1_1/102-8314460-2186525?v=glance&s=books
This one was very useful. Read all the design patterns in the book and understand them. See if you can apply them to your design. Mention in your documentation that you are using the pattern. Don't just use patterns just because you feel you have to. Find patterns that actually improve the design and use them.
****
These are some very good presentation slides that outline the Pet Store Architecture. Go over these carefully and find things to apply to your design. If you get stumped as to how to solve a particular problem, take a look at these.
http://groups.yahoo.com/group/scea_prep/files/Petstore%20Architecture/

******
There are a lot of helpful articles. Core J2EE Design patterns is good (on the Sun web site) as is Pet Store and the docs for it.
Mostly I would recommend that you get started. Do a "first pass" just to get your feet wet and get used to the design process. Then re-read anything you've read before and refine your design.
Does anyone else find something suspicious about �FlyByNight� airlines?
I call to your attention the following points:
1.) Why no web site? How can an airline get this far without any way to book travel online? Do they have some way to sustain cash flow without flying passengers?
2.) Why the name �FlyByNight?� Does this airline move only under cover of darkness? Why would that be?
3.) What exactly happened to the business analyst? Why is it that he is �no longer available to discuss the situation?� Could he have been asking too many questions? Have you ever noticed how many people post a lot of detailed questions to this forum and then seem to mysteriously disappear? Could it be that they too are, �no longer available to discuss the situation?�
It seems to me that there is a sinister sub-plot boiling beneath the surface at FlyByNight. I would caution others not to ask too many questions and be careful about any �assumptions� you may make.
I have to go, I hear a knock at the door�
You get results on the spot, when you finish your exam report prints out and you get a copy right then.
I can't say for sure if two month's study is enough or not, it depends on a lot of things like how much time you put into and how fast a learner you are.
Go over the various areas in the exam and make up your own set of study notes. Get a clear assesment of your weak and strong areas. Just keep moving through the material again and again until you are satisfied that you know it.