<HTML><BODY style="word-wrap: break-word; -khtml-nbsp-mode: space; -khtml-line-break: after-white-space; ">Hello list,<DIV><BR class="khtml-block-placeholder"></DIV><DIV>I am trying to understand what is the design process (intellectual, that is) when building a program in Erlang.</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>Indeed, in the object oriented world, I would start by finding what my classes might be and the relationship between them. Gradually I would add functions (class or instance methods) to the classes in order to provide solid foundations on top of which I can write an application.</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>For example, I could have PERSON, PROFILE, ROLE, FEATURE, etc... and decide a PROFILE is a collection of FEATURES. A PERSON can have 0 or many ROLES. A ROLE is a PROFILE on a given area (a department for example) for a given time. I would then add functions such as "give all the active roles for the user" or "what features give that profile" or "does the user have a given feature for that department".</DIV><DIV>I admit it is more complexe than that, but you get the idea.</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>Obviously, this doesn't seem to be the way to go with Erlang. Intuitively, I would start making a list of all the functions which will allow me to interract with my application. In that case I could have "give me all users with an active role on that department", etc... Then by implementing those high level functions I would split them into pieces by calling smaller simpler functions. The underlying data structure will "just follow" or "appear" naturally.</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>Hence: object oriented design is "data structure and relationships first, functions second" and functional design is "functions first, data structure second".</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>Am I being over simplistic here. Are there some guidelines as to how one can approach a problem when creating a new program? Especially programs which deal with persistent data, not protocole analysers or socket servers!</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>Thanks,</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>Alex<BR><DIV> <SPAN class="Apple-style-span" style="border-collapse: separate; border-spacing: 0px 0px; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-align: auto; -khtml-text-decorations-in-effect: none; text-indent: 0px; -apple-text-size-adjust: auto; text-transform: none; orphans: 2; white-space: normal; widows: 2; word-spacing: 0px; "><SPAN class="Apple-style-span" style="border-collapse: separate; border-spacing: 0px 0px; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-align: auto; -khtml-text-decorations-in-effect: none; text-indent: 0px; -apple-text-size-adjust: auto; text-transform: none; orphans: 2; white-space: normal; widows: 2; word-spacing: 0px; "><SPAN class="Apple-style-span" style="border-collapse: separate; border-spacing: 0px 0px; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-align: auto; -khtml-text-decorations-in-effect: none; text-indent: 0px; -apple-text-size-adjust: auto; text-transform: none; orphans: 2; white-space: normal; widows: 2; word-spacing: 0px; "><DIV>--</DIV><DIV>Alexander Lamb</DIV><DIV>Founding Associate</DIV><DIV>RODANOTECH Sàrl</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>4 ch. de la Tour de Champel</DIV><DIV>1206 Geneva</DIV><DIV>Switzerland</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>Tel:  022 347 77 37</DIV><DIV>Fax: 022 347 77 38</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV><A href="http://www.rodanotech.ch">http://www.rodanotech.ch</A></DIV><DIV><BR class="khtml-block-placeholder"></DIV></SPAN></SPAN><BR class="Apple-interchange-newline"></SPAN> </DIV><BR></DIV></BODY></HTML>