Azbel Eden

Greenhorn
+ Follow
since Oct 05, 2005
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
In last 30 days
0
Forums and Threads

Recent posts by Azbel Eden

Hello everybody.
What would be the best aproach to implement a Store-and-forward (SAF) JMS Client (message producer)? It is required because network downtimes are very frequent and SAF is a must. Unfortunely, the JMS Application Server used does not implement SAF on the client.

The initial aproach is to store the message in the file system and poll the server, when it's up again, send the stored message. This would be an independent Java program (in-house development). I think there would be a best aproach or workaround to solve this important feature. Maybe an open source project.

Thank you in advance.
Regards.
Yes, Scott. Direct call to EJB's (using proper delegates and server locator, of course) could be the choice. Web services as well, but it can slow down the performance on the client side from my point of view.

It is not required to have a immediate response from the server, that's why I thought in asynchronous messaging using JMS considering that XML is the message format to be sent. If a requirement here is not mandatory in designing a solution, I would propose changes, as removing XML and call the EJB's directly.

Thanks, greetings.
Azbel.
Hello fellows.
In order to have a solid knowledge and preparation to propose what J2EE techonology is the best for a certain situation, I would like to know what would be the best technology for the following scenario: hundreds of Swing-based clients connected directly to an application server (maybe propose connect to the Web server).

Other points to consider:
- Sent information is XML
- Thousands of transactions (orders) in the server
- Good performance is mandatory
- Connection protocol could be RMI-IIOP, HTTP over a VPN.

My initial approach is to implement asynchronous (for best performance) JMS message producers on the client side, leverage the JMS service of the application server and finally EJB MDB as JMS consumers to handle the application logic (transform XML and perform database updates).

Any thoughts?
Thanks in advance.
Hello fellows.
In order to have a solid knowledge and preparation to propose what J2EE techonology is the best for a certain situation, I would like to know what would be the best technology for the following scenario: hundreds of Swing-based clients connected directly to an application server (maybe propose connect to the Web server).

Other points to consider:
- Sent information is XML
- Thousands of transactions (orders) in the server
- Good performance is mandatory

My initial approach is to implement asynchronous (for best performance) JMS message producers on the client side, leverage the JMS service of the application server and finally EJB MDB as JMS consumers to handle the application logic (transform XML and perform database updates).

Any thoughts?
Thanks in advance.
Hello fellows.
In order to have a solid knowledge and preparation to propose what J2EE techonology is the best for a certain situation, I would like to know what would be the best technology for the following scenario: hundreds of Swing-based clients connected directly to an application server (maybe propose connect to the Web server).

Other points to consider:
- Sent information is XML
- Thousands of transactions (orders) in the server
- Good performance is mandatory

My initial approach is to implement asynchronous (for best performance) JMS message producers on the client side, leverage the JMS service of the application server and finally EJB MDB as JMS consumers to handle the application logic (transform XML and perform database updates).

Any thoughts?
Thanks in advance.

Originally posted by rehans oberoi:
hi azbel

congratulation.

can u tell us how to prepare for scjd assignment.
what are the initial steps for preparing.
which book should i read.
please reply ,
give your valuable advice , how to study in a planned way



Hello, rehans.
Thanks for replying. You need preparation before start designing and coding. I recommend the books:

- The Sun Certified Java Developer Exam with J2SE 1.4, by Mehran Habibi.
- The Sun Certified Java Developer Exam with J2SE 5, by Andrew Monkhouse.
- Java 2 Developer Exam Cram 2, by Alain Trottier.

Check on Amazon and search for related books. You can always learn from every of them. Once you start reading your assignment, I recommend to browse this forum and search for the most important topics of the assignment: locking, RMI, criteria find, etc. There are a lot of valuable material there.

Start by analyzing the requirements carefully, design, code and document. Test and refactor your code if necessary. I didn't use a specific methodology, but it was a mix of methodologies proposed in all the books I mentioned.

