aspose file tools*
The moose likes Developer Certification (SCJD/OCMJD) and the fly likes What does Oracle think about getting assistance Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Certification » Developer Certification (SCJD/OCMJD)
Bookmark "What does Oracle think about getting assistance" Watch "What does Oracle think about getting assistance" New topic
Author

What does Oracle think about getting assistance

Anayonkar Shivalkar
Bartender

Joined: Dec 08, 2010
Posts: 1509
    
    5

I would like to know few further things:

1) Since I'm using Monkhouse's book as sole reference, would there be any problem of Oracle thinking as I'm copying the code. Of course, the code from book is very different, however, my underlying design is very much similar to given in the book. e.g. I'm having equivalent classes (DVDFileAccess by him, ContractorFileAccess by me etc.). Also, generic methods like read, write etc. are not much different (though most of important methods are having different signatures : thanks to Oracle for providing ready made interface). Also (I've not developed it yet), but I don't think there would be much difference in RMI and (especially) GUI code from him and mine (same thing I thought during DB design and code is pretty different now). So my basic question is, if I use exact same design patterns from his book (method signatures and hence code would be different) would it be considered as 'copying'? Because in RMI and GUI, there won't be much difference - only class type, button layout etc would be different. I went through 'copying Monkhouse' thread here, but still I'm worried about RMI and (especially) GUI. Please help.

2) In RMI, my current plan is : to create a class which would implement given interface, and methods of that class would take care of all underlying DB operations. Also, I'm using object of that class ('Data' class) as client identifier. So,
a) Does each client get different object of that class?
b) When a client is connected to server, is there a guarantee that during all client's operations, the 'same' object will be working for that client(unless client explicitly create new object)?
I know those questions are very naive (and more RMI specific than OCMJD specific), but I'm very amateur in RMI

3) Monkhouse has a problem in his writing logic if two threads are simultaneously writing to file. both can get same offset and only 1 record would be written (and other would be overwritten). I think my code won't be having this problem (of course my code is slower than his, but it will contain valid data). Please comment.

4) Oracle states that code should be my own work, so asking questions at this detailed level in forums and using other person's classes for testing deadlock etc., is it officially allowed? I think it is fine as long as I'm not putting or asking actual code, but what does Oracle thinks? Is it considered as I took help from external entity etc.?

Thanks in advance.


Regards,
Anayonkar Shivalkar (SCJP, SCWCD, OCMJD, OCEEJBD)
Roel De Nijs
Bartender

Joined: Jul 19, 2004
Posts: 5402
    
  13

1/ The "copying monkhouse" thread is quite clear. I would be amazed if your GUI code would be just like the one in the book, because it contains redundant code, some classes are not completely finished,... So if you just copy/paste them without knowing what you do, you might be accused of copying. Of course for using the same name as in the book you won't be in trouble: if you need a dialog for configuration settings, you'll name it ConfigSettingsDialog and maybe 50% of all submitted assignments call their class that way, because that's how it should be called. But that's not copying.

2/ Is that approach necessary? Or are you just taking that approach, because it's in the Monkhouse book and it can be copied and pasted?

3/ They are not looking for the most performant solution, but you want a thread-safe one. So if you have one which is a bit slower, that's better than having a really, really fast one (e.g. without any synchronization) but producing a corrupt database file.

4/ I don't know why it would not be allowed to ask for advice? You still have to produce the code, because posting actual code snippets is not allowed (to prevent just copy/pasting a solution together). And in the real world you'll seek advice from colleagues, the internet,...


SCJA, SCJP (1.4 | 5.0 | 6.0), SCJD
http://www.javaroe.be/
Anayonkar Shivalkar
Bartender

Joined: Dec 08, 2010
Posts: 1509
    
    5

2/ Is that approach necessary? Or are you just taking that approach, because it's in the Monkhouse book and it can be copied and pasted?


Frankly speaking, since I don't know much about RMI, I might be asking wrong question. My only concern with RMI is : how to identify one client from another? (since we are not the one who control threading there).

But first, I'll get my RMI fundas in place and then ask for further assistance (if necessary). (meanwhile, all suggestions on above query are welcome)

Thanks.
Roel De Nijs
Bartender

Joined: Jul 19, 2004
Posts: 5402
    
  13

The first question you need to ask yourself: does the interface mentions a lockCookie? If it does, then you'll use that value to identify a client (request).
Anayonkar Shivalkar
Bartender

Joined: Dec 08, 2010
Posts: 1509
    
    5

The first question you need to ask yourself: does the interface mentions a lockCookie? If it does, then you'll use that value to identify a client (request).


That's the problem. The provided interface doesn't mention about lockCookie (and the solutions I read about were talking about lockCookie...)

Is there any way to identify client with RMI? or should I directly switch to socket for this? I chose RMI because I have to worry less things than in socket, but since I've not started network code (I'll start it tomorrow), as of now I have a choice - socket or RMI.
Roel De Nijs
Bartender

Joined: Jul 19, 2004
Posts: 5402
    
  13

I also had an interface without lockCookie and used RMI as networking protocol, so the combination is possible You can use a RMI Factory pattern (like described in the Monkhouse book) or you can introduce an extra method to set the id of the client before each request. I used the 2nd alternative and searching on setClientId will give you a bunch of hits about this approach.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: What does Oracle think about getting assistance