When invoking functions, it has to be send to and singed by all endorsing peers. The application needs to handle this whole process, so it has to have knowledge about the blockchain network/logic.
Yep, unfortunately, right now - the application needs to code the endorsement policy logic inside of it. Another problematic aspect is that it needs to be preconfigured with the endpoints of the peers.
However, not for long! hopefully in v1.2 or v1.3 Fabric will have a service discoverymechanism in which the Fabric SDK would query peers for network metadata information, like where are the other peers running, and also for information like "given chaincode foo in channel bar, which peers should I ask endorsements from?" And the application won't have to deal with all that infrastructure-level knowledge, and would focus only on business logic.