On Aug 17, 2012, at 5:49 PM, Philippe Grohrock <philippe.grohr...@gmail.com> 
wrote:
> 1. Is it bad/good style to have a public class that implements global 
> variables?

How do you define "global variable"? :-)

`public static` fields are Very Badâ„¢, unless they're `readonly`. This is 
because there's no way to prevent modification of the field from anything else 
in your process.

`public static` properties are (generally) fine, and are common in the Base 
Class Library.

Best, though, is to keep things `internal` or `private` unless they _really_ 
need to be public.

> My program readys a DB connection right at the start which is queried by 
> multiple different GTK windows.

This is a case where `internal` should normally be preferred over `public`, 
unless another assembly in your app needs access to the value.

 - Jon

_______________________________________________
Mono-list maillist  -  Mono-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-list

Reply via email to