I want to create a material for an object such that the body is semi-transparent and only the border of the object is opaque or darker. Is it possible to develop a shader for this ? Or do we have to do through only compositing?
Edit: I understand that the question might actually be about the visual borders of the object (the ones usually highlighted using the freestyle pass), not the edges of the mesh.
I'll however leave my (unfitting) answer below in case somebody else is looking for a solution more similar to this.
A solution could be duplicating your object, then:
assigning a transparent material to copy #1 (the greenish material in my example)
for copy #2, using a wireframe modifier and applying the material shown in the nodes setup below, which mixes a full white transparency and a diffuse shader, using the "Transparent depth" input as a mixing factor.
As you can see, back edges are hidden in this setup. You can display them by simply using a diffuse shader (i.e. bypassing the mix shader).
Be aware that this won't work if the object is seen through another transparent object: all the wires will be hidden in this case.