• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Concurrency Patterns

 
Davinder Kohli
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
There are quite a few concurrecny patterns out there which address the locking issues. I am wondering if it would be ok to use such a pattern? Sun states "..., but must not submit any code that is not your own work..."
Although this pertains to IDE tools generating code, but could it be percieved that the code we submitted is a plagarization of a code pattern described?
Thanks.
 
Valentin Tanase
Ranch Hand
Posts: 704
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I�m not sure if I understand you exactly, but from what I understand I suppose that your concerns are about using patterns similar to those used by the code generation tools, in order to produce similar class hierarchies (from a high level design perspective). Well if that�s the case then I�d like to mention that design patterns are successful solution to recurring problems that arise within a certain context (and I�m sure I�m not telling you anything new). Because they are also very generic they could usually be implemented in several different ways. So let�s say that the generating code follows the same pattern as your code and there is no plagiarizing here whatsoever. The question is whether following a similar (but not identical) implementation could be a problem or not. Well if the original implementation itself is quite unique, then I believe you might have a problem though and if I were you I won�t take any chances. On the other hand, if the original implementation follows a common approach I can�t see where the problem is.
 
peter wooster
Ranch Hand
Posts: 1033
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Davinder Kohli:
There are quite a few concurrecny patterns out there which address the locking issues. I am wondering if it would be ok to use such a pattern? Sun states "..., but must not submit any code that is not your own work..."
Although this pertains to IDE tools generating code, but could it be percieved that the code we submitted is a plagarization of a code pattern described?
Thanks.


The use of patterns is encouraged in all other areas, I use the MVC, Proxy, Adapter and Singleton patterns without concern for the fact that they are implemented in a manner that is very similar to the code published by Doug Lea or Craig Larman. As an example there are only two ways to make a Singleton correctly, one advocated by Lea, one by Larman, neither is your own code, but neither is a problem. These things are idioms, if they weren't already known you would have to invent them.

Would you avoid using a for loop just because it's described on page 14 of Kernighan and Ritchie? I know that's extreme, but avoiding these patterns is similar.
 
Davinder Kohli
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for your opinions, I am using the ReadWriteLock pattern, but it provides a generic solution, so I have augumented it to apply it to my problem domain.
For patterns like the singleton, the user has no choice but to use the code as is, for others like the facade or the adapter, these provide a strategy or approach. And patterns like the ReadWriteLock or the SingleThreadedExecution, provide more specific solutions. I was concerned if SUN would consider the use of these solutions as code plagarization.

Please excuse me if I have confused any of you out there.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic