This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 24789 - Metamodel cleanup
Summary: Metamodel cleanup
Status: RESOLVED FIXED
Alias: None
Product: java
Classification: Unclassified
Component: Unsupported (show other bugs)
Version: 3.x
Hardware: PC Linux
: P1 blocker (vote)
Assignee: Pavel Flaska
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2002-06-14 18:02 UTC by Pavel Flaska
Modified: 2007-09-26 09:14 UTC (History)
1 user (show)

See Also:
Issue Type: TASK
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Pavel Flaska 2002-06-14 18:02:11 UTC
Analyse the physical and source metamodels, trying
to find: 
- redundancies; each one should be justified (e.g.
which partially incorrect state of the user code
it allowes to model) or at least identified
- missing parts; according to the scope
requirements, ensure there is not anything missing.
- parts, which (although well modelled) may cause
critical performance issues (e.g. TypedElement ->
TypeDescriptor assoc for things of primitive types).

This kind of check will be done several times, so
this task is not to make the metamodel will be
perfect in one shot, rather it should save
rewriting dependent code.
Comment 1 Pavel Flaska 2002-06-25 13:34:49 UTC
[PERF]

Association IsOfType
--------------------
There is a huge amount of IsOfType association instances (~130,000 for
JDK 1.3). Half of them are primitive types. It causes performance
problem, if new instances are created/removed.

Solution:
`type` (in TypedElement) is now derived attribute, which is
implemented. For reference types, there is created association
IsOfType. Primitive types are contained directly in TypedElement. 

During implementation, I found another possible problem in models -
using multiple inheritance can cause problem if both superclasses need
derived attributes.

Statistics (for java.awt and subpackages):
IsOfType instances:
original:  ~14000
new impl.: ~6500

The similiar observation for whole jdk 1.3.1. (More than half of
parameters, fields, method return values are primitive types.)
Comment 2 Svata Dedic 2002-06-25 14:13:03 UTC
MDR team, is multiple inheritance while having derived attributes
supported ? What's the suggested style of the implementation ?
Comment 3 Martin Matula 2002-06-25 14:31:32 UTC
Of course it is supported. You need to create an implementation class
for the modeled class that has derived attributes. Moreover, if class
A contains derived attributes, class B contains derived attributes and
class C does not contain derived attributes but it inherits from both
A and B, you need to create an implementation class for C to merge
implementations of A and B. It is up to you to decide whether the
implementation class for C will inherit from A and copy implementation
of B or vice versa.
Comment 4 Pavel Flaska 2002-06-25 18:03:41 UTC
Anonymous classes association in physical/containment hierarchy has
bad multiplicity at parentScope end. It should have 0..1.
Comment 5 Pavel Flaska 2002-06-26 09:46:16 UTC
Remove test
-----------
120 instances of TypedElement referencing to ClassDescriptor: 
(all in one transaction)
New impl.: 4 attemps, 2,391 - 2,836 ms, average *2,532* ms.
Old impl.: 4 attepms, 2,749 - 3,172 ms, average *2,864* ms.


120 instances of TypedElement referencing to PrimitiveType:
(all in one transaction)
New impl: 4 attemps, 2,471 - 2,744 ms, average *2,605* ms.
Old impl: 4 attemps, 3,164 - 3,321 ms, average *3,220* ms.

(Note: in old implementation, there had to be removed IsOfType
associations too, in new impl only TypedElement were removed.)
Comment 6 Tomas Hurka 2002-09-18 15:42:36 UTC
Done in branch meta_2