[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[List Home]
|
[e4-dev] Improved handling of ID's - Suggestion for discussion
|
- From: Lars Vogel <lars.vogel@xxxxxxxxxxxxxx>
- Date: Mon, 30 Jan 2012 23:12:16 +0100
- Authentication-results: mr.google.com; spf=pass (google.com: domain of lars.vogel@googlemail.com designates 10.220.153.144 as permitted sender) smtp.mail=lars.vogel@googlemail.com; dkim=pass header.i=lars.vogel@googlemail.com
- Delivered-to: e4-dev@eclipse.org
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:content-type; bh=UUmd6MA5ye2ya7Q80EO2YcR9QSc+3KwwZjMssme26F4=; b=oiQgdpXCcobRxEkYKa1bui2ezFeN/5Z7QPy1RJ3D9xAlacAUJtUB67HCMBSmLq2eF+ qpWXxJG98CjJ98cd0Qo6+ErrB39Oy6y1blr4xviFvoWJevKDURMC8Al3muSXOzH+9AMb uNCxFYRHEkxB0Av+wob4HtMnl6ulmZ3XSGsbs=
Hi,
one thing I like about Android programming, is that you can refer to static strings for ID's in a XML file (layout file) as well as in Java code. In the layout file you use @id/button1to point to a ID defined in a file.
In your Android coding you could reference the ID via a static string. This removes the issue that you may have typos either in your coding or in your layout and allows consistent refactoring of ID's.
One of the issues I believe still exists in todays Eclipse 4 plug-in development, is that you have to define a ID twice, once in your application model and at least once in your coding.
I really liked the change to bundleclass:// in M5.
Perhaps we could introduce another URI for ID which could be referred to an ID defined in a file, e.g.
modelid://Bundle-SymbolicName/path/filename.extension/id
And add another annotation, like @ID, which allows to annotate static strings and to mark them a ID's which could be used in the model as well in the coding.
@ID
public static final String part1 = "com.example.test.part1".
Would that be helpful? Is it worth to open a enhancement request for this?
Best regards, Lars