Giter Site home page Giter Site logo

Comments (4)

klauss42 avatar klauss42 commented on June 20, 2024 1

Just to confirm: New version 0.8.5 now works in IDEA

from ideaplugin.

CodeDrivenMitch avatar CodeDrivenMitch commented on June 20, 2024

@klauss42 Can you share with me your aggregate structure? It's seems there is a recursivity somewhere in the model, and we get an infinite loop in our analysis. Of course I can make an iteration guard, but I'd like to see if there's a possibility I missed in the structure resolver.

from ideaplugin.

klauss42 avatar klauss42 commented on June 20, 2024

Hi Mitchell,
we have a lot aggregates in our project, but as you mentioned recursion, here is a simplified extract from an aggregate, that has been introduced recently. Maybe this kind of structure breaks the plugin?

The OrganizationalUnitAggregate holds a tree of organizational units to represent an arbitrary organization structure.

data class OrganizationalUnitId(val id: String = UUID.randomUUID().toString())

// Represents the root-OU of an OU-hierarchy-tree
@Aggregate
internal class OrganizationalUnitAggregate : OrganizationalUnitNode<OrganizationalUnitEntity> {

  @AggregateIdentifier
  override lateinit var organizationalUnitId: OrganizationalUnitId

  @AggregateMember
  override val children = mutableListOf<OrganizationalUnitEntity>()

}

// Represents a non-root OU in the OU-hierarchy-tree
internal class OrganizationalUnitEntity(
  @EntityId
  override var organizationalUnitId: OrganizationalUnitId,
) : OrganizationalUnitNode<OrganizationalUnitEntity> {

  @AggregateMember
  override val children: MutableList<OrganizationalUnitEntity> = mutableListOf()
}

// Represents any node of an OU-hierarchy-tree, either the root (Aggregate) or any
// other non-root-node (Entity); T = Type of children
internal interface OrganizationalUnitNode<T> where T : OrganizationalUnitNode<T> {

  var organizationalUnitId: OrganizationalUnitId
  val children: MutableList<T>

  fun addChild(child: T) {
    children.add(child)
  }

  fun removeChild(childOrganizationalUnitId: OrganizationalUnitId) {
    children.removeIf { node -> node.organizationalUnitId == childOrganizationalUnitId }
  }
}

Klaus

from ideaplugin.

CodeDrivenMitch avatar CodeDrivenMitch commented on June 20, 2024

Yep that will be the recursion! I made a PR that will resolve this. I will release 0.8.5 as soon as that's merged.

from ideaplugin.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.