EXHIBIT 5.1 [LETTERHEAD OF GRAHAM & JAMES LLP] May 7, 1998 ATG Inc. 47375 Fremont Boulevard Fremont, California 94538 Ladies and Gentlemen: We have acted as counsel for ATG Inc., a California corporation (the "Company"), in connection with the preparation and filing of a registration statement on Form S-1, Registration No. 333-46107 (the "Registration Statement"), and a related new registration statement (the "New Registration Statement") filed pursuant to Rule 462(b) under the Securities Act of 1933, as amended, with the Securities and Exchange Commission relating to the public offering by the Company of 1,900,000 shares of its Common Stock, no par value per share, plus an additional 285,000 shares of such Common Stock to cover over-allotments, if any (collectively, the "Shares"). In connection with the opinions expressed herein, we have examined the following documents: (i) the Registration Statement (including exhibits thereto), as amended through the date hereof; (ii) the New Registration Statement (including exhibits thereto); (iii) the Articles of Incorporation of the Company, as amended; (iv) the Bylaws of the Company, as amended; (v) the minute books of the Company; (vi) the form of Underwriting Agreement to be executed and delivered by the Company and Van Kasper & Company (the "Underwriting Agreement"); (vii) the form of Common Stock certificate of the Company; and (viii) such other documents as we have deemed necessary or appropriate. In our examinations, we have assumed the genuineness of all signatures, the legal capacity of all natural persons, the authenticity of all documents submitted to us as originals, the conformity to original documents of all documents submitted to us as certified, photostatic or facsimile copies and the authenticity of the originals of such documents. Based upon our examination of the foregoing documents, and expressly subject to the assumptions set forth above, it is our opinion that, when issued and paid for upon the effectiveness of the Registration Statement and the New Registration Statement and in accordance with the terms of the Underwriting Agreement and the final Prospectus contained in the Registration Statement, the Shares will be validly issued, fully paid and non-assessable. We consent to the filing of this opinion as an exhibit to the New Registration Statement and to the reference to Graham & James LLP under the caption "Legal Matters" in the Prospectus incorporated by reference into the New Registration Statement. Very truly yours, /s/ Graham & James LLP ------------------------------------- GRAHAM & JAMES LLP