It's too late to do a design change and looking forward for a wrapper kind of approach or attribute. Anyway thanks for your reply. :)
sreejith ss nair
Posts
-
Object Isolation -
Object level isolation than lockingHi Pete, Implementing pattern at this stage seems to be bit difficult since most of the functionalities are in place. This specific lock functionality wasn't there and introduced later stages. I presume, it would be nice to introduce some kind of wrapper or attribute in type level which ensure the object level isolation. However, my sincere thanks for your time. Please do update me in case if you sketch something. :-D
-
Object level isolation than lockingHi 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. :-D
-
Object Isolation - .NETHi 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. :)
-
Object IsolationHi 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. ;)
-
Run a C# program in Dos windowIf u are using IDE to develop application then, while selecting a new project you can choose the project type. Select a console project type.
If the post/article served your purpose then, please assist me in keeping it up by donating a small amount of money to my Paypal account. Email: sreejithssnair@hotmail.com
-
How to do Format Excel Cells in C#Hi, In line with the last post, you can use this line of code to retrieve the value from a specified cell and use string format.
excelCells = (Excel.Range)excelWorksheet.get_Range("A1",Type.Missing); excelCells.Value2 = "File Name"; //set your logic here for formatting. String Format would do.
If the post/article served your purpose then, please assist me in keeping it up by donating a small amount of money to my Paypal account. Email: sreejithssnair@hotmail.com
-
inheritance issueHi, Sorry to tell you that, i am not getting what you are trying to achive appart from some class relation.
namespace CS { class Program { static void Main(string[] args) { B Obj = new B(); List _list =Obj.GetList(); } } /// /// base /// class A { protected int Age=0; public A() { } public A(int age) { this.Age = age; } } /// /// derived /// class B : A { public List GetList() { List GList = new List(); GList.Add(new A(21)); GList.Add(new A(22)); GList.Add(new A(23)); return GList; } } }
Presumably, the above lines of code will give an idea on the route map.If the post/article served your purpose then, please assist me in keeping it up by donating a small amount of money to my Paypal account. Email: sreejithssnair@hotmail.com
-
zooming a windows formHi, I presume that, you will get more response if you communicate your query precisely along with complete sentence.:)
If the post/article served your purpose then, please assist me in keeping it up by donating a small amount of money to my Paypal account. Email: sreejithssnair@hotmail.com
-
How to do Format Excel Cells in C#Hi, You might required to reach the required cells/range of cells to format the cells.
Excel.Application excelApp = new Excel.ApplicationClass(); Excel.Workbook excelWorkbook = excelApp.Workbooks.Open(File_Path, 0, false, 5, "", "", false, Excel.XlPlatform.xlWindows, "", true, false, 0, true, false, false); Excel.Sheets excelSheets = excelWorkbook.Worksheets; Excel.Worksheet excelWorksheet = (Excel.Worksheet)excelSheets.get_Item(fileName); Excel.Range excelCells; excelCells = (Excel.Range)excelWorksheet.get_Range("A1", "G1"); excelCells.Select();
The above example code will select a range of cells from A1 (column name) to G1 (column name). Now you have range of required cells to apply any specific format. Here let me explian some formating tips interms of Font style and name.excelCells.WrapText=true; excelCells.HorizontalAlignment=Excel.Constants.xlCenter; excelCells.Borders.LineStyle=Excel.Constants.xlSolid; excelCells.Font.Bold = true; excelCells.Font.Size = 9; excelCells.Font.Name = "Verdana";
If the post/article served your purpose then, please assist me in keeping it up by donating a small amount of money to my Paypal account. Email: sreejithssnair@hotmail.com
-
internal and internal protectedThese are access specifiers, If we use "protected" before a method/variable, it can be accessed only to derived class. If we use "internal" before a method/variable, it can be access only within the same assembly. So, internal protected can be accessed within the same assembly as well as in derived class. Hope this served your purpose.;P
-
Communicate between windows and linux boxHi, I have two different services; those are running under windows box and Linux box. Both Windows and Linux services had been developed by .NET by the help of respective SDK’s. Both business service systems are running fine based on its scope. But now, I wanted to implement a communication channel or some mechanism, which will help these different services to share objects/data. Apart from that, I am not allowed to use web interfaces to facilitate the communication since both windows and Linux machines resides in same intranet. Is it possible to communicate between two distinct OS environment using .NET remoting? If so, what could be the fine tuned way to achieve the same? What are the other possible thoughts to implement the same apart from remoting and web service? Any thoughts / url/ sample application will be appreciated. Thanks in advance.
-
Sending the active window to the printerIs it something like form printing ? If so, read this article.:laugh: http://www.c-sharpcorner.com/Code/2003/March/FormPrinting.asp[^] http://www.ondotnet.com/pub/a/dotnet/2002/06/24/printing.html[^] -- modified at 8:27 Wednesday 22nd March, 2006
-
WatermarkAny idea on xsl watermark.:confused:
-
London Get TogetherYes Nish. This move is permanent. And will be here for comming days.:-D
-
London Get TogetherI would really appreciate, if we could arrange a get together in cost effectiveway.:laugh:
-
London Get Togetheri appreciate that..;P
-
London Get TogetherGreat...:-D. What about meeting place and topic of discussion ?
-
UK get togetherhi Colin, Thanks a lot for your responce. Looking forward for a positive responce. Thanks and have a great New Year..:-D
-
UK get togetherIs there any meeting in London on december ?:laugh: