Skip to content

Commit

Permalink
add documentation for the famix java metamodel
Browse files Browse the repository at this point in the history
  • Loading branch information
badetitou committed May 6, 2024
1 parent 164c454 commit add5fde
Show file tree
Hide file tree
Showing 3 changed files with 362 additions and 5 deletions.
22 changes: 19 additions & 3 deletions moose-wiki/Users/famix-java/famix-java.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,18 +6,26 @@ title: 'Famix Java'
toc: true
---

> This is a work in progress page that tries to help beginners. Do not hesitate to contact us for more information
Famix Java is the metamodel included in Moose used to represent any Java application.
As you can imagine, the metamodel is rather than complicated.
For instance, Famix Java uses a lot the [traits concept](/Developers/predefinedEntities).

We will present here some incorrect, but simplify and useful view to enable beginners to use Famix Java.
We will present here some incorrect, but simple and useful views to enable beginners to use Famix Java.

## Class neighborhood

![Parametric schema](./img/class-neighborhood.drawio.svg){: .img-fluid .img-center }

Most of the time, you only need to understand these core entities to start analyzing your application.
You can retrieve the main concepts: Packages, Classes, Methods and Attributes.
You'll notice that relation between Methods and Attribute is made from the Access reification, as well as Method invocation through the Invocation concept.

The complete meta-model is not represented here.
For instance, it also includes LocalVariable, Parameters, ParametricClasses and a lot more.

> In Moose, all relation are bi-directional.
> We added the arrow on relation based on common usage, but you can always go the other way around.
## Type neighborhood

```mermaid!
Expand All @@ -37,6 +45,14 @@ classDiagram
FamixJavaInterface <|-- FamixJavaParametricInterface
```

Types are the central pieces of Object-Oriented programming languages.
In the FamixJava meta-model, all types are subclass of the FamixJavaType concept.
In addition to the FamixJavaClass previously described, we represent Interface, Enum, PrimitiveType, ParameterType, and Wildcard.

ParameterType and Wildcard are mostly used when looking for parametric type.

Primitive type are made to represent `int`, `double`, `long`, *etc.* in Java, as well as `void` if necessary.

### Focus on Parametric Type

Parametric types are probably the most hard to understand.
Expand Down
341 changes: 339 additions & 2 deletions moose-wiki/Users/famix-java/img/class-neighborhood.drawio.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 4 additions & 0 deletions moose-wiki/Users/famix-java/img/types.drawio.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit add5fde

Please sign in to comment.