Microsoft uses a particular process where they group API’s in two different categories required and optional. NET Standard Microsoft decided they would start with all the API’s covered in. NET Standard?Īt the start of the development of. NET Standard is very predictable because each higher version means more API coverage. NET Standard every API is supported on every platform. Even though the tooling helps you out with selecting the right API’s it still means you have to know each base class library. So how does this exactly differ from a PCL again? With PCL’s you select which platforms you would like to target and the tooling presents you with an API set that you’re able to use. For developers this means that they only have to know a single base class library. NET standard has only one base class library. Luckily Microsoft has a great solution for this. NET which requires you to know three different base class libraries in order to write cross-platform code. So the current architecture looks like the image below.Īs you can see there are three flavors of. NET framework was forked quite a lot over the years which caused a massive problem for developers since they weren’t able to target one unified class library. The Portable Class Library worked great, but Microsoft was feeling the need for a standard. With a PCL it was possible to create a shared library which targeted specific platforms, for example Xamarin.iOS. This was Microsoft’s answer on the whole code sharing problems. That’s where PCL’s (Portable Class Libraries) come into the picture. All jokes aside, this approach helped us a lot back in the days, but nowadays we really want a different approach that allows us to share a library (dll) across platforms. The following illustration shows the architecture of an application using Shared Projects.Īfter reading this example I actually have to take two showers to wash off the dirty feeling. Xamarin has a great example of how this works implemented in their Tasky application. If you would like to do some platform specific code you can do the following: ![]() ![]() So, how does this thing work? You start out with creating a project that has shared code in it and add the files as link into the project. The biggest disadvantage of this approach, in my opinion, is the lack of maintainability combined with not actually having a shared output library. Compiler directives are there to help implement platform-specific functionality in the shared code base. ![]() The code in a shared project is compiled as part of each referencing project. Shared Projects let you write common code that is referenced by a number of different application projects. However, personally, I think the way Shared Projects work isn’t that pretty and it is also hard to maintain. Shared Projects made it possible for us developers to share code across different platforms. Actually, the common way of sharing code was using Shared Projects. This is obviously one of the reasons we pick Xamarin for our mobile development.īack in the days Xamarin didn’t have a lot of code sharing options as they do now. When building a cross-platform application it is really important to be able to share code between the different platforms.
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |