Conclusion
The idea of interfaces is very simple. Instead of needing to always know what's inside an element we can now treat elements not only based on there public interface but more specifically based on there actual implementation interfaces. This comes really handy if we only want to get the code hints for “playable” elements or want to guaranty that only elements that have implemented our interface can pass our gate holder. There is much more to interface then just this although this would probably be enough o make interfaces a really great addition to our tool belet there is a few more benefits. When you work with a team it makes it much easier to give the developers that are working with you a clear interface they must adhere without the need on your end to actually know what they are doing withing there elements. It enables you to continue building the project without focusing on the details. This is true as well when you are working on internal projects. Working with interfaces enables you to focus on the big picture when you want to work on the big picture and focus on components without the need to worry about how they would work in the main interface as once you set them up once every other object you will create that implements the same interface should not effect the main architecture in the future. There is one last benefit that is more exclusive to Flash. As many times in flash you will work with external venders/3rd party tools and even your own code that you load into your main architecture this will save you a lot of file size - as now the main class doesn't actually need to know what you actually have within your code but it only needs to know what interfaces you adhere to that relate to it. This file sizes differences are actually really dramatic you can easily save large amounts of data from getting loaded more then ones enabling you to keep your main files smaller.
Ready to Level Up Your Skills?
Join thousands of learners on 02GEEK and start your journey to becoming a coding expert today!
Enroll Now for Free!