Is there a way to intercept setters and getters in C#?

Not generally; a few options though; inherit from ContextBoundObject – which does allow this, but at a performance cost write an explicit property (i.e. with a backing field), and add a utility method call manually look at compile-time weavers, such as PostSharp – generally by spotting an attribute or similar look at runtime code generators, … Read more

IntelliJ getter/setter format (single-line versus multi-line)

I’m using IntelliJ IDEA 14.1.0 and you can customise this behaviour. Just use the “Generate…” option, or use Alt+Insert shortcut, and select “Getter and Setter”. In the “Select Fields” window that gets opened, you have the “Getter Template” option at the top. Use the “…” button next to the dropdown, to edit the template. Select … Read more

Shortcut for denoting or implying getters and setters in UML class diagrams

You are correct: there is no need to include the (noise of) “boilerplate” signatures of standard setters and getters in a class model. Unfortunately, UML does not define a standard notation for implying getters and setters for private attributes. So, you’d have to use your own convention. For instance, you could include a general explanation … Read more

tech