User Tools

Site Tools


code-organisation

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
code-organisation [2017/06/29 06:42]
barryfp
code-organisation [2018/06/07 09:10] (current)
barryfp [Developing in the central source tree]
Line 69: Line 69:
 You can also develop components in Dana's central source tree (CST). We generally advise against developing entire projects here but you may wish to place utility / shared components here that are useful across multiple projects. You can also develop components in Dana's central source tree (CST). We generally advise against developing entire projects here but you may wish to place utility / shared components here that are useful across multiple projects.
  
-Developing code in the CST is very similar ​to the local directory case described above, except that we do not use a "​resources"​ sub-directory. Instead ​the CST is split into two branches, "​components"​ and "​resources"​. These two branches have symmetrical structure (take look for yourself). +Developing code in the CST is identical ​to the local directory case described above (the CST is in fact just local project but is always available as default search path). When compiling a component, any interface types (other type files) are searched for by converting any dots to slashes, adding ''​.dn''​ to the end, and then looking in the resources directory of the CST for a file matching that name. However, the compiler will **also** search from the symmetrical location within the resources folder of the CST. Imagine, for example, that you have a component in a file called ''​File.dn''​ within the ''​io''​ sub-directory of the components directory in the CST. If this component uses an interface simply called ''​File'',​ the compiler will therefore look at both ''​resources/​File.dn''​ and ''​resources/​io/​File.dn''​ for this file.
- +
-When compiling a component, any interface types (other type files) are searched for by converting any dots to slashes, adding ''​.dn''​ to the end, and then looking in the resources directory of the CST for a file matching that name. However, the compiler will **also** search from the symmetrical location within the resources folder of the CST. Imagine, for example, that you have a component in a file called ''​File.dn''​ within the ''​io''​ sub-directory of the components directory in the CST. If this component uses an interface simply called ''​File'',​ the compiler will therefore look at both ''​resources/​File.dn''​ and ''​resources/​io/​File.dn''​ for this file.+
  
 At runtime, when attempting to resolve required interfaces of a component in the CST against default implementing components of those interfaces, the Dana runtime will perform a similar procedure. First, any dots in the interface type are converted to slashes and then ''​.o''​ is added to the end. The runtime then checks for a file in the components directory of the CST that matches the resulting path. At runtime, when attempting to resolve required interfaces of a component in the CST against default implementing components of those interfaces, the Dana runtime will perform a similar procedure. First, any dots in the interface type are converted to slashes and then ''​.o''​ is added to the end. The runtime then checks for a file in the components directory of the CST that matches the resulting path.
code-organisation.txt · Last modified: 2018/06/07 09:10 by barryfp