- You do some databinding stuff
- Or add some validations on the accessor methods
After googling, the following tools generate a class with getter setter methods.
XSDObjectGen: This generates objects from a XML Schema. It generates property accessors backed up by public fields. It adds an XmlIgnore attribute on the generated property accessors which can be used by your application.
WSContractFirst: A Visual Studio Addin and Command Line utility to enable Contract (WSDL/XSD) first web services development.
svcutil: A Windows Communication Foundation tool. Though this generates classes targetted to be used from WCF this can be customized a bit.
WSContractFirst looks like a good solution to my requirement.
Also on the list is the WSDL tool customized from Mono by Brian Ritchie. But the download link seems to be down. Anyway WSContractFirst looks like a good option. Anything like a CodeSmith Template on this side which is more customizable will be great, and I am googling without much luck on this.
Prakash is linking to some great stuff on Artima. A good read.
Among developers, design patterns are a popular way to think about design, but what is the proper way to think about design patterns? In this interview, Erich Gamma, co-author of the landmark book, Design Patterns, talks with Bill Venners about the right way to think about and use design patterns.More here….
Nice entry from Prakash. It takes atleast 30 minutes though
It is well worth ten minutes as it tells you how to learn, write and think more clearly
Assume two threads want to acquire a lock. Say thread 1 aquires it first. Thread 2 would like to know when Thread 1 has released the lock. This is the second case of inter thread communication issue which we discussed in the Multi-Threading basics – Setting the state article.
One way is to poll continuously to check if Thread 1 has released the lock. This solution would result in wasting precious CPU cycles. There should be some way to make a thread wait till someting of interest happens and be notified of the event of interest. The waiting thread becomes notified and awakens when the event occurs without resorting to polling.
As we discussed earlier kernel objects are either signalled or non-signalled. The Win32 API WaitForSingleObject puts the calling thread into Wait till the kernel object passed becomes signalled. If you call WaitForSingleObject passing a signalled object, the calling thread can run. If you call WaitForSingleObject passing a non-signalled kernel object the calling thread has to wait till the object becomes signalled.
The same is encapsulated in the object oriented .NET Framework by the WaitHandle class. A WaitHandle can be either in a signalled or non-signalled state. WaitOne stands in as a equivalent for the WaitForSingleObject Win32 API. If you think the discussion is at a too abstract level then that’s because this WaitHandle is an Abstract class. Mutex, AutoResetEvent and ManualResetEvent are concrete classes which derive from Waithandle and provide you waiting abilities.