Welcome Guest, Not a member yet? Register   Sign In
User Guide: Libraries vs Core Classes
#16

[eluser]oribani[/eluser]
[quote author="wiredesignz" date="1252659407"]@oribani, There is a more appropriate place to post details of spelling mistakes that you may have discovered in the User Guide.[/quote]

So are you going to share that location, then?

[quote author="wiredesignz" date="1252659407"]As for helpers vs libraries, you are correct that any file containing one or more related functions or methods is termed a library. However for the sake of getting into the CodeIgniter frame of mind you are asked to consider the functionality of these libraries when describing them.[/quote]

I can see that you might try to establish some differences between certain libraries based on their functionality, but in this case, "helper" to me isn't indicative of any particular functionality, and in fact "helper" and "library" don't have substantive differences in the meanings of the words themselves. If you have a concrete difference in functionality, the names should indicate it.

I'm not sure I see the functional difference, either, but one thing seems certain, "native libraries" and "core classes" seem to be the same thing, and the user guide should really be changed to clear up that confusion.

[quote author="wiredesignz" date="1252659407"]Controllers, Models and Views are pretty self explanatory.

CodeIgniter helpers are libraries of related procedural functions and have global scope.

All CodeIgniter library files contain related object oriented methods and they are automatically instantiated by the core loader class and attached to the controller object.[/quote]

So here you seem to be pointing out that libraries are only usable within the scope of the controller where they were loaded. If that's the case, maybe "libraries" should be "controller libraries" and "helpers" should be "global libraries" or something like that.

[quote author="wiredesignz" date="1252659407"]Core libraries can be replaced by your own that bear the same filename but they must contain the "CI_" class prefix which makes them different to user libraries.[/quote]

But like I've said a couple times here, the issue I was looking at really didn't have anything to do with your own custom libraries.

But anyway, going with what I suggested above, then you might have "core controller libraries" (are core libraries scoped only to the controller?), "custom controller libraries" and "global libraries". I didn't put a lot of thought into those names, so there may be something better.

Or if you want to harp on the "functional" differences, maybe it makes more sense to be really clear: these "libraries" are really class objects when you use them, aren't they? (as you note, they are in fact instantiated for you) So why not "object libraries" or "controller object libraries" to indicate their scope as well. That would be clearly different than "helpers" and "plugins", which would be better understood as "global function libraries".

Oh, and core vs. your own "libraries" could be distinguished as "core controller object libraries" and "custom controller object libraries".

In the end, it's not a big deal if you understand how it all works. I'm just pointing out that the distinctions are arbitrary and in some cases are more confusing than they should be (and maybe the arbitrary nature of the distinctions should be explicitly pointed out).

[quote author="wiredesignz" date="1252659407"]Plugins are also libraries which are loaded but not instantiated by the framework.[/quote]

But here you contradict the nomenclature yourself. As I noted previously, helpers and plugins do appear identical, especially given that they both seem to be loaded with a simple include_once. So if you are trying to keep with the "functional" distinction you are trying to point out, plugins are HELPERS, not libraries. But really, they're all libraries, aren't they?

[quote author="wiredesignz" date="1252659407"]I'm not sure if this helps, but in any case understanding all of this is very much a CodeIgniter framework thing.[/quote]

I don't buy that. That's like saying you just have to accept it because that's the way it is. The nomenclature is arbitrary. And plugins seem pretty unnecessary too when they could just be put in the helpers directory anyway. I won't lose sleep over what are in the end minor points, but at this point it really does seem like the user guide is flawed at least where it confuses "core libraries" with "native libraries" on the two pages I pointed out.


Messages In This Thread
User Guide: Libraries vs Core Classes - by El Forum - 09-10-2009, 05:01 PM
User Guide: Libraries vs Core Classes - by El Forum - 09-10-2009, 05:29 PM
User Guide: Libraries vs Core Classes - by El Forum - 09-10-2009, 05:36 PM
User Guide: Libraries vs Core Classes - by El Forum - 09-10-2009, 06:17 PM
User Guide: Libraries vs Core Classes - by El Forum - 09-10-2009, 06:25 PM
User Guide: Libraries vs Core Classes - by El Forum - 09-10-2009, 06:27 PM
User Guide: Libraries vs Core Classes - by El Forum - 09-10-2009, 06:31 PM
User Guide: Libraries vs Core Classes - by El Forum - 09-10-2009, 06:40 PM
User Guide: Libraries vs Core Classes - by El Forum - 09-10-2009, 06:45 PM
User Guide: Libraries vs Core Classes - by El Forum - 09-10-2009, 07:29 PM
User Guide: Libraries vs Core Classes - by El Forum - 09-10-2009, 07:45 PM
User Guide: Libraries vs Core Classes - by El Forum - 09-10-2009, 08:43 PM
User Guide: Libraries vs Core Classes - by El Forum - 09-10-2009, 08:53 PM
User Guide: Libraries vs Core Classes - by El Forum - 09-10-2009, 09:06 PM
User Guide: Libraries vs Core Classes - by El Forum - 09-10-2009, 09:56 PM
User Guide: Libraries vs Core Classes - by El Forum - 09-10-2009, 10:54 PM
User Guide: Libraries vs Core Classes - by El Forum - 09-10-2009, 11:38 PM
User Guide: Libraries vs Core Classes - by El Forum - 09-11-2009, 01:06 AM
User Guide: Libraries vs Core Classes - by El Forum - 09-11-2009, 02:17 AM
User Guide: Libraries vs Core Classes - by El Forum - 09-11-2009, 02:36 AM
User Guide: Libraries vs Core Classes - by El Forum - 09-11-2009, 12:49 PM
User Guide: Libraries vs Core Classes - by El Forum - 09-11-2009, 12:59 PM
User Guide: Libraries vs Core Classes - by El Forum - 09-11-2009, 01:10 PM



Theme © iAndrew 2016 - Forum software by © MyBB