Jason Moors

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

Recent posts by Jason Moors

Hi Mark,

I agree with the Roberto and Roel, I don't think your approach would automatically fail but I'd be surprised if you didn't lose some marks, as I'm not sure how you could justify not checking the magic cookie, it's there to check you are opening file in the correct format, i.e. what would happen if didn't check the magic cookie and tried to open a Word document for example.

I definitely agree with keeping it simple, but not to the extent where I cannot reasonably justify implementing functionality.

Regards,
Jason
Hi Vaibhav,

I think the requirement means that the data class must implement all the methods provided by the interface, but that doesn't mean ALL the code has to be in the data class, for example you could create additional classes for reading the file, locking mechanism etc and call from the data class.

The only reason to extend the interface or implement another interface is if you need to provide additional methods.

Regards,
Jason
Your problem is with your declaration, PosService is an interface therefore you need to create a instance of PosJpaServiceImpl.

Current code



You need to create an instance of PosJpaServiceImpl in the declaration or try block before calling the getAllPos method.



Regards,
Jason
15 years ago
In that case take a look at jsptags pager tag it will run on JavaServer Pages 1.1 compliant Web Server/Servlet Engine

jsptags pager tag

Regards,
Jason
Hi,

You'll need to provide more information if you want us to help i.e. are you trying to develop your own pagonator tag, use an existing tag?

The following tag library maybe of interest.

jsptags Pager Tag Library

Regards,
Jason
Hi Laura,

It sounds as though you haven't implemented the locking method correctly, the requirement is wait until the record is unlocked, however it sounds like you are throwing an expection is the record is alreay locked, which might explain why you lost points for locking.

// Locks a record so that it can only be updated or deleted by this client.
// If the specified record is already locked, the current thread gives up
// the CPU and consumes no CPU cycles until the record is unlocked
.



Regards,
Jason
Hi Bruno,

J2ME does not depend on J2SE.

Java 2 Micro Edition (J2ME) is Sun's version of Java aimed at machines with limited hardware resources such as cell phones, J2ME combines a resource constrained JVM and a set of Java APIs for developing applications for mobile devices, therefore it does not depend on J2SE.

Regards,
Jason
15 years ago
Hi,

As long as you feel you can justify in your design decisions I think you'll be fine. Just remember that you are not allowed modify the existing find method signature of the interface, so you should add as an additional find method!!!

In my opinion it's not necessary and adds complexity, having said that many people have past the exam by implmenting the additional find functionality.

The requirements define two different search requirements but this doesn't mean that they both have to be implmented at the database layer. I implemented the standard find method in my data class and the exact match in my business logic layer.

It also depends on how you interpret the requirements, I only implemented the �AND� condition, so any records must match criteria for all fields that are not null.

My reason for this was that I couldn't see a sensible (or simple) way of implementing the �OR� condition with the current find method signature (without adding a new search method), and from an usability perspective it didn't make sense to me to support a search where you could allow the user to select a name of a hotel OR and location.

Jason
I agree with Jeffry, sounds like you've got a thread deadlock due to the different thread mechanisms. Windows performs time slicing where as linux will execute each thread to completion unless it leaves the running state.

Are you peforming yield in your code?

I'd suggest you check the order the threads are processed.

Jason
[ June 26, 2008: Message edited by: Jason Moors ]
Hi Aaron,

A possible solution if you don't want to handle the RecordNotFoundException in your find method is to create a new private method for actually reading the record which doesn't throw an exception, this method would return null array if the record is not found or marked as deleted.



This new method would then be called by both the read and find, the read method would check if the returned value is null and throw a RecordNotFoundException, and the find method could ignore null array and not add to search results.

Hope it helps,
Jason
[ June 23, 2008: Message edited by: Jason Moors ]
Hi Ewan,

I only implemented the �AND� condition, so any records must match criteria for all fields that are not null.

My reason for this was that I couldn't see a sensible (or simple) way of implementing the �OR� condition with the current find method signature (without adding a new search method), and from an application point of view it didn't make sense to me to support a search where you could allow the user to select a name of a hotel OR and location.

However one of my must requirements was :

Must allow the user to search data for all records, or for records where the name and/or location.


To me this requirement just means that the user can select :

  • Just the name
  • Just the location
  • Both name and location



  • I know alot of people have passed with this assumption, and just tried to keep everything as simple as possible, I felt that the find method signature doesn't enable the support of a complex search that you may find in a SQL database.

    Cheers,
    Jason
    [ June 23, 2008: Message edited by: Jason Moors ]
    Hi,

    Not sure it's the best approach as I'm no ergonomics expert, however I tried to model my layout to follow the booking process.

    1. Search
    2. Select
    3. Book

    Therefore I had the search critera panel at the top, followed by the table and then the book button at the bottom, this seemed logical to me as in my mind searching a booking were two seperate tasks.

    Regards,
    Jason
    [ May 09, 2008: Message edited by: Jason Moors ]
    Hi Jon,

    I actually developed a framework, which consisted of a number of different classes for the different areas of the screen, I think it would be difficult to justify that your design would easily support future enhancement if it was contained within one large method, not to mention that it's not very OO.

    Your user interface should be designed with the expectation of future functionality enhancements, and it should establish a framework that will support this with minimal disruption to the users when this occurs.


    Richard - I also wouldn't recommend using Netbeans to generate your GUI code, I'm not sure about your assignment but mine had the following statement in the deliverables section

    You are permitted to use any IDE tool you choose, but you must not submit any code that is not your own work.


    This requirement is must therefore I think you could potentially fail the assignment if you include generated code in your submission.

    Regards,
    Jason
    [ May 09, 2008: Message edited by: Jason Moors ]
    Hi Martin,

    I don't think there is necessarily a right answer, I personally looped through the records, as you mentioned you only need to check the delete flag byte, so you can skip record length number of bytes so I don't think the overhead is great.

    I guess other options would be to not implement the reuse or to maintain a list of deleted records, but this may complicate your design.

    I think as long as you document your decisions you should be fine.

    Regards,
    Jason
    Hi,

    Yes, I think your are making the right assumption, this was also my view on the requirements,

    Implementing 'AND' and 'OR' logic in Find method

    It must allow the user to search the data for all records, or for records where the name and/or location fields exactly match values specified by the user.


    The distinction I made was that the two requirements are to be implemented in different layers of the application.

    i.e You must implement the Data interface and therefore the find method should return the records that start with the search criteria supporting the ability to search EVERY field. Thereby keeping the data layer generic and not linked to search for location etc.

    However in your business layer you need to implement the business requirement and perform additional filtering of the returned records to ensure they exactly match name/location fields.

    Hope it helps

    Jason
    [ September 12, 2007: Message edited by: Jason Moors ]