# Correct distribution of packages to allow external definitions?

#1

I’m developing a helmholtz solver for thermodynamic properties so the idea. The idea is to define the Helmholtz function once and then other functions should be automatically defined for the type. for example:

``````abstract type AbstractTermoModel end
struct AbstractHelmholtz <: AbstractTermoModel end
function pressure(model<:AbstractHelmholtz,rho,T,x) = derivative(Helmholtz(model,pho,T,x),rho)
``````

then, the models are in other file, it can be in the package or the user can define a model of its own. Lets suppose a GERG2008 equation of state for natural gas:

``````struct GERG2008 <: AbstractHelmholtz #the idea is this
data1::Array{Float64,1}
...
end

function helmholtz(model::GERG2008,rho;T,x)
#define the actual model, using the parameters inside model
return result
end
``````

the question is the following, How can someone import the core of the package (AbstractHelmholtz), extend the method and then make that the other functions are available for that definition? what should be the most sensible way to organize this?