eclipse-leshan / leshan

Java Library for LWM2M
https://www.eclipse.org/leshan/
BSD 3-Clause "New" or "Revised" License
643 stars 407 forks source link

Transport Layer Module design. #1295

Open sbernard31 opened 1 year ago

sbernard31 commented 1 year ago

Adding the new transport layer (#1025) means probably changing the java module design.

Current modules are described at : https://github.com/eclipse/leshan/wiki/Modules

Here is a proposal for a new design :

leshan-core

leshan-tl

leshan-demo

sbernard31 commented 1 year ago

@JaroslawLegierski, @Warmek do you have any opnion about this ?

I try to get feedback before to do this very impacting changes.

sbernard31 commented 4 months ago

@JaroslawLegierski, @mgdlkundera, I would like to do that renaming soon. So if you have any opinion ? (about the renaming itself and/or the plan/timing about that it)

I think we will be able to do this once we have the minimum viable feature for write attributes in master. (https://github.com/eclipse-leshan/leshan/pull/1514#issuecomment-1957229543)

sbernard31 commented 1 week ago

This is implemented by #1628.

Finally, I decide to go with leshan-demo-??? for demo and leshan-lwm2m-??? for library. So when modules are sorted by alphabetic order, they are grouped by kind (demo, transport, lwm2m)

Here is renaming details :

leshan-bsserver-demo ─────────────► renamed by ──────► leshan-demo-bsserver
leshan-client-demo ───────────────► renamed by ──────► leshan-demo-client
leshan-server-demo ───────────────► renamed by ──────► leshan-demo-server
leshan-server-core-demo ──────────► renamed by ──────► leshan-demo-servers-shared
leshan-core-demo ─────────────────► renamed by ──────► leshan-demo-shared

leshan-integration-tests ─────────► not changed ─────► leshan-integration-tests 

leshan-client-core ───────────────► renamed by ──────► leshan-lwm2m-client
leshan-core ──────────────────────► renamed by ──────► leshan-lwm2m-core
leshan-server-core ───────────────► split in ──┬─────► leshan-lwm2m-server
                                               └─────► leshan-lwm2m-bsserver
leshan-server-redis ──────────────► renamed by ──────► leshan-lwm2m-server-redis

leshan-client-cf ─────────────────► split in ──┬─────► leshan-tl-cf-client-coap
                                               └─────► leshan-tl-cf-client-coap-oscore
leshan-server-cf ─────────────────► split in ──┬─────► leshan-tl-cf-server-coap
                                               ├─────► leshan-tl-cf-bsserver-coap
                                               ├─────► leshan-tl-cf-bsserver-coap-oscore
                                               └─────► leshan-tl-cf-server-coap-oscore

leshan-core-cf ───────────────────► split in ──┬─────► leshan-tl-cf-shared
                                               └─────► leshan-tl-cf-shared-oscore

leshan-tl-javacoap-client ────────► renamed by ──────► leshan-tl-jc-client-coap
leshan-tl-javacoap-client-coaptcp ► renamed by ──────► leshan-tl-jc-client-coaptcp
leshan-tl-javacoap-server ────────► renamed by ──────► leshan-tl-jc-server-coap
leshan-tl-javacoap-server-coaptcp ► renamed by ──────► leshan-tl-jc-server-coaptcp
leshan-tl-javacoap-core ──────────► renamed by ──────► Leshan-tl-jc-shared

I know some will think that there is now too much module and this is painful but the project is growing and modularity will help for maintainability.

Note that some packages are renamed too but your IDE should fix it using kind of "Organize Import" feature.

niklas-sparfeld-gcx commented 5 hours ago

In today's SNAPSHOT I see that there are two packages org.eclipse.leshan.server and org.eclipse.leshan.servers. Two import statements I stumbled upon are

import org.eclipse.leshan.server.security.Authorizer
import org.eclipse.leshan.servers.security.Authorization

Are you aware of this naming? I found it slightly confusing at first glance, but I did not have the time to look into whether you wrote down some reasoning already. sorry bout that.