Re: reducing generic verbosity

[email protected] Thu, 01 Jul 2010 16:08:32 +1000
Newsgroups gmane.comp.java.orm.simpleorm
Message-ID <[email protected]>
Could do, but it is pretty marginal.  You could always write your own create method in a utility class.

The real problem here is Java.  Why cann't I write something like 

var query = new SQuery(META);

Constructors should be able to specify return types and something like var is long overdue.  (I have been using .Net recently.)

Anthony

At 06:46 PM 30/06/2010, Noel Grandin wrote:
>  
>
>Hi
>
>A method like this on SQuery:
>
>    public static <T extends SRecordInstance> SQuery<T> create(SRecordMeta<T> recordMeta) {
>        return new SQuery<T>(recordMeta);
>    }
>
>would greatly help to reduce the verbosity of the instantiation of SQuery objects.
>
>For example, instead of this:
>
>        SQuery<OrderWidebandMeasurementRecord> query = new SQuery<OrderWidebandMeasurementRecord>(META);
>
>I can do this:
>
>        SQuery<OrderWidebandMeasurementRecord> query = SQuery.create(META);
>
>Regards, 
>    Noel Grandin 
>
>
>
>----------
>Disclaimer: <http://www.peralex.com/disclaimer.html>http://www.peralex.com/disclaimer.html
>
>


Spreadsheet Detective,
Southern Cross Software Queensland Pty Limited
54 Gerler Street
Bardon, Queensland 4065, Australia.

Email: [email protected]
www.SpreadsheetDetective.com
Ph: +61 427 830248 (Australian Eastern Standard Time)

"If the model seems correct only because the numbers look right, 
then why build the model in the first place?"


------------------------------------

Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/SimpleORM/

<*> Your email settings:
    Individual Email | Traditional

<*> To change settings online go to:
    http://groups.yahoo.com/group/SimpleORM/join
    (Yahoo! ID required)

<*> To change settings via email:
    [email protected] 
    [email protected]

<*> To unsubscribe from this group, send an email to:
    [email protected]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
6b13757.jpg (image/jpeg, 4.1 KB) - not displayed