Poorna Lakki

+ Follow
since Mar 04, 2003
Cows and Likes
Total received
In last 30 days
Total given
Total received
Received in last 30 days
Total given
Given in last 30 days
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Poorna Lakki

I received my score and i passed with 98%. Here are the score details.
Section Summary Report:
General Considerations: Maximum=58 Deductions=0 Actual=58
Documentation: Maximum=20 Deductions=0 Actual=20
GUI: Maximum=24 Deductions=3 Actual=21
Server: Maximum=53 Deductions=0 Actual=53
Total: Maximum=155 Deductions=3 Certification Score=152
I am happy with the score and the result. :-)
Thank you guys for helping me out with my questions. I got a lot from the forum and I learned a lot.
Thanks again.
Sincerly,-Poorna Lakki
17 years ago

Originally posted by Narayanan Jayaraman:
What is the good practice/design for swing based menu application. I mean, based on menu selection I would like to display new screen /panel with in that frame. What is the best appraoch for this ?. Do I have to create multiple panels and attach to JFrameContentPane and make visible depends on menu selection ? If so , Is it possible to do that ?. or is there any other way. Appreciate your help. Thanks !!

Try using card layout. Its simple and works well for things u described.
Thanks,-Poorna Lakki
17 years ago

Originally posted by Andrew Monkhouse:
Hi Poorna,
Yes, this is desirable.
Normally what you have is one model. In the real world (not necessarily for this assignment) you may have multiple views for that model. Each view would normally send events to the model via it's own controller. If the model just "returned" data to the view via the controller, then the other view(s) will be out of sync.
The solution is the observer-observable design pattern.
The model is observable, and each view registers itself with the model as an observer. Whenever a controller sends an event to the model that modifies the current data set, the model will fire a changed event to each observer that registered with it.
There were some recent posts in this forum discussing limitations of the Observer interface & Observable class provided by Sun. They also discuss the whole MVC pattern fairly thoroughly. Try looking at MVC topic for more information.
Regards, Andrew

Actually that post was the basis of my design. I got confused by ur first post where u explained everything in the MVC model except for the interaction between the model and the view. But it is clear now. Now i feel a lot confident about my design.
Thanks for ur comments.
-Poorna Lakki

Originally posted by Andrew Monkhouse:
Hi Xin,
From Sun's design methodology blueprint describing MVC:

So the Controller is used to pass the user interactions from the View to the class that is going to handle it. For the assignment, most of these interactions will be passed to the model, however they could go to other classes. E.g. if you have online help, then when the user clicks the help button, then the action is passed to the controller, which will then pass it to the classes that handle the online help.
Regards, Andrew

Is it ok for the model to generate events for the view listeners. For example in one my views (Results screen) i initialize the results table data to zero rows when the application starts up. But as soon as the user queries for flights by using the search screen the model updates the results data with the new results and generates a event for the 'Results screen' to update its table model.
Thanks for ur time.
-Poorna Lakki

Originally posted by Rommel Agsulid:
I'd like to know if the user does a search with no input text, i.e. Origin=<blank> and Dest=<blank>, should I assume that its looking for all flights and display all the records in the database? Thanks for your help.

In my implementation i present the user with non-editable combo boxes for origin airport, destination airport and will construct the search criteria string based on the user selection. So, there will be no chance of user entering blanks. If u do it this way u donot have to assume blanks for all flights in the database.
Thanks,-Poorna Lakki
Hi guys,
In my criteria find method i specifically check for single quotes around the value in the key-value pairs using a regular expression. Does this mean i have to change it to support no single quotes around the value pair. If yes then the one thing I have to do is to use String.replaceAll() method as Max is suggesting.
Thanks,-Poorna Lakki

Originally posted by Max Habibi:
I think what Peter meant to say was 'I can't think of a single reason reason to make it static. However, I don't know everything. Can you please explain your reasoning'?

M, author
The Sun Certified Java Developer Exam with J2SE 1.4

I problem that i was trying to solve was maitaining a single instance of Data and LockManager. But i guess making is static is not the only way to do it. The only disadvantage of making it static (that i can see) is code change will be necessary in case we need another database instance pointing to another database i.e., another static variable pointing it to the new database.

Originally posted by Jane Weil:
Since local implementation is stand-alone, there is only one client, so we even don't need to make db static

u are right. No need to make it static. One more thing, if u make it static will it support multiple threads? I mean..will locking,unlocking still work? This could be a good test case for testing remote locking/unlocking.
-Poorna Lakki

Originally posted by Jane Weil:
Hi Mark,
According to your explanation to others, seems like my above solution is right? Is it? thanks.
Also I am of the advocate that since local mode is stand-alone, there is absolutely no need for any locking since the records would be locked by the same client anyway. There is no contention or concurrency here for the records.

U don't have to connect to the database for every client. Try having the connection to the database as a static object in FlybyNightLocalBrokerBean. (In the constructor if this static object is null then connect to the database.)
Thanks,-Poorna Lakki

Originally posted by lev grevnin:
Poorna Lakki,
You can use whatever you want to do the matching in criteria find. I used regex because it automatically checks for many different cases and makes sure your input string is correct. The matching is done in in fewer lines of code (although, the regular expressions themselves can be quite cryptic).

If the input string is wrong or badly formatted should'nt we return null. For example if the column names donot match or column values donot match "exactly" as in the table, i was thinking of returning null.
I just started my assignment so, this is the first iteration for criteriaFind(). Probably i will go with regex by the time i complete the assignment.
Thanks,-Poorna Lakki

Originally posted by Surya Gangadharan:
thank you so much.
i have actually gone through the whole java tutorial from sun and got a bit of an idea about regex from that. i will now code with the help of ur ideas.
thanks again

Do we need to use regular expressions? I mean, the requirements specifically say that the match needs to be exact. Is there any weightage in the exam for using regex. Any comments would be of great help.
Thanks,-Poorna Lakki