If someone does a mitsva like writing a sefer or providing a building for Jewish activities like a shul or school. Should he put his name on it and have it called after him? I am not referring to giving charity to poor people because that is better done in private but to giving a building. Even though some hold it may deduct from the mitsva, on the other hand because of his generosity it causes others to do the same, which when they do, he has a share in their mitsva since they do it through his instigation and the community profits more by it.
The major advantage of attaching your name to something is that if your name is attached to it, the community can't exchange it for a new one so long as the writing/engraving of your name is still present (pseudo-Rama YD 259:3). This is a good thing to want as it maximizes the benefit you get as the donor. On the other hand, attaching your name as a way of boasting about your wealth in public is obviously not a good thing. One should CYLOR about each case. (Something to consider is attaching some other name to the object, so that it can't be replaced but you don't have to fear feeling boastful, though CYLOR about this too.)