Search Results

Search found 5 results on 1 pages for 'marcof'.

Page 1/1 | 1 

  • Abstract exception super type

    - by marcof
    If throwing System.Exception is considered so bad, why wasn't Exception made abstract in the first place? That way, it would not be possible to call: throw new Exception("Error occurred."); This would enforce using derived exceptions to provide more details about the error that occurred. For example, when I want to provide a custom exception hierarchy for a library, I usually declare an abstract base class for my exceptions: public abstract class CustomExceptionBase : Exception { /* some stuff here */ } And then some derived exception with a more specific purpose: public class DerivedCustomException : CustomExceptionBase { /* some more specific stuff here */ } Then when calling any library method, one could have this generic try/catch block to directly catch any error coming from the library: try { /* library calls here */ } catch (CustomExceptionBase ex) { /* exception handling */ } Is this a good practice? Would it be good if Exception was made abstract? EDIT : My point here is that even if an exception class is abstract, you can still catch it in a catch-all block. Making it abstract is only a way to forbid programmers to throw a "super-wide" exception. Usually, when you voluntarily throw an exception, you should know what type it is and why it happened. Thus enforcing to throw a more specific exception type.

    Read the article

  • Ruby Shoes for non-trivial apps

    - by marcof
    I've been taking a look at Ruby Shoes for GUI development with Ruby. So far, it's been a pretty good experience for making simple apps. However, I am quite worried about being able to write large scale applications with it. For example, how would I go about using MVP pattern with this framework ? For now, I have not been able to not make presentation concerns leak into the view because of the lack of some kind of "data binding". I have code that looks like this : Shoes.app do @view = SampleView.new @presenter = SamplePresenter.new @view @label = para @view.sample_property button "Update sample_property" do @presenter.update_sample_property end end Here, the call to @presenter.update_sample_property updates @view.sample_property but the label is not updated accordingly. For this to work, I would have to make @presenter.update_sample_property to return a string, and then call @label.text = return_value, but I think that would violate the MVP principle of not having presentation logic in the view. I'm used to work in .Net with the MVP pattern so I don't know if the pattern applies correctly to Shoes like I tried to do. Are there any ressources out there for making non-trivial apps with Shoes ? Especially using the MVP pattern or something similar ? EDIT : I took a look at the shoebox to see what other people have achieved with the framework. Though I did not look through it extensively, at first sight it seems like they are all simple projects with no real purposes.

    Read the article

  • Google Analytics with multiple environments

    - by marcof
    We are planning to use Google Analytics in our organization and I am in charge for setting it up. I was wondering how to deal with multiple environments. We sure do not want to collect data during development and QA (or maybe collect data to a different analytics account), but we want to when the site goes to production (obviously). How do you deal with multiple environments and Google Analytics ? Do you setup multiple accounts for Google Analytics and use either one depending on the environement ? We're using ASP.NET 2.0, if that matters.

    Read the article

  • SQL server 2008 Log shipping Failback

    - by MarcoF
    I need to set up log shipping for about 10 databases. The primary server is accessed by our website and the secondary server is a BI server. What I am struggling to figure out at moment is the best way to handle a “failback” situation once a failover has occurred. How do I get the primary server back to being the main server for the website? Does anyone have any suggestions or best practices to handle a failback? We are using SQL server 2008.

    Read the article

  • Unzip password protected Zip file in SSIS

    - by MarcoF
    Does anyone know how to Unzip password protected files in an SSIS package? We have an SSIS package that currently use java.util.zip to unzip zip file and has been working perfectly for some time now. They now want to password protect the files and unfortunetly this library cannot do it. We are using a SQL server 2008 with .Net 3.5 on the windows server 2008 R2.

    Read the article

1