On 25-04-2005 15:12, "Adam Jack" <[EMAIL PROTECTED]> wrote: > What is the thinking behind this being an array? Do we want to support > multiple dependencies from one project to another?
Well, either a project depends on another or it doesn't, but it can depend on various things (for example multiple jars, an environment variable a home directory and a .so/dll). If you think of a Project as a node, a Dependency as a vertex, then you can have an array of DependencyInfo as multiple vertex colorings. Was my thinking. > BTW: Per [1] I've change DependencyInfo.specific_output_id to ids (plural). > Now an array. So that's sort-of redundant. We don't need both to be an array. We could create multiple DependencyInfo objects, one for each id, instead. I think it actually needs to be that way, since dependency on one of the specified ids might be optional, but dependency on another one is not. I.e, in xml: <project name="a"> <depend project="b" ids="basic, extension1" runtime="true"/> <depend project="b" ids="fancy-feature" optional="true"/> </project> in code: a = Project("a") b = Project("b") d = Dependency(dependency=b, dependee=a) d.add_depedencyinfo(DependencyInfo(specific_output_id="basic", runtime=true) d.add_depedencyinfo(DependencyInfo(specific_output_id="extension1", runtime=true) d.add_depedencyinfo(DependencyInfo(specific_output_id="fancy-feature", runtime=true) In fact, I'd much prefer the xml to be: <project name="a"> <depend project="b" id="basic" runtime="true"/> <depend project="b" id="extension1" runtime="true"/> <depend project="b" id="fancy-feature" optional="true"/> </project> Or rather: <project name="a"> <depend project="b"> <output type="jar" id="basic" runtime="true"/> <output type="jar" id="extension1" runtime="true"/> <output type="native-lib" id="fancy-feature" optional="true"/> </depend> </project> It doesn't make sense to do enumerations inside an xml attribute. It's much clearer to make enumerations by well, enumerating elements. (...) Anyway, I guess the code isn't as clear as I thought it was. Similarly I couldn't quite figure out what you were trying to do in your commit, further indication that this really needs more change than you introduced :-D Any suggestion on how to clean this up further? I feel its somewhat important to get this mostly "right" the first time around (including making things intuitive) as changing relationships between model elements gets more "expensive" as the codebase size increases. Maybe we should call "DependencyInfo" something else. I thought for a long time about a better name. Couldn't really come up with something. Or maybe we should make DependencyInfo into a map-like object; in fact, make Dependency into a map-like object. a = Project("a") b = Project("b") d = Dependency(dependency=b, dependee=a) d.append({specific_output_id="basic", runtime=true}) d.append({specific_output_id="fancy-feature", runtime=true}) Hmm. Doesn't look much clearer. WDYT? Cheers, LSD PS: that e-mail certainly ended up longer than expected! :-D --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]