Re: [lsug] Dependency Injection

From: Alois C.
Sent on: Thursday, February 14, 2013 6:59 PM
Thanks for your feedback Sandro :)

About your suggestion: it's exactly what I'm doing, very simple app with dump implementation just to show to put things together.
I just have to finalize the test that show how to integrate mock/stub easily.

I'll ping you once I updated the docs, I just wait to move an other project in production with it before releasing 1.0-final, that way I'm sure no features are missing.

For what is worth, there is already other projects in production with RC, but the one I want to integrate it now is more complex and should cover most common use-cases.

Cheers


On 14 February[masked]:56, Sandro Mancuso <[address removed]> wrote:
Compared to the Scala alternatives I've seen so far, I like it. 

No boilerplate code and non-intrusive. Good job. :)

If you don't mind a suggestion: Whenever you release the tutorial / user guide / example app for the 1.0 version, focus in giving us a very clear idea on how sindi can be used in conjunction with mocks. Having a clean code and also clean tests is one of our main priorities when deciding which frameworks to use. Also, besides just listing all the possible ways sindi can be used, please state how you prefer to use it.  

We will definitely look at it when 1.0 is released. A bit risky for us to adopt it right now. 

Once again, great job. :) 

From: Alois Cochard <[address removed]>
To: [address removed]
Sent: Thursday, 14 February 2013, 16:31

Subject: Re: [lsug] Dependency Injection

Hi Sandro,

Thanks for your interest :)

As I said in my original message the website is outdated and refer to sindi 0.5 which was using a compiler plugin (current version is 1.0-RC3 and is implemented with implicits), I should update it but haven't found time yet to do so :-s

I plan to add a simple app example, as test don't really show how to integrate it concretely in an application, the approach I generally take:

class Bar
class Foo(bar: Bar) {
   def run = println("hello world")
}

trait ApplicationContext {
   implicit val bar = bind(new Bar) // manually creating instance
   implicit val foo = bind(autowire[Foo]) // using autowiring to inject construtor parameter
}

object App extends ApplicationContext {
   inject[Foo].run
}

Hope that help getting started ;)

Cheers



On 14 February[masked]:16, Sandro Mancuso <[address removed]> wrote:
Hi Alois

Thanks for your email. 

I'm having problems to look at the documentation / examples: http://aloiscochard.github.com/sindi/guide/basic.html


I'm also getting a 404 when looking at the examples: https://github.com/aloiscochard/sindi/wiki/Examples


I'll definitely have a closer look at it soon. 

Many thanks and good luck with the project. 

From: Alois Cochard <[address removed]>
To: [address removed]
Sent: Thursday, 14 February 2013, 15:59
Subject: Re: [lsug] Dependency Injection

Hi Sandro,

You might be interested in http://github.com/aloiscochard/sindi

Which I am the auther, doc on the website aren't updated for last version but there is some nice tests: 

Sindi isn't intrusive, and guarantee your types to be bound at compile time vs runtime thanks to implicitis resolution, and using autowiring (that use macro in 2.10) you can avoid good bunch of boilerplates.

I'm a bit skeptic about cake pattern in large project as this introduce a good bunch of complexity with path dependent type, even if some technic shown recently by Daniel Spiewak and Debasish Gosh that use existential type enable to work around issue introduced by path dependent type, I still find it very boilerplaty

For small scale project cake/reader monad might be well suited.

In one of my personal project I started recently I try to do it using implicits without even using Sindi, I'm not sure it will scale well outside of utilities libraries... time will tell ;)

May the Force be with you,

Alois Cochard



On 14 February[masked]:51, Sandro Mancuso <[address removed]> wrote:
Hi all

We are starting a project with Scala but none of us are very experienced with it. 

We were looking for ways to do dependency injection and we found the following:

Cake pattern: 
http://www.cakesolutions.net/teamblogs/2011/12/15/dependency-injection-vs-cake-pattern/

SubCut:

https://github.com/dickwall/subcut/blob/master/GettingStarted.md
http://vimeo.com/36217414

We also find a few dead repositories on github but nothing very relevant. 

I was wondering what you guys are using of DI in Scala. Pros and Cons?

Maybe because of my lack of experience in Scala, I found the Cake Pattern a bit verbose and SubCut a bit intrusive since I need to add SubCut stuff to all my classes. At least, that was my impression when reading the tutorial. 

Any views?

Thanks




--
Please Note: If you hit "REPLY", your message will be sent to everyone on this mailing list ([address removed])
This message was sent by Sandro Mancuso ([address removed]) from London Scala Users' Group.
To learn more about Sandro Mancuso, visit his/her member profile




--
Please Note: If you hit "REPLY", your message will be sent to everyone on this mailing list ([address removed])
This message was sent by Alois Cochard ([address removed]) from London Scala Users' Group.
To learn more about Alois Cochard, visit his/her member profile






--
Please Note: If you hit "REPLY", your message will be sent to everyone on this mailing list ([address removed])
This message was sent by Sandro Mancuso ([address removed]) from London Scala Users' Group.
To learn more about Sandro Mancuso, visit his/her member profile






--
Please Note: If you hit "REPLY", your message will be sent to everyone on this mailing list ([address removed])
This message was sent by Alois Cochard ([address removed]) from London Scala Users' Group.
To learn more about Alois Cochard, visit his/her member profile






--
Please Note: If you hit "REPLY", your message will be sent to everyone on this mailing list ([address removed])
This message was sent by Sandro Mancuso ([address removed]) from London Scala Users' Group.
To learn more about Sandro Mancuso, visit his/her member profile



--
Alois Cochard

Our Sponsors

People in this
Meetup are also in:

Sign up

Meetup members, Log in

By clicking "Sign up" or "Sign up using Facebook", you confirm that you accept our Terms of Service & Privacy Policy