Skip to content

Instantly share code, notes, and snippets.

@cdelashmutt-pivotal
Last active October 10, 2016 18:50
Show Gist options
  • Save cdelashmutt-pivotal/aebbe891b4555f315835450879c4a4ad to your computer and use it in GitHub Desktop.
Save cdelashmutt-pivotal/aebbe891b4555f315835450879c4a4ad to your computer and use it in GitHub Desktop.
Notional Rulebase config file?
---
- "Web Profile":
app_type: java
file_type: config
refactor_rating: 0
description: "Web application config file"
files:
- "persistence.xml": { description: "JPA based ORM" }
- "web.xml"
- "applicationContext.xml": { description: "Spring application config file" }
- "WEB-INF"
- "css"
- "JEE Config":
app_type: java
file_type: config
refactor_rating: 1
replatform_advice: "Convert to Spring based application configuration"
description: "JEE specific config file"
files:
- "application.xml"
- "application-client.xml"
- "ejb-jar.xml"
- "ra.xml"
- "webservices.xml"
- "Weblogic Config":
app_type: java
file_type: config
refactor_rating: 1
replatform_advice: "Convert to Spring based application configuration"
description: "Weblogic specific config file"
files:
- "weblogic.xml"
- "weblogic-cmp-rdbms-jar.xml"
- "weblogic-ejb-jar.xml"
- "weblogic-ra.xml"
- "persistence-configuration.xml"
- "weblogic-webservices.xml"
- "weblogic-wsee-clientHandlerChain.xml"
- "webservice-policy-ref.xml"
- "weblogic-wsee-standaloneclient.xml"
- "weblogic-application.xml"
- "WebSphere Config":
app_type: java
file_type: config
refactor_rating: 1
replatform_advice: "Convert to Spring based application configuration"
description: "WebSphere specific config file"
files:
- "client-resource.xmi"
- "ibm-application-bnd.xmi"
- "ibm-application-bnd.xml"
- "ibm-application-client-bnd.xmi"
- "ibm-application-client-bnd.xml"
- "ibm-application-client-ext.xmi"
- "ibm-application-client-ext.xml"
- "ibm-application-ext.xmi"
- "ibm-application-ext.xml"
- "ibm-ejb-access-bean.xml"
- "ibm-ejb-jar-bnd.xmi"
- "ibm-ejb-jar-bnd.xml"
- "ibm-ejb-jar-ext.xmi"
- "ibm-ejb-jar-ext.xml"
- "ibm-ejb-jar-ext-pme.xmi"
- "ibm-ejb-jar-ext-pme.xml"
- "ibm-webservices-bnd.xmi"
- "ibm-webservices-bnd.xml"
- "ibm-web-bnd.xmi"
- "ibm-web-bnd.xml"
- "ibm-web-ext-pme.xmi"
- "ibm-web-ext-pme.xml"
- "j2c_plugin.xml"
- "JBoss Config":
app_type: java
file_type: config
refactor_rating: 1
replatform_advice: "Convert to Spring based application configuration"
description: "JBoss specific config file"
files:
- "jaws.xml"
- "jboss.xml"
- "jbosscmp-jdbc.xml"
- "jboss-service.xml"
- "jboss-web.xml"
- "Java EE Config":
app_type: java
file_type: config
refactor_rating: 1
replatform_advice: "Convert to Spring based application configuration"
description: "CDI Beans Config"
text_pattern: ["xmlns.jcp.org/xml/ns/javaee"]
files: [ "beans.xml" ]
- "EJB":
app_type: java
file_type: java
refactor_rating: 3
replatform_advice: "Convert to Spring based POJOs for managing data"
description: "EJB Java API Import"
file_pattern: "*.java"
text_pattern: ["import javax.ejb."]
- "JBoss":
app_type: java
file_type: java
refactor_rating: 3
replatform_advice: "Convert to Spring based POJOs instead of using container specific functionality"
description: "JBoss Java API Import"
file_pattern: "*.java"
text_pattern: ["import org.jboss."]
- "JCA":
app_type: java
file_type: java
refactor_rating: 3
replatform_advice: "Convert to Spring based POJOs for configuring resource connections"
description: "JCA Java API Import"
file_pattern: "*.java"
text_pattern: ["import javax.resource."]
- "JMS":
app_type: java
file_type: java
refactor_rating: 2
replatform_advice: "Convert to Spring based message listener POJOs for messaging based applications"
description: "JMS Java API Import"
file_pattern: "*.java"
text_pattern: ["import javax.jms."]
- "JNDI":
app_type: java
file_type: java
refactor_rating: 1
replatform_advice: "Convert to Spring Beans and dependency injection"
description: "JNDI Java API Import"
file_pattern: "*.java"
text_pattern: ["import javax.naming."]
- "JPA":
app_type: java
file_type: java
refactor_rating: 0
replatform_advice: "JPA will work inside of Cloud Native applications, but changes may need to be made to the way JPA is configured to get connections."
description: "JPA Java API Import"
file_pattern: "*.java"
text_pattern: ["import javax.persistence."]
- "JTA":
app_type: java
file_type: java
refactor_rating: 0
replatform_advice: "Applications that use JTA often can be refactored to use Spring Transactions to coordinate atomic resources"
description: "JTA Java API Import"
file_pattern: "*.java"
text_pattern: ["import javax.transaction."]
- "Spring JNDI":
app_type: java
file_type: java
refactor_rating: 1
replatform_advice: "Convert to Spring Beans and dependency injection"
description: "Spring JNDI Java API Import"
file_pattern: "*.java"
text_pattern: ["import org.springframework.jndi."]
- "Weblogic":
app_type: java
file_type: java
refactor_rating: 3
replatform_advice: "Move away from container specific APIs to portal APIs such as Spring"
description: "Weblogic Java API Import"
file_pattern: "*.java"
text_pattern: ["import weblogic."]
- "WebSphere":
app_type: java
file_type: java
refactor_rating: 3
replatform_advice: "Move away from container specific APIs to portal APIs such as Spring"
description: "WebSphere Java API Import"
file_pattern: "*.java"
text_pattern:
- "import ibm.websphere."
- "import ibm.wsspi."
- "Spring":
app_type: java
file_type: java
refactor_rating: 0
description: "Spring Java API Import"
file_pattern: "*.java"
text_pattern: ["import org.springframework."]
- "Web Profile":
app_type: java
file_type: java
refactor_rating: 0
description: "Servlet Java API Import"
file_pattern: "*.java"
text_pattern: ["import javax.servlet."]
- "12 Factor":
app_type: java
file_type: config
refactor_rating: 1
file_pattern: "*.xml"
text_pattern:
- "port=": { description: "Port Hard Code", replatform_advice: "Switch to configuration injected via environment" }
- "file://": { description: "Local Filesystem Reference", replatform_advice: "Read only, immutable files are ok, but writing to the local filesystem will not persist. Investigate local filesystem access further, and refactor code that stores local data to use an external service, if necessary." }
- ".NET Framework":
app_type: dotnet
file_type: config
refactor_rating: 0
replatform_advice: "Switch to .NET Framework 4.0 or later, or consider migration to .NET Core"
file_pattern: "*.csproj"
text_pattern:
- "<TargetFrameworkVersion>v1.0</TargetFrameworkVersion>": { description: ".NET Framework 1.0", refactor_rating: 3 }
- "<TargetFrameworkVersion>v1.1</TargetFrameworkVersion>": { description: ".NET Framework 1.1", refactor_rating: 3 }
- "<TargetFrameworkVersion>v2.0</TargetFrameworkVersion>": { description: ".NET Framework 2.0", refactor_rating: 3 }
- "<TargetFrameworkVersion>v3.0</TargetFrameworkVersion>": { description: ".NET Framework 3.0", refactor_rating: 1 }
- "<TargetFrameworkVersion>v3.5</TargetFrameworkVersion>": { description: ".NET Framework 3.5", refactor_rating: 1 }
- "<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>": { description: ".NET Framework 4.0", replatform_advice: ~ }
- "<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>": { description: ".NET Framework 4.5", replatform_advice: ~ }
- "<TargetFrameworkVersion>v4.5.1</TargetFrameworkVersion>": { description: ".NET Framework 4.5.1", replatform_advice: ~ }
- "<TargetFrameworkVersion>v4.5.2</TargetFrameworkVersion>": { description: ".NET Framework 4.5.2", replatform_advice: ~ }
- "<TargetFrameworkVersion>v4.6</TargetFrameworkVersion>": { description: ".NET Framework 4.6", replatform_advice: ~ }
- "<TargetFrameworkVersion>v4.6.1</TargetFrameworkVersion>": { description: ".NET Framework 4.6.1", replatform_advice: ~ }
- "<TargetFrameworkVersion>v4.6.2</TargetFrameworkVersion>": { description: ".NET Framework 4.6.2", replatform_advice: ~ }
- "Windows Service":
app_type: dotnet
file_type: csharp
refactor_rating: 1
replatform_advice: "Convert the Windows service to a console application"
file_pattern: "*.cs"
description: "Class extending ServiceBase"
text_pattern: [ ": ServiceBase" ]
- "Database Access":
app_type: dotnet
file_type: csharp
refactor_rating: 1
replatform_advice: "Typically, applications using databases need to be converted to receive their connection strings from the environment. Use Project Steeltoe (steeltoe.io) to easily inject cloud provided service bindings."
file_pattern: "*.cs"
text_pattern:
- "using System.Data.OleDb;": { description: "Class importing System.Data.OleDb" }
- "using System.Data.Odbc;": { description: "Class importing System.Data.Odbc" }
- "using System.Data;": { description: "Class importing System.Data (ADO.NET)" }
- "using System.Data.Entity;": { description: "Class importing System.Data.Entity (Entity Framework)" }
- "Local Filesystem Access":
app_type: dotnet
file_type: csharp
refactor_rating: 1
replatform_advice: "Relying on the local filesystem to store state is unreliable in a cloud platform. Since containers are immutable, restarts will lose any written changes. Refactor this logic to use an external service to store state."
file_pattern: "*.cs"
text_pattern:
- "File.Append": { description: "Appending to a file (File.Append*)" }
- "File.Create": { description: "Calling File.Create" }
- "File.Move": { description: "Calling File.Move" }
- "File.Open": { description: "Calling File.Open (investigate further to determine refactor rating)", refactor_rating: 0 }
- "File.OpenWrite": { description: "Calling File.OpenWrite" }
- "File.Replace": { description: "Calling File.Replace" }
- "File.Set": { description: "Setting File Metadata (File.Set*)" }
- "File.Write": { description: "Writing to a file (File.Write*)" }
- "new FileStream(": { description: "Direct construction of FileStream (investigate further to determine refactor rating)" }
- "FileSystemWatcher": { description: "Use of FileSystemWatcher" }
@jwilliams-pivotal
Copy link

jwilliams-pivotal commented Oct 10, 2016

Description at the config -> child level makes sense. that will get rid of a lot of the duplicate "description" entries. Something like this?

- "JBoss Config":
    - type: config
    - description: "JBoss specific config file"
    - replatform_advice: "Convert to Spring config bean definitions or use platform services"
    - refactor_rating: 1
    - file_names: 
        - jaws.xml
        - jboss.xml
        - jbosscmp-jdbc.xml
        - jboss-service.xml
        - jboss-web.xml
- "Java Code - EJB":
    - type: java
    - description: "EJB Java imports that are problematic for most cloud native platforms"
    - replatform_advice: "Convert to spring based POJOs"
    - refactor_rating: 3
    - text_pattern: "import javax.ejb."
    - filename_pattern: "*.java"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment