IRC Networks
Irc Logs Stats
Start date: 2007-09-27 02:48:27
Last update: 2008-10-24 20:19:38
Channels: 41
Logged Lines: 6230436
Size: 1825.67 MB
Powered by
Channel Info
Network: freenodeChannel: #csharp |
Search in www.irclog.org
Log from #csharp at freenode 2006-08-01
[18:57]<azyfm>Singletons are mostly just globals with a fancy name
[18:57]<azyfm>and globals are evil, mkay?
[18:57]<cjmgrug>they're evil?
[18:57]<azyfm>globals? sure
[18:57]<rwyfcygs>Singletons aren't
[18:58]<rwyfcygs>Well, unless you allow global access to public properties in them :-)
[18:58]<azyfm>but you do
[18:58]<rwyfcygs>Yes, but not *write* access, if you know what's good for you
[18:58]<azyfm>public static Singleton Instance{ get{ return _instance; } }
[18:58]<cjmgrug>suppose, in n-tiering apps, you have a worker class.. whats the harm in making designing that as a Singleton ?
[18:59]<rwyfcygs>Can't multithread it
[18:59]<azyfm>the harm might be in assuming that a "worker class" is a good design
[18:59]<-- dvxn|syzzzyus xzs>http://www.bagdadsoftware.de")
[19:00]<azyfm>also, using singletons make code hard to unit test
[19:00]<drdyrrr_>Singleton is overused rubbish
[19:00]<azyfm>you can't really do dependency injection when your code relies on singletons
[19:00]<cjmgrug>oh, i learnt that from people here, that 'dont make a form work hard'.. i mean, in GUI apps, pass on the cpu intensive things to the worker
[19:01]<drdyrrr_>also singletons can't be overridden and extended...
[19:01]<azyfm>so the form class has a reference to some controller class
[19:01]<azyfm>we call them "UCP" classes at work
[19:01]<azyfm>for "Use Case Process"
[19:01]<cjmgrug>ok..
[19:01]<azyfm>absolutely no reason for them to be singletons
[19:02]<drdyrrr_>it disappoints me that the .net framework doesn't use patterns more often
[19:02]<drdyrrr_>the java io system is pretty elegant with it's decorators etc.
[19:02]<drdyrrr_>.net's io system is fugly.
[19:02]<azyfm>uhm, the .NET IO types are decorator-based as well
[19:02]<cjmgrug>what do you mean by 'decorator-based' ?
[19:03]<azyfm>that they are based on decorators
[19:04]<drdyrrr_>it's a design pattern - go google.
[19:04]<cjmgrug>google just told me decorator is a pattern..
[19:04]<cjmgrug>haha, damieng_
[19:04]<azyfm>damieng_: Framework Design Guidelines has some insight into the design of System.IO
[19:04]<zyccus>CodeRun: look on the c2 wiki
[19:05]<cjmgrug>ok rikkus
[19:05]<drdyrrr_>Arild, as well as an apology iirc.
[19:05]<drdyrrr_>which is weird considering they didn't apologise for CodeDom
[19:05]<azyfm>What's wrong with it?
[19:06]<drdyrrr_>there is no reference between the classes for a start.
[19:06]<drdyrrr_>so you define a variable in one line of code....
[19:06]<drdyrrr_>and then when you want to reference it you have to create another object...
[19:06]<zyccus>CodeRun: http://c2.com/cgi-bin/wiki?DecoratorPattern
[19:06]<drdyrrr_>with the same "name"
[19:06]<azyfm>Linus Torvalds: "For example, I personally believe that „Visual Basic” did more for programming than „Object-Oriented Languages” did. "
[19:07]<drdyrrr_>instead of being able to reference the definition, access a property/method on the definition, or pass the def to the ref object
[19:07]<azyfm>Well, at least you can't blame them for not dogfooding CodeDom
[19:08]<drdyrrr_>well it's used in the component model stuff yes.
[19:08]<drdyrrr_>but certanily not by intellisense
[19:08]<azyfm>it's used by the designers
[19:08]<drdyrrr_>here we go....
[19:09]<zyccus>anyone know how to find the (usually) c:\Documents and Settings\ directory path from .NET code?
[19:09]<azyfm>`?
[19:09]<drdyrrr_>CodeMemberField privateField = new CodeMemberField(childClassName, "somevariablename");
[19:09]<drdyrrr_> CodeFieldReferenceExpression fieldExpression = new CodeFieldReferenceExpression();
[19:09]<drdyrrr_> fieldExpression.TargetObject = new CodeThisReferenceExpression();
[19:09]<drdyrrr_> fieldExpression.FieldName = privateField.Name;
[19:09]<drdyrrr_>mmm nice.
[19:09]<azyfm>rikkus: return Path.Combine( Environment.GetFolderPath(
[19:09]<azyfm> Environment.SpecialFolder.ApplicationData ),
[19:09]<azyfm> ConfigLoader.CONFIGDIRNAME );
[19:10]<zyccus>ConfigLoader?
[19:10]<azyfm>it's just a constant
[19:10]<drdyrrr_>you should be able to do CodeFieldreferenceExpression fieldExpression = new CodeFieldReferenceExpression(privateField);
[19:11]<drdyrrr_>or
[19:11]<azyfm>the GetFolderPath call's what's important
[19:11]<zyccus>Arild: that gives me: C:\Documents and Settings\rik.SAFEWARE\Application Data
[19:11]<zyccus>Arild: but I just want C:\Document and Settings\
[19:11]<drdyrrr_>CodeFieldReferenceExpression fieldExpression = privateField.GetReference();
[19:11]<azyfm>What for?
[19:11]<zyccus>Arild: because I really need c:\documents and settings\machine_name\aspnet\local settings\temp
[19:12]<zyccus>and I'm trying to find a satisfactory way to get it
[19:12]<sdnffdxdlld>SpikeLite msdn2 combobox OnPaintBackground
[19:12]<slycnlyvn>smellyhippy, ComboBox Methods (Microsoft.Office.Tools.Excel.Controls): http://msdn2.microsoft.com/en-US/library/microsoft.office.tools.excel.controls.combobox_methods.aspx
[19:12]<sdnffdxdlld>pft
[19:12]<azyfm>Path.GetTempPath()?
[19:12]<sdnffdxdlld>SpikeLite msdn2 system windows forms combobox OnPaintBackground
[19:12]<slycnlyvn>smellyhippy, ComboBox Members (System.Windows.Forms): http://msdn2.microsoft.com/en-us/library/system.windows.forms.combobox_members.aspx
[19:12]<zyccus>Arild: I'm not that user
[19:12]<drdyrrr_>%temp%
[19:12]<zyccus>Arild: so I can do that - but I have to call an ASP.NET application to do so
[19:12]<zyccus>which is what I currently do, actually
[19:13]<azyfm>in any case, you could always do two Path.GetParentDirectory() on what you get back from GetFolderPath
[19:13]<zyccus>Arild: I could, but I'm not sure what's changed in Vista... I could find out, but then it's still a bit of a hack
[19:13]<azyfm>it's sort of ugly, though, it's possible to move the profile so it's not under C:\documents and settings
[19:13]<zyccus>yep
[19:13]<zyccus>some companies have done that
[19:13]<zyccus>and this software will have to cope with that
[19:14]<azyfm>impersonate the ASP.NET user, then call GetTempPath()?
[19:14]<zyccus>just been trying to do that...
[19:14]<zyccus>requires using loaduserprofile... which seems tricky
[19:14]<zyccus>from managed code, anyway
[19:16]<mjzymygj|pxjgn>hmm
[19:16]<mjzymygo>Anyone here played with Biztalk?
[19:19]<rdy-uxfn>is it possible that a method i declare with override isn't called?
[19:19]<rdy-uxfn>i mean that just the base class's method is called, not mine?
[19:19]<azyfm>not really, no
[19:21]<rdy-uxfn>but it looks like :(
[19:21]<azyfm>as long as the base class method is virtual, which it'd have to be for you to override it
[19:22]<rdy-uxfn>but i'd get a compiler error if it wasn't?







