Grails

Add functionality to the classloading mechanism so properties and methods can be injected into domain classes as opposed to inserted as text

Details

  • Type: New Feature New Feature
  • Status: Closed Closed
  • Priority: Critical Critical
  • Resolution: Fixed
  • Affects Version/s: None
  • Fix Version/s: 0.3
  • Component/s: None
  • Labels:
    None
  • Testcase included:
    yes

Description

In order to avoid some of the issues that we've seen and which are likely to come in the future, we need to have a classloader that is capable of injecting properties, methods, etc. into the domain class files so that simple user error of commenting out functionality doesn't result in unexplained application failures. In addition, this opens the door for us to generate Hibernate mappings instead of having the user define both the mapping definition and the datastructure. With this approach we will be able to look at the mapping definition and generate the datastructure ourselves, greatly increasing the readability of the code and allowing us better optimization down the road for various persistence methods and architectures.

  1. GrailsInjectingClassLoader.java
    28/Apr/06 4:53 PM
    11 kB
    Gregory Pierce
  2. GroovyInjector.java
    28/Apr/06 4:53 PM
    1 kB
    Gregory Pierce
  3. groovyTest.groovy
    28/Apr/06 4:56 PM
    0.2 kB
    Gregory Pierce

Activity

Hide
Gregory Pierce added a comment -

I have attached some initial files which will serve as a new classloader for Grails. This will mean nearly no changes to the grails application files as most work, outside of some configuration on what to inject, will be encapsulated inside the new classloader itself.

Show
Gregory Pierce added a comment - I have attached some initial files which will serve as a new classloader for Grails. This will mean nearly no changes to the grails application files as most work, outside of some configuration on what to inject, will be encapsulated inside the new classloader itself.
Hide
Gregory Pierce added a comment -

Attached a simple groovy file which illustrates the domain class being used without any explicit definition of id and version.

Show
Gregory Pierce added a comment - Attached a simple groovy file which illustrates the domain class being used without any explicit definition of id and version.
Hide
Graeme Rocher added a comment -

Bulk closing bunch of resolved issues

Show
Graeme Rocher added a comment - Bulk closing bunch of resolved issues

People

Vote (0)
Watch (0)

Dates

  • Created:
    Updated:
    Resolved: