The documented Sitefinity API is comprehensive and covers many development scenarios. As in any API, there is far more under the covers. This webinar will dig deep into unexplored areas of the Sitefinity API to reveal interesting and useful utilities and classes to make your job that much easier.
Note: this is the slide deck for a webinar comprised mostly of demos. I will update this description when the video is available.
3. Hidden Gems of the Sitefinity API
Special Guest
Svetla Yankova
Sitefinity Solutions Consultant
Email: svetla.yankova@telerik.com
Blog: www.sitefinity.com/blogs/svetla-yankovas-
blog
Twitter: @svetla_yankova
4. Process
Tools for Code
Mining
Risks
Demos
Closing
Q&A
Hidden Gems of the Sitefinity API
Agenda
10. Hidden Gems of the Sitefinity API
Attributions
Mining out of Silverton
Images licensed under Creative Commons Attribution 2.0 Generic
flic.kr/p/cpNZRj
Slide 3
by Adam Barhan
12. Thank You
Contact Us With Any Questions
Sitefinity
Telerik
Developer
Webinar
June 27, 2013
Chris Eargle
Technology Evangelist
chris.eargle@telerik.co
m
Notas do Editor
Hello, I don’t believe we’ve met. My name is Chris Eargle, and I am a technology evangelist for Sitefinity. My first month with Sitefinity was in May. Before that, I was a technology evangelist for the Just line of products at Telerik. You an email me at chris.eargle@telerik.com, and look for my posts on the Sitefinity blogs. Finding me in social media is easy. I am kodefuguru.
Our special guest today is Svetla Yankova, a Sitefinity Solutions Consultant who recently wrote about Single Sign On between Sitefinity and third party applications. You can email her at Svetla.Yankova@telerik.com, and she’s a regular contributor to Sitefinity blogs. Send her a shout out on twitter, @svetla_yankova.Svetla will answer questions while I’m presenting, and she may have a tip or two to throw in during the demo portion of this webinar.
My process for exploring an undocumented API is quite simple. I use a decompiler to search for interesting classes, and once I find something I want to use, I write a test application to make sure it works. Depending on whether I need it, or if I’m just goofing off, I’ll create unit tests to ensure it always works or I simply try it out in the smallest application possible.
I use JustDecompile to explore assemblies. Like Sitefinity, it is a Telerik product, but JustDecompile happens to be free. An alternative to using JustDecompile is to use the provisions provided by Visual Studio such as the Object Browser and IntelliSense. I prefer JustDecompile because it’s easier to navigate the maze of classes commonly found in huge APIs. I’ll use the features in the demo, and the difference is striking.Besides that, JustDecompile is a decompiler. .NET decompilers create a representation of source based on the object code, which is essentially the binary form of Common Intermediate Language, the true language of .NET, and the reason why I can load a VB.NET assembly in my C# project. A decompiler generates a representation because some information is lost during conversion. For example, your comments are not included in an assembly, and some language constructs do not have a true representation in intermediate language.Since JustDecompile provides me a representation of the code, I can more quickly determine if the class is useful to me.
I am sometimes asked if it’s legal to use JustDecompile on third party assemblies. And I understand this concern; no one wants to be sued for programming? I will share what I know, but I am not a lawyer, and this is not legal advice. There are issues with trade secrets and software patents, but every piece of software that is not in the public domain is copyrighted. This includes open source software whose licenses extends certain rights and obligations to the user. Copyright wouldn’t mean much if it didn’t prevent other people from copying your work. But as many of you are aware, software can be copied many times by a system. For example, copies are made in memory when you run a program, and backup software will often make backup copies of software as well. Therefore, most software is covered under a license to grant rights to perform these actions.Because of the manner in which software is used, many countries have made laws to the effect that copies necessary for running or backing up software do not violate their respective copyright laws. Many countries have also found that decompilation is allowed or necessary, particularly for the purposes of interoperability with other software.In the United States, Sega versus Accolade established that decompilation can be necessary and a right. My personal interpretation is that you can decompile a program if you have legitimate need to figure something out and you’ve found no other way to obtain the information.Europe, on the other hand, has established more restrictive regulations concerning decompilation. The program must be licensed to you and you must be decompiling specifically for the purposes of interoperability. You are not allowed to poke around other parts of the system out of curiosity, and you cannot share this information with the world.If you read technical blogs, you may have noticed that many people, including those in Europe, are decompiling and sharing useful information. Companies may have legal actions at their disposal, but they’re not going to use it if it affects their bottom line.Personally, I think it’s great when someone shows an awesome way to use Sitefinity, and I’m going to share your blogs and videos so others can make Sitefinity shine too. But you should be aware that the process I show you may violate your Sitefinity license depending on where you live and what you do with it. If you’re simply looking inside the assemblies to find useful API calls, there won’t be a problem. If you use a method signature in a blog post, there won’t be a problem. If you publicly release a representation of the implementation details, well, that *is* a problem. Don’t do it.
The biggest risk of using undocumented features in any program is that the company has no obligation to supporting it, and it could be removed or significantly changed at any time.The risk may be worth it. Even if the undocumented portions of the API you’re using are removed, there will likely be a newer, better way of accomplishing the same task. If you need an actual safeguard, create adapters or façade to use in your code base. If a future update breaks your solution, you will only need to fix the adapters and facades.