Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 5960979
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T18:54:03+00:00 2026-05-22T18:54:03+00:00

I have an interface whose declaration is as follows: /** * @param T –

  • 0

I have an interface whose declaration is as follows:

/**
* @param T - the type of entity.
* @param C - the type of entity container will be returned.
*/
public interface FindByNamedQuery<T extends Serializable, C extends Collection<T>> extends Command {
    C executeNamedQuery(String namedQuery);
}

I wonder if I can (should) break the Java naming convention to do this:

public interface FindByNamedQuery<ENTITY_TYPE extends Serializable, RETURNED_CONTAINER extends Collection<ENTITY_TYPE>> extends Command {
    RETURNED_CONTAINER executeNamedQuery(String namedQuery);
}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-22T18:54:04+00:00Added an answer on May 22, 2026 at 6:54 pm

    I am beginning to disagree with the single-character convention, after using it since the mid-1990s.

    I find the readable names more readable. This is helpful in understanding both the implementation and interface of generic types.

    The ambiguity problem seems overstated for Java. Few class names are all-uppercase. Constants are not used in the same context as class names.

    It’s true that the @param JavaDoc elements can provide a longer description. But it’s also true that the JavaDocs are not necessarily visible. (For example, there’s a content assist in Eclipse that shows the type parameter names.)

    For example, compare :

    public final class EventProducer<L extends IEventListener<E>,E> 
        implements IEventProducer<L,E> {
    

    to:

    public final class EventProducer<LISTENER extends IEventListener<EVENT>,EVENT> 
        implements IEventProducer<LISTENER, EVENT> {
    

    Although the single-character names have been recommended as a convention by Sun/Oracle, conventions can be changed. The consequences of challenging this convention are minor. If you and your team prefer meaningful names for your type parameters, I personally would go for it.

    Edit (2015)

    Google style for Java allows both single-letter names and multi-character class-like names ending in T.

    5.2.8 Type variable names

    Each type variable is named in one of two styles:

    • A single capital letter, optionally followed by a single numeral (such as E, T, X, T2)

    • A name in the form used for classes (see Section 5.2.2, Class names), followed by the capital letter T (examples: RequestT,
      FooBarT).

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am currently working with .Net 2.0 and have an interface whose generic type
Have a interface class abc { public: virtual int foo() = 0; ... }
I have an interface - here's a nicely contrived version as an example: public
I have an UIViewController that has two UIViews inside, whose layout (set in Interface
I have an MKMapView whose delegate is set in Interface Builder and which is
If I have interface IFoo, and have several classes that implement it, what is
Suppose we have: interface Foo { bool Func(int x); } class Bar: Foo {
Lets say you have interface definition. That interface can be Operation . Then you
I have an Interface called IStep that can do some computation (See Execution in
I have an interface that I have defined in C++ which now needs to

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.