开发者

Need Guidance Re: Factoring Erlang Applications

开发者 https://www.devze.com 2023-03-24 06:04 出处:网络
First, brief but profound thanks to all who have responded to my questions to date. I\'m climbing the Erlang OTP learning curve and enjoying every step. Now diggi开发者_如何学JAVAng into Application

First, brief but profound thanks to all who have responded to my questions to date.

I'm climbing the Erlang OTP learning curve and enjoying every step. Now diggi开发者_如何学JAVAng into Application design and integration. My question today is this:

Suppose I have a set of library modules: myLibrary. I want to employ these functions in an Erlang Application involving a set of application-specific modules: myApp. Mylibrary may well serve Applications beyond myApp.

I want, in turn, to deploy myApp over the web, over, on Webmachine, say. I also want need data persistence for myApp, could be Dets or Mnesia or Riak -- yet to be decided.

First, should I wrap myLibrary into the same Application as myApp? Or should they be separate Applications?

Second, how can I best integrate all these Apps into one functional Release? (I'm burning oil on the published docs re: this question, but finding them a bit confusing).

Thank you,

LRP


First of all, I'm thrilled that you are learning erlang and getting your questions answered by the community. I would like to suggest, however, that you reciprocate the good will by marking correct answers that we have provided as "accepted". Now that we have that out of the way, on to the actual answer...

myLibrary should be it its own repository if you believe it has potential for reuse. See edate as an example of such a library.

I agree that the business of packaging applications and their dependencies in erlang is, at the moment, a bit confusing. You may want to start with my answers here and here.

This set of three posts walks you through the process of integrating the holy trinity of webmachine, erlydtl, and riak. The material is a bit dated but as I recall the author touches on a number of points pertinent to your question.

This post is often given as a reference for using rebar and creating actual releases.

As of this writing I don't actually do real erlang releases in production. I use rebar to compile, test, and manage my dependencies and that's it - on my production servers I just clone my repository, run make, and away I go. But if you want the full-on release management experience, rebar can help you do that too.

0

精彩评论

暂无评论...
验证码 换一张
取 消