Click here to Skip to main content
15,886,110 members
Home / Discussions / Design and Architecture
   

Design and Architecture

 
GeneralRe: Managing Application ImageLists Pin
Tristan Rhodes3-Mar-08 4:25
Tristan Rhodes3-Mar-08 4:25 
GeneralRe: Managing Application ImageLists Pin
Pete O'Hanlon3-Mar-08 4:51
mvePete O'Hanlon3-Mar-08 4:51 
GeneralClient / Server Design Pin
Member 368144327-Feb-08 23:34
Member 368144327-Feb-08 23:34 
GeneralRe: Client / Server Design Pin
Pete O'Hanlon28-Feb-08 4:48
mvePete O'Hanlon28-Feb-08 4:48 
GeneralRe: Client / Server Design Pin
led mike28-Feb-08 5:15
led mike28-Feb-08 5:15 
GeneralRe: Client / Server Design Pin
Paul Conrad29-Feb-08 7:33
professionalPaul Conrad29-Feb-08 7:33 
AnswerRe: Client / Server Design Pin
Steven Campbell5-Mar-08 10:10
Steven Campbell5-Mar-08 10:10 
GeneralObject level isolation than locking Pin
sreejith ss nair26-Feb-08 21:07
sreejith ss nair26-Feb-08 21:07 
Hi there,
This query is with respect to the isolation of object in a collection. And like to hear couple of approaches those are feasible in such scenario.

First, let me explain the problem which I am facing at this time. Our application has few rules (objects in concize) associated with few entities, those are editable for all currently active users (U1, U2). Assume that, we have 2 rules (R1, R2). Our requirement is no two users can edit, delete or modify a specific rule at same point of time.

Eg: If U1 update R1 then U2 has to wait till U1 release R1. If U1 update R2 then U2 have provision to update R1 since R1 is not locked by any user. I hope you are clear about the requirement.

Now, to ensure the above discussed functionality we implemented a method which uses Interlocked Class in threading namespace (VS.NET & C#). This approach in fact helps us while avoiding concurrent user access over a specific instance on a specific time using some flag value. But the problem is, it locks the entire rule collection (R1, R2) even thou there is no concurrent user. I presume, this is because of the way we model the class and is a collection (rule collection).

Eg: If I have N rules in rule collection, it doesn’t mean that I need to lock all N rule objects in the rule collection. But I only need to lock specific rule (subset of rule collection), those are currently used by some logged users. And ensure all other non affected rules are free from lock.

I did have a thought on the object level locking using .Net object locking mechanisms. But this is practically impossible to implement locking mechanism for each and every functionality.

FYI: It is small product which has 54 projects (30 services, test projects, script) in C#.NET. And the product has its 70% of functionalities in place. So a major rework in object level is not practical at this moment since it has to go through lot of review and regression process.

I hope you are clear with respect to the problem statement.

Can you explain me which method would be feasible in such scenario ?
How will i make sure only the object lock is available for the object which is currently i use and not other objects in the collection?
And how will I ensure object level isolation than locking an entire collection?
Do we have any proved patterns for this kind of problems?
Thanks in advance. Big Grin | :-D
GeneralRe: Object level isolation than locking Pin
Pete O'Hanlon26-Feb-08 22:42
mvePete O'Hanlon26-Feb-08 22:42 
GeneralRe: Object level isolation than locking Pin
sreejith ss nair26-Feb-08 22:53
sreejith ss nair26-Feb-08 22:53 
GeneralRe: Object level isolation than locking Pin
Pete O'Hanlon26-Feb-08 22:57
mvePete O'Hanlon26-Feb-08 22:57 
GeneralRe: Object level isolation than locking Pin
Sameerkumar Namdeo2-Mar-08 16:41
Sameerkumar Namdeo2-Mar-08 16:41 
GeneralRe: Object level isolation than locking Pin
Steven Campbell5-Mar-08 10:19
Steven Campbell5-Mar-08 10:19 
GeneralXML Model Structure Pin
Tristan Rhodes12-Feb-08 23:33
Tristan Rhodes12-Feb-08 23:33 
GeneralRe: XML Model Structure Pin
led mike13-Feb-08 7:19
led mike13-Feb-08 7:19 
GeneralRe: XML Model Structure Pin
Tristan Rhodes13-Feb-08 23:29
Tristan Rhodes13-Feb-08 23:29 
GeneralRe: XML Model Structure Pin
led mike14-Feb-08 8:37
led mike14-Feb-08 8:37 
GeneralRe: XML Model Structure [modified] Pin
Tristan Rhodes14-Feb-08 22:24
Tristan Rhodes14-Feb-08 22:24 
GeneralRe: XML Model Structure Pin
Tristan Rhodes18-Feb-08 0:17
Tristan Rhodes18-Feb-08 0:17 
GeneralRe: XML Model Structure Pin
led mike19-Feb-08 9:53
led mike19-Feb-08 9:53 
GeneralRe: XML Model Structure Pin
Tristan Rhodes26-Feb-08 5:05
Tristan Rhodes26-Feb-08 5:05 
GeneralRe: XML Model Structure Pin
led mike26-Feb-08 5:50
led mike26-Feb-08 5:50 
GeneralRe: XML Model Structure Pin
Tristan Rhodes26-Feb-08 6:16
Tristan Rhodes26-Feb-08 6:16 
GeneralRe: XML Model Structure Pin
Pete O'Hanlon26-Feb-08 10:14
mvePete O'Hanlon26-Feb-08 10:14 
GeneralRe: XML Model Structure Pin
Tristan Rhodes26-Feb-08 22:27
Tristan Rhodes26-Feb-08 22:27 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.