I spend 4 months in total. I have a job so I worked on the assignment on evenings and weekends. Just one pice of advice: be consistent, don't quit in the middle, otherwise you will finish the assignment in a couple of years.

Good luck! :-)
19 years ago
Hello, JavaRanchers!
I've got my results just 2 and a half weeks later! I took me 2 months to program and document the assignment plus 2 months learning and reading.

Here's my report

Test: Sun Certified Developer for the Java 2 Platform (310-027)
Date Taken: 2005-12-07 12:12:49.090
Registration Number: mablam5035
Site: mx54
Grade: P
Score: 359
Comment: This report shows the total number of points awarded for each section. The maximum number of points is 400, to pass you need a score of 320. Section Summary: Section Max Actual Points Points General Con: 100 90 Documentation: 70 62 OOD: 30 30 GUI: 40 27 Locking: 80 80 Data Store: 40 40 Network Server: 40 30 Total: 400 383

Thanks to Andrew Monkhouse, Peter Den Haan, Max Habibi and everybody in this forum for your support and collaboration. You're the best, guys! :-)

I'm just wondering if there are any other SCJDs in MEXICO. I live in Puebla city, Mexico!

Cheers,
Azbel Eden.
[ December 08, 2005: Message edited by: Azbel Eden ]
19 years ago
Hello, JavaRanchers.
I was about to upload my assignment when I noticed, after giving it a final review, that my MVC implementation seems to be weak. It is based on existing SCJD-related bibliography as Habibi and Trottier books. Despite my mental effort I've made the last months I think I would need to re-design my GUI and spend about a one week more to fix it.

Here's my aproach, it's quite simple:


As you can see, the inner actionlistener classes play the CONTROLLER role, since receive the events from the GUI (VIEW), make references to GUI components, as table and comboboxes, and call methods to my business services provider class, FlightManager (processes the DATA). This class has methods such bookFlight(), searchFlights(), closeConnection().

Do you think that this aproach is sufficient, or do I need to implement a less coupled implementation of MVC, such as Observer-Observable? Or simple try something else, will my simply implementation fail (loosing points)?

Thanks in advance.

P.D. How do I make the code block font smaller?
[ October 27, 2005: Message edited by: Azbel Eden ]

Originally posted by Seb Mathe:


That's what I was thinking about... Plus : maintain the existence of an interface. (Your service consumer just needs to know the interface, no ?)



Well, is the interface really required? I mean, I only coded something like this:

Originally posted by Seb Mathe:
Concerning the Data class, take care that Sun seems to do automated tests on it -> if you leave the lock/unlock method empty, it may result an automatic failure. (Imagine they have a test wich call your Data lock method, then try to deleted the record lock previously... )

Please confirm that you have at least something like "Your data access class must be called "Data.java", must be in a package called "suncertify.db", and must implement the following interface:..."

If so, you'll have to deal with the client Id... (read "Data client" Id)



No Seb, "Data.java" functional code is provided and I must implement lock(), unlock() and criteriaFind() methods. The requirement says "Part of your assignment will be to enhance the Data class. You may do this by modification or subclassing, but you should document the approach and reason for your choice."

My original aproach is to both modify it and subclass it. Data by itself would only be used in local mode so lock() and unlock() would not be required. The DataInterface remote implementation does implement both methods since they are required.

I think that just modify it and implement all the methods is correct, too, since lock() and lock() methods would only be used in remote mode. It just depends on the choice you make and provide the reason for it.

Originally posted by Seb Mathe:

I think an other solution would be to have 2 implementation of your Service interface : a local one and a remote one...

And if there a lot of redundant code between the 2 classes, you can have an abstract implementation too.



Mmm... Interesting solution, Seb! I think it is a good idea. Plus, what about making the FBNServices class abstract, include all service implemented methods (one called book() which has only the booking logic) and include an abstract empty method called bookFlight(). In the FBNServicesRemote class that extends FBNServices, bookFlight() should be implemented and includes lock(), book(), unlock(). In the FBNServicesLocal subclass of FBNServices, the bookFlight() implementation includes only book() call.

