User Tools

Site Tools


code_organisation

Differences

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

Link to this comparison view

Last revision Both sides next revision
code_organisation [2014/01/04 09:40]
barryfp created
code_organisation [2014/01/04 12:14]
barryfp
Line 1: Line 1:
 <div justify> <div justify>
-Dana source code is organised into types and implementations ​which are in turn arranged in standard directory structures. You need to know this structure so that the Dana compiler can find the files that define the types used by your components.+Dana source code is organised into **types** (or "​resources"​) ​and **components** ​which are in turn arranged in standard directory structures. You need to know this structure so that the Dana compiler can find the files that define the types used by your components.
 </​div>​ </​div>​
  
Line 7: Line 7:
 </​div>​ </​div>​
  
-pic...+<div round box> 
 +<div centeralign>​ 
 +{{:​organisation-local.png?​nolink|}} 
 +</​div>​ 
 +</​div>​
  
 <div justify> <div justify>
-Dana also has a central ​source ​tree that can be used to easily share types between multiple programs, ​and to quickly launch Dana programs from anywhere. Dana's central source tree is organised ​in a very similar way to that described above except that there are parallel components and resources directories (instead of the resource directory being inside ​the directory ​that contains ​your components).+The source ​code of ''​Component'' ​and ''​ComponentB'' ​in the above structure has access ​to any types that are defined in files within ​the resources ​directory. If ''​MyType''​ is an object type, therefore, one of your components ​can simply use ''​provides MyType''​ to offer object implementations of that type.
 </​div>​ </​div>​
  
-pic...+<div justify>​ 
 +Dana also has a **central source tree** that can be used to easily share types between multiple programs, and to quickly launch Dana programs from anywhereDana's central source tree is organised in a similar way to that described above except that there are parallel ''​components''​ and ''​resources''​ directories (instead of the resources directory being inside the directory that contains your components). 
 +</​div>​ 
 + 
 +<div round box> 
 +<div centeralign>​ 
 +{{:​organisation-central.png?​nolink|}} 
 +</​div>​ 
 +</​div>​ 
 + 
 +<div justify>​ 
 +Compiled components that appear in the ''​components''​ directory (or a sub-directory) of Dana's central source tree can be run from anywhere. In other words, you don't need to open a command prompt or terminal window in the specific directory containing the component in question. In the above example, as long as it has been compiled, the component ''​Component.dn''​ can be run from anywhere by typing the command ''​dana Component''​ into a command prompt. If a component was in the directory ''​components/​examples/''​ it could be run from anywhere by using the command ''​dana examples.Calendar''​ (for example). 
 +</​div>​
code_organisation.txt · Last modified: 2014/01/16 08:53 by barryfp