An implant or endoprosthesis suitable to be implanted in human or animal tissue comprises two (or more than two) parts to be joined in situ. Each one of the parts comprises a joining location, the two joining locations facing each other when the device parts are positioned for being joined together, wherein one of the joining locations comprises a material which is liquefiable by mechanical vibration and the other one of the joining locations comprises a material which is not liquefiable by mechanical vibration and a structure (e.g. undercut cavities or protrusions) suitable for forming a positive fit connection with the liquefiable material. The joining process is effected pressing the two device parts against each other and by applying vibration, e.g. ultrasonic vibration, to one of the device parts when the two parts are positioned relative to each other such that the two joining locations are in contact with each other. Preferably, at least one of the device parts is fixed to the tissue before or during the joining process. Such fixing is advantageously effected with the aid of a further liquefiable material and mechanical vibration which results in an anchorage of the part by interpenetration of the tissue by the liquefiable material.