Regards,
Azbel.
Hello, Seb. Thanks for replying.

Originally posted by Seb Mathe:
Isn't it said in your assignement that your Data class must implements the provided interface (which, in my assignment, declares the lock & unlock methods).



In my assignment Data class doesn't need to implement this new interface I created. In my assignment, Data class complete code was provided with lock() and unlock() methods empty. I modified it, implementing the DataInterface, correcting the deprecated code and adding the criteriaFind() method with code. When I implemented DataInterface ONLY in the remote class I coded unlock() and unlock() methods by using the LockManager instance.

Originally posted by Seb Mathe:
It's an interesting question... Does your lock method return something like a cookie ?



I've read that new assignments the use of cookies is required. In my assignment, it is not. The only requirement is "If an attempt is made to unlock a record that has not been locked by this connection, then no action is be taken". Since I call lock(),[book logic],unlock() in the client side I think it won't be necessary to track the connection, but I'm still analyzing this.

Regards,
Azbel.
I would like to be more specific, exposing my main concern about my design. I have a class FBNServicesImpl in the client side which has methods such as bookFlight() and searchFlight(). I would like the bookFlight() method to behave differently depending on the connection mode. The difference is that in the remote mode the lock(), [booking logic], unlock() is used. OTOH, in the local mode only [booking logic].

What would be the more "elegant" or, just let say, the correct way to do that? How did you guys do that? I was thinking in making a subclass of FBNServicesImpl class called FBNServicesRemote and override the bookFlight() method by adding the lock(), super.bookFlight(), unlock() sequence. Another way would be just adding a condition in the FBNServicesImpl.bookFlight() method: if (it is remote mode) lock(); [booking logic]; if (it is remote mode) unlock(). Then no need to subclass.

Any thoughts? Thanks in advance.
Regards.
Hello, Java Ranchers!
I've finally made a decent design after reading so many valuable topics and discussions in this forum, and books. I think I finally have something I could share with you so you could comment or criticize. I'll appreciate any feedback :-)

DB
- DataInterface: Extends Remote. Interface defines all public Data methods but throws DatabaseException and RemoteException.
- Data: Implements DataInterface. Implements criteriaFind(), but not lock() and unlock().

CLIENT
- FBNServices: Interface used by the GUI, provides business services. Methods: book(), searchFlights(), etc.
- FBNServicesImpl: Implements FBNServices and its methods. Uses DataClient instance in all business methods.
- FBNServicesLocal: Extends FBNServicesImpl. Overrides constructor to get DataClient (local DataInterface).
- FBNServicesRemote: Extends FBNServicesImpl. Overrides constructor to get DataClient (via remote DataInterface) and overrides book() by calling DataClient instance methods lock()-> super.book()->unlock().
- DataClient: Class in client side that has same methods of DataInterface but throw DataClientException (Deal with RemoteException and DataException and throw DataClientException). Uses DataInterface instance (locally or remotelly instantiaded via a DataFactory).
- DataFactory: Creates DataInterface by methods getLocal() or getRemote().

REMOTE
- RemoteDataImpl: Extends UnicastRemoteObject implements DataInterface. Implements lock() and unlock(). Uses LockManager.
- LockManager: Holds HashSet of locked records. Methods: lock() and unlock().
- RegisterDataServer: Creates registry and binds RemoteDataImpl.

GUI
- ConnectionDialog: Uses FBNServices by instantiating FBNServicesLocal or FBNServicesRemote, depending on the user choice. Send instance to MainWindow.
- MainWindow: Uses FBNServices instance created in the ConnectionDialog. Inner classes BookFlight and SearchFlight (ActionListeners who play the controller in the MVC design pattern) use FBNServices instance to execute business services.

I'm deciding on using a Client ID and looking a mechanism to get an unique identified of every connection.

Thank you for spending your time reading this topic :-)
Best regards.
[ October 14, 2005: Message edited by: Azbel Eden ]
Thank you very much, Andrew.
I'll look into de forum to search topics related to the subject.

Cheers,
Azbel.