There are several solutions, here are 2. You could create it with a Curve modifier or with Spline IK. The second solution is bit more complicated but the object will have a more realist deformation when the curve angle is high.
For the modeling of the object, I prefered to use a Screw modifier rather than a Spiral Curve with a bevel profile, because it seemed more convenient to me, but Spiral Curve is a solution.
And, at last, I explain how to create bone controllers for each handle of your curve: it's useful when you want to animate or even keep a basic reset shape for your curve.
First, comparison between method 1 and 2, as you can see there's a subtle difference in the deformation:
With a Curve modifier:
- Create your cable profile, it looks like a rectangle, shift it a bit from its origin. In Object mode apply the rotation of the object.
- Give it a Screw modifier, play with the parameters.
- Create a curve, flatten it, subdivide it a bit, make its origin begin at the same point as the cable origin, make sure its normals direction goes in the right direction, if not switch with W > Switch Direction.
- Give your cable a Curve modifier, choose the curve as Object.
- Now if you bend the curve, the cable will follow.
- To give a bit more smoothness to your cable, bevel its profile vertices with a shiftctrlB.
- Give a Subdivision Surface modifier to the object.
- Now your cable is ready, you can apply the Screw and Curve modifiers if you want, but keep a copy of both object and curve somewhere.
- To animate you can hook the curve handles to bones, as explained further.
With bones and Spline IK, as explained here by Peter Drakulic:
- You've made your object and your curve (see beginning of method 1). Apply the Screw and Curve modifiers of the object if you want. Keep the curve.
- Add a bone as long as the curve, subdivide it a bit.
- Keep your armature selected, switch to Pose mode and give the top bone a Spline IK constraint with the curve as Target and the number of bones as Chain Length. Deactivate the Y Stretch option. Now when you move the curve the bones follow.
- Parent the object to the armature With Automatic Weight. Put the Armature modifier above the Subsurf. Activate the Preserve Volume option of the Armature modifier.
- Again, to animate you can hook the curve handles to bones.
You may want to create some bone controllers for each handle:
- Create a new armature with each bones at the exact same point as each handle.
- Switch the armature to Pose mode.
- Select one of the bones.
- Press shift and select the curve.
- Go in Edit mode and select the corresponding handle.
- Press ctrlH > Hook To Selected Object Bone.
- Same thing for the other bones.
- Now you can control the whole curve with this armature.