Re: Core-Data Refactor Available for Comments

James.White2@...
 

Dell - Internal Use - Confidential

Hi Drasko,
A question for my help and understanding... back in November, we all looked at GoKit and I recall a number of members (including you and Janko if I recall correctly) suggested GoKit came with some complexities that you all felt did not serve the community well (we even noted that in our architectural notes to discourage its use by our community). Trevor did a relook and we can investigate again going forward, but I am curious if you and others in the Go community feel it has made changes (or our project has made enough advancement) that GoKit may be warranted. What are your thoughts now in light of the current direction??

jim

-----Original Message-----
From: EdgeX-GoLang@... [mailto:EdgeX-GoLang@...] On Behalf Of Drasko DRASKOVIC
Sent: Saturday, April 21, 2018 8:30 AM
To: Conn, Trevor
Cc: EdgeX-GoLang@...; edgex-tsc-core@...
Subject: Re: [Edgex-golang] Core-Data Refactor Available for Comments

Hi Trevor,
idea to move towards DDD looks great to me.

If you are moving in this direction, I think it would be interesting to examine go-kit: https://gokit.io/. It divides domains and provides onion architecture, while providing logging and instrumentation. It tends to collect and incorporate best practices.

Best regards,
Drasko DRASKOVIC
Mainflux Author and Technical Advisor

www.mainflux.com | Industrial IoT Cloud
-------------------------------------------------------------------
Engineering Division | Paris, France

LinkedIn: https://www.linkedin.com/in/draskodraskovic
Twitter: @draskodraskovic


On Fri, Apr 20, 2018 at 11:18 PM, <Trevor.Conn@...> wrote:
Just a reminder that this proposed change is available for review.
I've received some minor comments from our contributor yanghua so far,
but that's it.


Please let me know of any comments you may have (via GitHub issues or
email) by this coming Thursday, April 26.


Trevor Conn
Senior Principal Software Engineer
Dell Technologies | IoT DellTech
Trevor_Conn@...
Round Rock, TX USA
________________________________
From: Conn, Trevor
Sent: Thursday, April 12, 2018 12:40 PM
To: EdgeX-GoLang@...
Cc: edgex-tsc-core@...
Subject: Core-Data Refactor Available for Comments


Dell Customer Communication

Hi folks – Thanks to those who attended the presentation this morning
of the refactoring strategy I’ve applied to core-data-go over the last
couple weeks. If you weren’t able to attend the call but are
interested in reviewing the changes, please watch the recording of the
meeting available
here:



https://zoom.us/recording/play/NfVb5k1ji1EnHTE0Bc_2Lzfw96F9qb5KgXHlhUv
8WUbTwo09nNIfbdJHAkCV4Rha



The refactoring presentation starts at the 25 minute mark.



Here is the URL to the repo in our holding area:

https://github.com/edgexfoundry-holding/core-data-refactor



To briefly summarize, here are the primary points of interest in the
refactoring:

1.) The following application services are now initialized through a
factory which returns an interface:

a. Routing

b. Metadata clients (Device Client / Service Client)

c. MQPublisher

2.) Removal of global variables at the package level to access
application services

3.) Business logic moved out of controllers and into aggregates folder

a. Note the use of channels in
core/aggregates/events/event.go::AddNewEvent() to increase separation
of concerns.

4.) Routing and controller implementation moved into a specific package
and out of core/data package

5.) Unit test coverage focusing on the aggregate – the domain business
logic – leaving out application services (like routing)

a. See core/aggregates/events/providers.go for abstraction definitions

b. See core/aggregates/events/event_test.go for mock initialization and
“injection”



As I said on the call, there is more work that could be done here but
this is a significant chunk that establishes the direction the Core
Services team would like to move toward. We are looking to the
community to identify any major gaps or challenges that we may have missed in taking this approach.
Initial testing on this work via the blackbox testing is going well,
but additional changes may come in as we continue to test and refine.



Comments are welcome. We may need to set up some review calls or, if
you like, you can create issues/PRs against the repo.



Trevor Conn

Senior Principal Software Engineer

Dell Technologies | IoT DellTech

Trevor.Conn@...

Round Rock, TX USA



Join EdgeX-GoLang@lists.edgexfoundry.org to automatically receive all group messages.