Entries:
Comments:
Posts:

Loading User Information from Channel 9

Something went wrong getting user information from Channel 9

Latest Achievement:

Loading User Information from MSDN

Something went wrong getting user information from MSDN

Visual Studio Achievements

Latest Achievement:

Loading Visual Studio Achievements

Something went wrong getting the Visual Studio Achievements

Discussions

cbae cbae
  • HTC 8X/8S

    I just found out that these devices are going to be branded as:

    "Windows Phone 8X by HTC" and "Windows Phone 8S by HTC"

    This looks like Microsoft's equivalent of the Nexus line of devices on Android. They're essentially being co-branded as both Microsoft and HTC devices.

     

  • Anyone get accepted for WP8 SDK yet?

    , wkempf wrote

    Some already have. It's been a very rocky road leading upto this big event (3 screens and a cloud coming together), and I know many very talented developers who've given up and moved on. There's bound to be a few more. I just hope things can settle down soon and that the vision proves out to be beneficial for all involved.

    Hey, that's more opportunity for those that stick it out then, as Ian is alluding to.

  • .Net versioning question

    @BitFlipper: BTW, whenever you release a new version of the API, you have to modify each of the 7500 methods with a new "if (version === n)" block anyway, right?

    If so, you can create a more generalized call for the "else" block by using a standard interface for all new versions of the API going forward. That way, you can keep the exist code for all the old versions of the API and have easier route of maintainability for future versions of the API.

  • .Net versioning question

    @davewill: He said that the method and type names are identical.

  • .Net versioning question

    , BitFlipper wrote

    @cbae: That works in theory but in practice is not possible due to there being 7500 methods as stated earlier. There is no way I can manually code that up. Also each call is quite a bit more involved than your example, with many external variables needed, so even just one wrapped method would be quite complex with many required arguments. At that point I might as well just stick with the original solution as it will actually be a bit less code overall (yet still way too much code duplication to be maintainable).

    I also said:

    That is if you don't want to simply change each of the Api classes to implement a common interface to begin with.

    If you don't want the extra wrapper you can make each of the Api classes implement the same interface.

    You don't have to do anything to the methods of the concrete classes. You need only change the class declaration, and all the existing methods that have the same signature as defined in the interface will automatically implement the interface.

    However, you will need to create the interface with all of the 7500 method signatures. That's the bullet you'll have to bite, but creating the interface would be just like creating a new Api class without having any code.

  • .Net versioning question

    @BitFlipper: I'm talking about something like this:

    public interface IApiWrapper
    {
        void DoSomething();
    }
    
    public class Api10
    {
        public void DoSomething()
        {
            //Do API-specific stuff here
        }
    }
    
    public class Api20
    {
        public void DoSomething()
        {
            //Do API-specific stuff here
        }
    }
    
    public class Api20Wrapper : IApiWrapper
    {
        public void DoSomething()
        {
            var api = new Api20();
            api.DoSomething();
        }
    }
    
    public class Api10Wrapper : IApiWrapper
    {
        public void DoSomething()
        {
            var api = new Api10();
            api.DoSomething();
        }
    }
    
    public class ClientApplication
    {
        private Dictionary<int, IApiWrapper> _Wrappers = new Dictionary<int, IApiWrapper>();
        private void Initialize()
        {
            _Wrappers.Add(1, new Api10Wrapper());
            _Wrappers.Add(2, new Api20Wrapper());
        }
    
        public void CallApi(int version)
        {
            var wrapper = _Wrappers[version];
            wrapper.DoSomething();
        }
    }

    Obviously, you won't be able to just new-up the instances in the Initialize() method if you want to read from configuration, but you get the idea.

  • .Net versioning question

    , BitFlipper wrote

    @cbae: I don't think this could work because what about the types? While they are identical in each case, due to .Net being strictly typed, Api10.ClassA is not the same as Api20.ClassA.

    That's why you have wrapper classes. Each wrapper class knows which specific API method to call. You use the wrapper classes to give you a common interface method to call in order to generalize the routine that does the Dictionary lookups.

    That is if you don't want to simply change each of the Api classes to implement a common interface to begin with.

  • Anyone get accepted for WP8 SDK yet?

    , Ian2 wrote

    I think some WP7 devs (who didn't get the SDK) might be looking elsewhere at the moment.  Hopefully for MS that is Windows 8 but I'm sure they will also be losing a few to 'Collateral Damage'.

    Do you think they would jump to different platform instead of waiting just a few weeks?

  • .Net versioning question

    @BitFlipper: Can you create wrapper classes (deriving from the same interface) that calls specific versions of the API? Then put each instance of these wrapper classes into a Dictionary keyed by the version number. Your calling routine can be generalized to simply look up the instance by version number in the Dictionary and then call the appropriate method exposed by the interface on that particular instance.

    The routine that populates the Dictionary can read the types from configuration and instantiate them dynamically.

  • Anyone get accepted for WP8 SDK yet?

    Maybe Microsoft hasn't fully implemented the certification process for WP8 apps yet. I'm sure there's a lot of automation to this process, and it stands to reason that it would take some time to implement.

    They probably don't want to have a flood of WP8 apps coming in that can't be certified and to have tens of thousands of developers getting angry. I think they'd just as soon have devs continuing to submit WP7.5 apps for as long as possible.