groovy-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Mr Andersson <mr.andersson....@gmail.com>
Subject Re: Integrating Groovy with a Java EE application and Maven
Date Sun, 26 Jun 2016 11:05:27 GMT


On 06/26/2016 11:22 AM, Jochen Theodorou wrote:
> On 26.06.2016 09:14, Mr Andersson wrote:
>>
>>
>> On 06/24/2016 10:40 PM, Jochen Theodorou wrote:
>>> On 24.06.2016 17:41, Mr Andersson wrote:
>>> [...]
>>>> If you want to convince me of switching, i am still looking/waiting 
>>>> for
>>>> someone to offer cyclic dependency support between modules, since
>>>> without it, my code is getting more complex than need be.
>>>
>>> then you probably do not want modules, but just multiple source
>>> folders... because what advantages are left of modules if they are
>>> cyclic?
>>
>> Access rights. Even if a module/package is a cyclic, unless another
>> module has specifically declared that you can access it, can you access
>> it. It is like packages, but with access rules attached to them, which
>> does not exist currently.
>
> How exactly are you using that? I know only dependencies, no module 
> level access rights, since I guess you do not talk about jdk9 jigsaw. 
> And how do these translate to runtime?

No, in the runtime there are no checks. As you know, currently a module 
in maven can only access another if it  declares a dependency on 
another. This might be happening at compile time in Maven where a 
missing import will raise an error because of a missing jar file.

I am arguing for a maven like dependency manager, that would build a 
Java like package structure based on the modules it imports. So module A 
and module B would go into one package, where by default ( in Java ) 
they can access each other as they please. But to prevent say B from 
accessing A, you need to check that B actually has a dependency declared 
on A, and then raise an error. This would occur at build time.

Imagine like a one big module project, that only consists of root 
packages, each mimicking a module. That would work fine for me, and 
enable cyclic dependencies to work, but I can not as of now enforce 
rules on access rights, which if I turn the project to someone else, 
someone might start using packages across and destroy any extraction of 
one module, without extracting all project/modules.

I am not sure how Intelllij does it, but in Intellij modules can have 
cyclic dependencies between them. The only problem is that Intellij only 
offers it inside Intellij and does not offer a maven like dependency 
manager to build a project, declare dependencies from a config, download 
dependencies and what not.



>
> bye Jochen
>


Mime
View raw message