As from Titanium 3.3.0, Ti.Include() is deprecated. For those who do not know the meaning of the word; Deprecation, especially in terms of Appelerator;
Denotes that something should be avoided, this feature is now on notice that it will be removed from future versions of the Titanium SDK. Apps relying on this feature will either need to be updated or rely on versions of the Titanium SDK prior to the version that has officially removed the feature.
Why is Ti.include() being deprecated?
It is considered an anti-pattern;
A commonly used process, structure or pattern of action that despite initially appearing to be an appropriate and effective response to a problem, typically has more bad consequences than beneficial results, and
A good alternative solution exists that is documented, repeatable and proven to be effective.
I have personally long campaigned for the deprecation of Ti.include(), as have many others. My views come down to this;
The Ti.include method was a solution fit for another time in Titanium’s history. That time has long since gone. Too many newbies are using Ti.include as if it is the correct pattern to develop their apps against.
The only reason against deprecation is that some older apps still use Ti.include. However using this as a reason only serves to increase the number of apps this will affect.
What does this mean for your apps?
If you do not use Ti.include() – you do not have to make ANY changes. Your life is easy, go have a coffee.
If your app does use Ti.include() then now is the time to start planning for change. The good news is the changes you need to make are likely to be very small.
What if you want to keep using Ti.include?
You will only be able to compile your app with the last SDK version that provided the method. You will no longer be able to use any future SDK that has completed the deprecation process where the feature has been removed.
What is the alternative for Ti.include?
Titanium has evolved significantly since it was first publicly available in June 2009 for mobile development. During that time it has allowed developers to use many ways to re-use code, each time with increasing benefits. Ti.include() was one of the first, but it no longer meets the needs of modern app development.
The Titanium documentation has already been updated to reflect the deprecation. It has also been update to note that this mechanism is not supported with Alloy projects even before the final removal of the feature.
If you are still using Ti.include() then making the transition away will only have positive effects for your apps.