let's say company A is a consultancy in field XX and develops software solutions for client B. Client B clearly retains the IP of the work done. Then company A will have 2 more clients C and D. Now, company A has clearly the expertise to do a similar work for company C and D (without copying or reusing the same software of course). Is there any infringement of IPR of company A just has other clients and do similar jobs? Especially in software clearly there are pieces that can be repeated in different project but they are not representative of the IP. How the company A can handle the legal situation: it has to give the IP to client B , C and D without infringing all of them. Otherwise company A will get out of business because they cannot have multiple clients.
Is there any infringement of IPR of company A just has other clients and do similar jobs?
Typically no, especially if that knowledge is gained independently. For example if Client A provided the company with a specific algorithm and asked for that algorithm to be implemented, the company could not use that algorithm (even if the code is different) for Client B. However if Client A came to the company and said "we want software that does X, Y, Z" and the company developed the algorithm to do that, it would be free to use that with Client B.
How the company A can handle the legal situation [...]
Technically speaking this is done in a number of ways depending on how the company wants to implement it. It may have a well-documented development process which documents where these methods come from and a source control system that can show that the code is independently written. Separation of data (for example, completely unrelated source repositories) and even having different individuals working on the projects.
Usually though there is some kind of documentation exchanged between the contractor and the client at the beginning of the project that outlines very carefully where the intellectual property belongs (and clearly defining the scope of work and any intellectual property output). This may include such provisions as:
- Assignment of any patents
- Documentation and assignment of algorithms
- Non-disclosure agreements
- Release and removal of all documentation/source/notes/etc from the contractors system related to the developed system via signed affidavit
- Documentation of trade secrets
- Marking sensitive documents as such (Confidential/Internal use only, etc)
Another important step from the client side is an indemnification agreement, which basically would say that if Client A were to sue Client B for an IP violation arising from work produced by the contractor, that the contractor would be the one to pay for that particular violation (and court costs/lawyer fees, etc). This is a huge incentive for the contractor to clearly demonstrate that while the output is similar, it was developed independently.
The important thing here is to remember that Intellectual Property and Expertise are two different legal concepts. Intellectual Property is something that can be legally protected, while expertise is general knowledge that cannot.