Re: Order of cluster searching with ace file (recent snapshot)
Raphael Mack <[email protected]> Wed, 13 Dec 2006 23:47:51 +0100
| Newsgroups | gmane.comp.lang.eiffel.smalleiffel |
|---|---|
| Message-ID | <1166050071.25801.82.camel@localhost> |
Hi, Am Mittwoch, den 13.12.2006, 19:05 +0100 schrieb Colnet Dominique: > > Yes, but, what if the libraries are third-parties? After all that's > > the aim of libraries: reuse... Do you need to manually rename every > > class? > If the concept is the same and has to be shared, it must be separated > in some external (new) library. > Anyway, in such a situation, people have to negociate in order to > select different names or in order to merge the concept in a > single class. The problem is, that a third-party and a forth-party probably don't know from each other. To cross check all library against all others will explode exponentially and is therefore not practical for larger numbers of libraries. > > Or do we need to stick to our "poor man's namespace" class names? > Yes I think. This is not always lead to the most convenient class names. For example I have a project with displays images and therefore has to deal with colors. Once upon a time it happened, that my project stopped compiling, because the vision cluster got a class COLOR. My solution so far is, just remove the vision cluster from my default loadpath - not the best one, I think. Even if one considers class-name-prefixing with a shortcut for the library a nice way of poor man's namespaces, for a application level class this is impractical. And all the classes in the standard library doesn't have the "SE_" prefix, they would have to have... Who knows, when existing code will not be compilable anymore, because the library was extended by a class name which is "faulty" in some application environment??? > Now, just two ideas to improve our "poor man's namespace". > 1 - classes inside some "internal" sub-cluster must not escape > outside of the containing-cluster. Do you see what I mean? a hardcoded special case? I dislike that! > 2 - May be we could also decide to tag each cluster to indicate > that class names can escape or not... just a fresh idea. > Half baked ;-) > > Anyway, I am really against adding a new notation inside Eiffel > source files. This is good. Thanks. one general question (which may disqualify me for the complete discussion): Is it possible to have two classes with the same name in the system? E. g. is the distance calculated to EACH class using a dedicated type? Or is ONE class chosen for the complete application? And now, as I disqualified, I add a (also half baked) suggestion to solve the "same nesting level"-problem: Everywhere we list a cluster (ace/laodpath file, perhaps even command line) an additional number can be provided, which gives a weight to the distance within the path (not fs-path, but cluster-path). Leaving out all these numbers set them to 1, and leads to the behavior as it is now (with the advanced search algorithm.) This way one can specify, which class to use, even, if the cluster-distance is equal by a given library structure. (Should be also possible in combination with a dynamic "two different classes with same name may be used in different places of one application"-approach.) And yes, this is not very different from an introduction of "fuzzy" namespaces... Rapha