Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[mat-dev] Planned Refactoring: split into snapshot api and report api

Title: Planned Refactoring: split into snapshot api and report api

Guys:

weve been thinking about refactoring some functionality inside MAT. Currently, the report generation functionality (org.eclipse.mat.query.* and org.eclipse.mat.test.*) is very closely tied to the heap dump functionality (org.eclipse.mat.snapshot.*). However, this is unfortunate if we want to use the same report/test/ui infrastructure for other artifacts like thread dumps, etc. That’s why we would like to split the plug-ins into the respective functionality:

org.eclipse.mat.report

  --> query infrastructure + report generation

org.eclipse.mat.api

 --> heap dump api / default queries

I have looked at the code. This involves a number of changes:

* Most importantly, some classes have to move to other packages. I want to avoid that we have one and the same package name across different plug-ins. While this requires some code changes, they should be relatively easily resolved by running Organize Imports on the project.

* As some extensions points would move to the newly created plug-in, this requires changes in the plugin.xml of plug-ins that contribute to the particular extension point:

  <extension point="org.eclipse.mat.api.query">

       becomes <extension point="org.eclipse.mat.report.query">

  <extension point="org.eclipse.mat.api.report">

       becomes <extension point="org.eclipse.mat.report.report">

* Not absolutely needed, but Id like to get rid of the class QueryUtil: This class was used to execute queries from within another query. However, it relied on instantiating the target class directly and therefore makes it very hard to replace the implementation for another set of JDK classes. I am proposing the following syntax.

        IResult result = SnapshotQuery.lookup("hash_entries", snapshot) //

                        .set("objects", objectIds) //

                        .execute(listener);

* Also, Ill try to clean-up the awkward ObjectListResult. The usage

 ObjectListResult(String label, int[] objects);

     becomes: ObjectListResult.Outbound(ISnapshot snapsoht, int[] objectIds);


Please drop me an email if you are using the current MAT API. Id like to know what you are using. If you shout out now, we can help you making the necessary changes.

My current plan is to open a new branch early next week (~~June 10).

Cheers,

Andreas.

Andreas Buchen

Senior Software Developer

SAP AG

Dietmar-Hopp-Allee 16
69190 Walldorf, Germany

T   +49 62 27 7-6 64 78

F   +49 62 27 78-4 47 74

andreas dot buchen at sap dot com

www.sap.com

Sitz der Gesellschaft/Registered Office: Walldorf, Germany

Vorstand/SAP Executive Board: Henning Kagermann (Sprecher/CEO), Léo Apotheker (stellv. Sprecher/Deputy CEO), Werner Brandt, Claus Heinrich, Gerhard Oswald, Peter Zencke

Vorsitzender des Aufsichtsrats/Chairperson of the SAP Supervisory Board: Hasso Plattner, Registergericht/Commercial Register Mannheim No HRB 350269


Back to the top