It is said here:
http://msdn.microsoft.com/en-us/library/ff921087.aspx
I believe it's the Composite Application Library material that's retired, and not the concept of IoC in general.
IoC/ Dependency Injection is not outdated at all in my opinion. Its actually becoming more and more popular as more frameworks are being introduced for it. If its not solething you are currently looking to use then I would suggest having a look into it
try out ninject or structuremap if you havent already.
I have only recently got into it and its something i now feel very strongly about
Related
i have a use case where i would like to offer a simple API to extend the functionality of my scala application.
i've spent the last couple of days trying to find a java/scala DI framework or library that does the following for me:
identifies implementations of an interface/trait on the classpath
instantiates and injects said implementations ( important feature: all of them ) at a site marked, preferably with an annotation
the above can't happen in the compiler because i need a plugin architecture where the plugins are not introduced until the JVM starts
therefore above can happen at JVM start (no hot-swap necessary)
i'm gravitating more and more towards OSGi DS, which i'm a big fan of, except i see it as an overkill due to #4.
i looked at guice, weld, scaladi and macwire, and could not immediately see a simple way to do this. My objective is for the "plugin" authors to not have to be aware of my injection/IoC solution in any way, except for the occasional Annotation ( preferably JSR330 ) At the injection site i am willing to deal with uglier things. :-)
Will i have to roll my own solution here, go with OSGi, or am i missing something trivial in the above mentioned libraries?
ps: i'm trying to steer clear of OSGi mainly because of it's interaction with the application framework i'm using (akka - not sure the bundle/DS lifecycle mixes well with a single actor system)
If you can afford it, it's probably best (not only for you, but for the entire ecosystem) to go with Peter's suggestion.
Pragmatically speaking though, Java has SPI which comes OOTB and may be the simplest way to go in your particular case.
I have a look at what functionality is provided by Scaldi at the moment. I've found it is mature enough. So nothing hard to use this DI library to achieve your goals. For example you can only implement code for searching specifically annotated/specified in some configuration file or anything else.
If you like DS (and it seems eminently suitable for your problem) then why not solve any problems with Akka? I am pretty sure others will be willing to help out since it looks like an interesting combination.
I know that Scala has Swing (exclusively) as stand alone UI.
Is there any better UI (like JavaFX in Java) in Scala.For a better look and feel.
Please help.
The quick answer is no. Scala does not include a UI framework on its own. You can either use any java UI framework (swing, javaFX and others) via java interop (which is trivial) or find a scala wrapper for one of them (as the comment above).
I mainly post this since your question is else likely to go unanswered, which is kind of a burden on the site.
I am familiar to GEF3. GEF4 has a better architecture.
And I have to make decision whether using GEF3 or GEF4 MVC for our project.
My question is: Currently, is GEF4 mature (e.g full editing features like GEF3, documents, API's stability) enough? Or should I use GEF3 instead?
Thanks
Personally, I would say since the GEF 4.0.0 release that bundled GEF4 1.0.0 the framework is quite stable (API-wise). However, some support for common functionality is still lacking, which you would need to implement yourself (e.g. direct editing). If you are still unsure, you can implement a prototype with GEF to see if it fits. If you run into any problems, the GEF forum is a nice place to get help.
Several links show that https://code.google.com/p/concurrentlinkedhashmap/ has been ported to Guava, but I can not find the corresponding API in Guava.
Can anybody show me an example to build a ConcurrentLinkedHashmap using Guava ?
Thanks!
ConcurrentLinkedHashmap API wasn't ported to Guava 1:1, but some solutions from CLHM were used in MapMaker and Cache (with CacheBuilder).
ConcurrentLinkedHashmap's author Ben Manes answers a question which may clarify your doubts: What does it mean that ConcurrentLinkedHashMap has been integrated into Guava?:
Guava is the long term replacement and most of the time you should use it. The history is that ConcurrentLinkedHashMap figured out the algorithms, Guava subsumed it, and then focused on adding features.
I think it's also important to note that he's currently writing another library which may suit your needs:
Caffeine is a Java 8 rewrite of Guava's cache. It tries to provide the best of ConcurrentLinkedHashMap and Guava, modernized with Java 8, and adopting the techniques that I've learned since those previous projects.
I'm faced with writing a framework to simplify working with a large and complex object library (ArcObjects). What guidelines would you suggest for creating a framework of this kind? Are static methods preferred? How do you handle things like logging? How do you future proof your framework code from changes that a vendor might introduce?
I think of all of the various wrappers and helpers I've seen for NHibernate, log4net, and code I've read from projects like NLog and NetTopologySuite and I see so many good approaches, but honestly I'm at a loss where to start.
BTW - I'm working in C# 3.5 but it's more about recommended approach rather than language.
Brad Abrams' Framework Design Guidelines book is all about this. Might be worth a look.
Try to write code to be more flexible. For example, if you have a method that accepts an array as a parameter, would you be able to accept an IEnumerable or IList instead?
I think that you're consistent is more important than what conventions you go with. As far as future-proofing yourself, that's a matter of the code that you're making a framework for. It's a lot easier to build on a brick house than a sand one.
Writing code for framework is absolutely very different from writing application code.
I have always consulted (and have others consult) the Design Guidelines for Class Library Developers when writing framework level code.