Skip to content
This repository has been archived by the owner on Jun 17, 2021. It is now read-only.
/ shared-views Public archive

Shared Views is an IntelliJ IDEA plugin that provides an alternative view of the project code defined by "views". These "view" definitions may be committed as part of the code base and shared amongst a team.

License

Notifications You must be signed in to change notification settings

HotelsDotCom/shared-views

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Shared Views

Description


Shared Views is an IntelliJ IDEA plugin that provides an alternative view of the project code defined by "views". These "view" definitions may be committed as part of the code base and shared amongst a team.

How to obtain the plugin

You can get the plugin from the JetBrains Repository through IntelliJ or you can download from the JetBrains Repository.

How to build and install


  1. Configure the IntelliJ SDK as described here Configuring IntelliJ Platform Plugin SDK - java 1.6 is necessary to set as the underlying JDK
  2. Using git, clone the source code from this repository to a local folder sharedviews.
  3. In IntelliJ, File -> New Project -> IntelliJ Platform Plugin -> Select sharedviews/shared-views -> Finish
  4. Set the tests folder as the test root, Right click on the tests folder -> Mark Directory As -> Test Sources Root
  5. Run the tests, Right click on the tests folder -> Run 'All Tests'
  6. Build the plugin, Build -> Make Project
  7. Generate the plugin jar, Build -> Prepare Plugin Module 'shared-views' For Deployment
  8. Install the plugin, IntelliJ IDEA -> Preferences -> Plugins -> Install plugin from disk... -> Select the jar generated above -> Apply -> OK -> Restart

Example


Code bases grow organically over time and are typically structured in a way that is convenient for building and maintaining. These modules or groupings are restricted in that they can only group code together in one way i.e. java packages, maven modules etc.

Take the following example project using maven:

package com.company.project.module.a;

public class AToBTransformer {
  public B transform(A a) {+};
}
package com.company.project.module.b;

public class BToCTransformer {
  public C transform(B b) {+};
}
package com.company.project.module.c;

public class CToDTransformer {
  public D transform(C c) {+};
}
package com.company.project.services.x;

public class ExternalService {

  public X getX(A a) {
    B b = AToBTransformer.transform(A a);
    C c = BToCTransformer.transform(B b);
    D d = CToDTransformer.transform(C c);
    return serviceObject.callExternal(d);
  }

}

In this example it would be necessary to have four separate modules/packages open to view the object transformation in it's entirety. A shared view consisting of these files could be created to synthetically group the related classes together.

external-service.view:

module-a/src/main/java/com/company/project/module/a/AToBTransformer.java
module-b/src/main/java/com/company/project/module/b/BToCTransformer.java
module-c/src/main/java/com/company/project/module/c/CToDTransformer.java
service-x/src/main/java/com/company/project/services/x/ExternalService.java

This would allow a developer to quickly open the associated classes and view the logic flow of the transformation of A to D.

Example project without Shared Views: Example project without Shared Views

Example project with example Shared Views definition: Example project with example Shared Views definition

Example project Shared Views: Example project Shared Views

Thanks


Thanks goes to:

  1. Krishnakumar Govindarajan
  2. Nerses Aznauryan
  3. Paul Wheeler
  4. Adrian Woodhead

Suggested features


  1. Include all of the files from a folder by providing the path to the folder.

Legal


This project is available under the Apache 2.0 License.

Copyright 2015 Expedia Inc.

About

Shared Views is an IntelliJ IDEA plugin that provides an alternative view of the project code defined by "views". These "view" definitions may be committed as part of the code base and shared amongst a team.

Resources

License

Code of conduct

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 3

  •  
  •  
  •  

Languages