Flemming Mertz

Greenhorn
+ Follow
since Jul 15, 2003
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 Flemming Mertz

Hi!
The getSession() method is just short for getSession(true). So the only reason for using the version that takes a parameter, is to specify that you do not want a session to be created, if one does not exist already.
Regards,
Flemming Mertz
Hi there
I am not sure if I understand your problem. But at least I can try to guide you through the normal use of html:iterate, and then you can ask again, if I have missed your question entirely.
But to answer your question about the getter method, the answer is yes, you should have a getter method for the property you specify. The iterate snippet you supplied reads as follows.
Use the bean set in request or session scope under "rowsForm", and interate through the collection accesible through getIterator(). Make the current iterator item available between the <iterate> and </iterate> tags under the name "row", where is has the type "com.khod...".
As you can see, the iterate tag expects that there is a bean called rowsForm available in the request or session, and it has a get method for the iterator property. But you name for the bean, rowsForm, indicates that it is actually an ActionForm instance. In the case, you dont need to specify a name, but can access its properties directly. Your action form should of course have the getter method for the iterator property, and you should specify that the Action that redirects to your JSP page uses your ActionForm object.
I hope that this clarifies your problem a bit. If not, post a bit more of your ActionForm or bean, and a little more detail of your problem. Also you might want to check:
http://jakarta.apache.org/struts/userGuide/struts-logic.html#iterate
Regards,
Flemming Mertz
20 years ago
What could be cool, was if you supplied a short recap af the design decisions you made, that led to this result, instead of just the scores. In this way, a lot of the questions about design in here could be viewed in the light of the results gained using the designs.
Regards,
Flemming Mertz
20 years ago
Hello Chin Ho Tan
Sure, you could take that statement as such a hint. But I would not put a lot of meaning into that. Note, however, I am doing the FBN assigment, so I haven't got the full picture.
But even though the assignment states that the solution should be simple, I would be careful with the part about no reuse. One of the strong sides of good object oriented code is the ability to easily reuse the code. So be careful not to throw good coding practices away, just because you think the assignment says you can. As I read the quote you refer to, it states that you should not take any effort to create a huge framework, which main purpose is to offer possibilities for expansion and scalability. But still practice the virtues of modularity, encapsulation, inheritance and so on.
You should see the assignment as a possibility to explore all the right ways of solving problems, and creating good, understandable and easily maintainable code. This does not mean that is will be a non-simple and huge solution you create, only that it should be carefully though through. This is, at least to me, the feeling I get from the inclusion of the words �learning exercise� in the quote you include. So take the chance to teach the IT director, and yourself, all the right ways to code using Java. This Ranch will certainly help you do so.
Regards,
Flemming Mertz
Hello George
I haven't read the other topics about caching, but I don�t think that a cached database in this case needs to be that difficult to implement. Load all records into some in-memory collection, and then allow all the reads on it, but only write through to the file on actions that update the content. Note, that I am doing the FBN version, so this could be different in your version.
The above mentioned solution could be implemented quite easily, and give you a performance increase. Weather or not performance is an issue, that is the question, then. My assignment states that I should prioritize simplicity, and create code that a junior programmer could understand, over code optimized for performance.
But I think a scheme as outlined above would be simple enough. I do not think that it is necessary for the Developer assignment, however, since the scale of the application wont suffer from a bit of performance penalty. Cached or not cashed, I think both are acceptable. The important thing is to remember to describe your choice, and motivation for it, in the design decisions document.
Regards,
Flemming Mertz
Hello Nandini
Sounds to me like you are using a relative path to your file somewhere. If you have the access to your db.db file like this somewhere:
String path = "suncertify/db/db.db";
Then, as far as I recall, it means "/FromWhereIStartTheProgram/" + path, not where the file using the path is. So starting is from anywhere else than the root directory of the app, as you speak about, will prefix your path with that dir. In which case the server of cource can't find your DB file.
Just stating in the readme that the server must be started from the appropriate directory should solve this. Of course there are also better solution, but to be honest, I have not reached that part of the assignment yet. And it's been to long since I used File's for me to remember.
Anyone? ;o)
Regards,
Flemming Mertz
Hey guys
"One thing that I did notice you havent explained, and that is not clear given your comment about using Vectors, is how you are ensuring that only the connection which locked a record can unlock it. Care to comment on that?"
I would like to discuss this matter also. In my instructions, it says, regarding this issue:
"You are required to implement the criteriaFind(String), lock(int) and unlock(int) methods: " and:
"The unlock method simply removes the lock from the specified record. If an attempt is made to unlock a record that has not been locked by this connection, then no action is be taken."
I was thinking about maintaining a map of some sort, which should hold the record numers that was locked, and something describing the client that locked the record should be held as their value (hashcode, toString value or something).
However, this is not really possible if the lock method can only take one parameter. I would want to pass one more paramter, to identify the client calling the method.
Have anyone succesfully added a parameter to the lock and unlock methods, and passed? Or is it necessary to evolve into reflection or something, to get the callers ID?
Regards,
Flemming Mertz
GUI
He he, wasn't planning on copying the entire app, since the point of all of the Java Certifications, at least for me, is the learning experience.
However, having read your book, at lot of the design choices, and some of the code, stick in my mind. And some part of the code could be reused very well. For example, the 'splash screen' promting the user for a choice of remote og local connection, could be a good candidate for reuse.
So the question should have been, weather or not some of the code can be reused, without this leading to failure.
Regards,
Flemming Mertz
P.S. I think it is very cool that you guys take the time to answer question in here.. )
GUI
But for some assignments, for example FlyByNight, a lot, if not all, can be used. Have anybody 'copied' this example and passed?`
Regards,
Flemming Mertz
Hello Andrew
>The way the instructions were written, I got the impression that they >wanted a semi standard interface that could be used for automated testing.
This, the automated testing, and perhaps automated failing, was exactly what I am afraid of. So I think I'm going to play it safe, and just continue with class supplied by the assignment, and then perhaps bitch a bit about the greatness of using beans in the readme.txt.. ;o)
Thanks,
Flemming Mertz
Hello all
I have the old FlyByNight assignment, but I guess that by question is relevant in all assignments.
I was wondering if anyone has mapped the supplid data structure into beans? In my case the methods in the supplied databse returns something called a DataInfo object, which contains the data. This is, however, stored in an array of Strings.
What I would like to do, is create an adapter for this class, that offers the same methods as the original database class, but converts all DataInfo object to some bean class, mapping the properties of the databse. This would, to me at least, make the data more convenient to work with.
Now, my problem is that the instructions states that my client should offer all the public methods of the original Database class. If I do as i describe above, I will offer all of the same methods, but not with the exact same method signature, since all DataInfo objects will be replaced with FlightInformationBeans, or what I choose to call my bean.
Are there anyone here that has taken this approach? Or what do you think about it?
Regards,
Flemming Mertz