This week's book giveaway is in the Java in General forum.
We're giving away four copies of Helidon Revealed: A Practical Guide to Oracle’s Microservices Framework and have Michael Redlich on-line!
See this thread for details.

Eduard Jodas

Ranch Hand
+ Follow
since May 14, 2002
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
In last 30 days
0
Forums and Threads

Recent posts by Eduard Jodas

Preparing part II. I've been thinking about the use-cases and sequence diagrams. The use cases show some alternative scenarios, but there are much more. Some of them are pretty obvious like:

- what if two customers book the same seat at the same time? When are seats locked?

My idea is to ignore all this scenarios in my sequence diagrams since I don't know FBN policy, and just design a sequence diagram that matches what the use-cases say + assumptions I made while designing class and components diagrams. Maybe I'll add some notes about the most relevant scenarios ommitted.

Do you share my point? Anyone succeded with this strategy?
I passed part I last week with 85%. I have read Paul and Joseph book twice and the notes you can find in the yahoo SCEA study group. You can find the link somewhere in this forum.
I decided to take the exam when I got scores between 70 and 80 in the mock exams. In fact, I think Sun's exam is easier, since they tell you the number of correct choices in multiple choice questions.

I think this book is tough and dull, and less than clarifying. But, if you have patience and don't want to spend money buying several books, this covers almost everything.
I can not recommend Cade's because I haven't read it.
Sorry, but I completely disagree with the review of the book.
I have read the first four chapters only. Maybe the rest of the book is better, but this is my opinion, so far:
The book is very well organized and structured. It is very focused on passing the architect exam. And that is very good. The problem is that the contents are poorly explained. I think the authors fail to explain the subjects in an understandable way. Sometimes I think they just wrote some thoughts, without giving consistency. Sometimes things are explained twice or more times, without adding anything nor explaining better. Besides, there are errors, or misunderstandings, in the review questions. Some questions are not covered/explained in the corresponding chapter, or I'm completely unable to understand them. Till now, I have done the questions twice, one before reading the chapter and another after reading it, and the score has been the same.
In my opinion, if you don't know about J2EE this book won't help you much. If you already know enough to pass the exam, the book is too thick to be used as a review. If you are in the middle, as I am, you'll just get more confused.
I am a software engineer, SCJD, with more than 5 years experience developing OO aplications, some of them J2EE, and using UML. I think I should be able to understand the book and pass the exam.
Maybe I'm being too crude, but I'm really disappointed. I would like to hear from other people that have read the book.
21 years ago
And another question: did you followed strictly the Java Coding Rules?
P.d: Congratulations!
22 years ago
Try this links:
JavaServ
JavaService
I have never tried them myself, though
22 years ago


Are you going to stop accepting lock requests once a lock(-1) record comes in, or are you going to process them normally?


In my implementation if someone locks the database (lock(-1)) then all lock requests block until the db is unlocked (unlock(-1))
If a record is locked then a lock(-1) request blocks. Further record lock requests are accepted, though. Thus, the lock(-1) requester may suffer starvation, but I don't care since lock(-1) is a costly operation that may slow down all other clients and must be penalised, and the alternative is deadlock prone.
I don't think this is all very important, as long as you comment your decision and defend it.
I suppose you can use SwingWorker. I can't see anything against it in the assignment. Furthermore, the source code is available so you can change it to meet javadoc requirements and your coding rules.
I'd suggest documenting your decision, though.
I used a StreamTokenizer instead of a StringTokenizer. The StreamTokenizer is much more powerful, flexible and difficult to manage.
For example, it treads quoted Strings like "This is a String" as one token. So, no problem if there is a ',' in the middle. You can change the quotation character to be '.
I don't bother about that. In windows I just have to double click over the application jar file and it works. No need of environment variables like classpath. I'm sure other graphical OS work the same way.
The command lines are very easy:
java -jar <install-dir>/server.jar
java -jar <install-dir>/client.jar
They must provide the installation directory. This way my program works no matter the directory it has been installed in.
However, advice from those who have already uploaded the assignment would be welcomed.
I see know! I got confused! Sorry!
The problem is not the classpath. The problem is that Java can't find the jar file. In fact, if all your classes are inside the jar file, then you don't even need a classpath
I'm afraid the only way I know is using the full path like:
java -jar c:\amid\test.jar
If you omit the directory then java looks for the jar file in the current directory.
Look at the contents of your jar file using for example:
jar -tf <your-jar-name>
Sample output:
META-INF/
META-INF/MANIFEST.MF
myprogram/test.class

If your test class name and package is not displayed properly that means you haven't created the jar file correctly.
You can try with this command:
jar -cfm test.jar mymanifest -C myprograms\
This should work if myprogam/test.class is inside myprograms folder
From "The design patterns Java companion" by James W. Cooper:
[The Strategy pattern is much like the State pattern in outline, but a
little different in intent. The Strategy pattern consists of a number of related
algorithms encapsulated in a driver class called the Context. Your client
program can select one of these differing algorithms or in some cases the
Context might select the best one for you. The intent, like the State pattern, is
to switch easily between algorithms without any monolithic conditional
statements. The difference between State and Strategy is that the user
generally chooses which of several strategies to apply and that only one
strategy at a time is likely to be instantiated and active within the Context
class. By contrast, as we have seen, it is likely that all of the different States
will be active at once and switching may occur frequently between them. In
addition, Strategy encapsulates several algorithms that do more or less the
same thing, while State encapsulates related classes that each do something
somewhat different. Finally, the concept of transition between different states
is completely missing in the Strategy pattern.]
When using an executable jar the classpath is set inside the manifest file like:
Main-Class: ressa.GestorDatos
Class-Path: ./ lib/common.jar lib/mm.mysql-2.0.11-bin.jar lib/xmlParserAPIs.jar lib/xercesImpl.jar
Remember to press enter at the end of the last line
Note that the classpath is relative to the jar location
This works, at least, in Windows 98
Java provides you with a MergeSort. You can find it at the Collections class.
22 years ago
This is some of what I understand from what I have read about AspectJ:
1. It has an event-like mechanism that notifies you about method calls, field access/assignment, exceptions, etc. So you can know when a private field, not accessible from a test case, is changed. The same with private methods
2. It lets you define pre and post conditions
3. It lets you change a class, for example you can add methods to access private fields or to check the state of the private fields of a class. You can also add code before/after a method.
4. All this is done in separate files, so there is no need to modify the source code. You just need a development compilation and a production compilation -> clearer/cleaner source code and no performance decrease
Now I am going to read this article:
Aspectj and Testing