How do I get access to Castle Windsor's Fluent Interfaces API? - api

I've been having tons of problems getting the non-xml configuration for Castle Windsor set up working properly. In the meantime I've seen more and more people giving advice via the Windsor Container fluent interface. I've been Gooogling about for the last day and I cannot find this API anywhere.
I am talking about the key .Register() method which seems to be an extension method to the IWindsorContainer object. It seems like it might be in the Castle.MicroKernel.Registration namespace, but I cannot find the corresponding library anywhere!
Also, is there any place where I can find documentation for this stuff?
EDIT:
I found that the copy of Castle.MicroKernel in the sample project here has more namespaces then the one I was using (even though this one is eight days older and v1.0.0 whereas mine is v1.0.3...), still having trouble finding the .Register() method or any samples though.
EDIT:
I found some fluent interface samples at Bitter Coder, no downloadable samples though so I'm still at a loss.
Edit Again: Finally got it. The most recent source code for castle windsor is available here, get the most recent successful build, inside the zip file is a bin directory. The fluent interface is inside Castle.Microkernel (you will probably need to reference Castle.Dynaproxy, Castle.Dynaproxy2 and Castle.Windsor too).
PS This post is the #1 Google result for "castle fluent interface documentation" sad guys, you need to get on that. Crickets chirp What's that? Fine. Let me figure this out then I'll get on it then.

The Fluent interfaces were introduced a while ago - but are only available on Trunk (after RC3) either grab the castles sources (from the projects subversion repository) and build the IoC projects yourself from here, or easier still grab the latest successful build on the continuous integration server and use that.
Castle.MicroKernel.Registration is the name space you'll need to use, in the MicroKernel assembly - once you have a reasonably fresh build of Castle you should be able to find Register(...) methods on both IKernel and IWindsorContainer interfaces, allowing the application of "registration components" (anything which implements IRegistration) which includes the various fluent component registration features in Castle, as well as anything custom you might develop.
The best place to ask questions regarding Castle is the google castle-project-users and castle-project-devel groups - keep an eye out for Craig Neuwirt in particular as he's the core developer working on the fluent interface features in Castle Windsor, and so is best equipped to answer questions about the various fluent interface features, as they are not widely documented yet.

Ok, so just for reference. Official, complete documentation for the API is on Castle Windsor Documentation Wiki

Related

FluentAssertions - complete tutorial for creating custom assertions

Has anybody seen a complete tutorial for creating custom assertion classes with FluentAssertions?
Best regards
I maintain a couple of extension packages for Fluent Assertions, so feel free to take a look at our code to see how we do it:
FluentAssertions.Mvc
FluentAssertions.Ioc.Ninjet
I also recently contributed the assembly reference assertions to the core, so have a look at this pull request. Also have a look at the FA source to see how they implement similar assertions (that's where we started).
The top line is you'll need a class to hold your assertions and an extension method to hook it in.

Where can I find up-to-date documentation about the WCF Web API?

I've been strugling with WCF to do REST the way I want it to work. And apparently so has quite a few others. I've heard about the WCF Web Api project, but wrongly dismissed it without looking too closely at it. Sadly, now that I'm looking at it I find that the documentation is rather outdated. Like, this blog post has some nice information, but classes have changed, parameters have changed, in short, design has changed.
So I've been using an old example of how to plug in Json.NET (newtonsoft) as my serializier, only to realize that after I had it working, it wouldn't work for my IErrorHandler. Further I had a problem with how to Deserialize a string from the uri template to an operation Type parameter.
It appears however that I should be able to solve these two problems (and presumably many others that I haven't stumbled over yet) by using the media formatter extension point and what's referred to as Processor<..>s in outdated documentation, which is now HttpOperationHandler<..>s unless I've missunderstood.
My problem is rather basic, I can't figure out how to correctly configure my IIS-hosted app to use my operation handler, assuming I've implemented it correctly. Since it feels rather dumb to ask for instructions on such a basic thing, I'll rather ask where I can find some documentation on how to do this sort of thing? (Explanations are welcome of course.)
I'm not after seing which classes exist, or what their methods are named with what parameters. I can see all that in my object browser. I need documentation for the overall design, and/or examples implicitly describing things like:
How do the different classes in the API fit together?
How can I configure from web.config?
Must I rather do a custom HttpServiceHostFactory?
What and how are you meant to use the framework?
How should I extend to reach what sort of goals?
How should I configure to place the extensions in effect?
From the lack of answers I assume the documentation quite simply isn't ready.
I was looking for it on the codeplex site under the Documentation tab, and found outdated stuff.
However, after familiarizing myself a bit with Codeplex I found out that the good stuff was in this Discussion section. Searching a bit in there helped a lot to be honest.
Concerning config-file configuration, I didn't find anything, so I'm assuming this will be added as the last thing before official release. Meaning I'll use the HttpConfiguration in a custom HttpServiceHostFactory for now.
The trick about the HttpOperationHandlers was twofold: Firstly I was throwing an exception in my operation and hadn't implemented a global HttpErrorHandler yet. (Doh!) Secondly I didn't know that the parameter name of HttpOperationHandler<..>.OnHandle had to match the name of the operation parameter.

Solrnet, StructureMap and NHibernate

I'm having a problem integrating a library our company has built which uses Solrnet in the back end. We have many other libraries, one of which uses NHibernate for the database. It all works fine, the library gets the data back.
When we add a reference to this new library which uses Solrnet, things start to go arwy. The first error that occurs when we run the application. when the application runs the StructureMap registry for the library using NHibernate, the registry blows up because NHibernate can't load the Castle.Core assembly (which has not caused any problems being missing prior to adding the reference). If we then ensure that Castle.Core is present, NHibernate then blows up trying to load Castle.Windsor, which again it didn't need before.
Any ideas? As I said, the library which uses NHibernate is fine if we remove the new library which uses Solrnet, but as soon as we reference it things start to go wrong. The library which uses Solrnet also configures Solrnet using StructureMap, FWIW.
EDIT: These are the versions of various assemblies in the mix.
StructureMap - 2.6.1.0
Fluent NHibernate - 1.0.0.0
NHibernate - 2.1.2.4000
Solrnet - 0.3.1.0
Castle.Core (came with NH) - 1.1.0.0
UPDATE: Its starting to look like Solrnet is the one trying to load Castle.Windsor. I'm not sure why as we've given it a StructureMap configuartion. Its mere presence is enough to blow things up. Even without the assemblies which depend on Solrnet, the fact that its there at all seems to mess with the NHibernate configuration.
Ok, I figured out how to stop this error. We were using the merged Solrnet.dll, which includes all the types for connecting to other Ioc containers as well as NH integration. I switched to using the unmerged binaries, which keeps the other Iocs in separate assemblies, and we only included the base Solrnet.dll and StructureMap.Solrnet.dll, which solved the issues mostly. I still did have to be sure to include Microsoft.Patterns.ServiceLocater, as the base Solrnet.dll still exposes this. Not ideal as we're not using it, but better than needing a bunch of other assemblies.

difference between API and framework

what is the difference between these two terms, thanks in advance for any good simplifications and good examples.
A framework is a group of classes, interfaces and other pre-compiled code upon which or by the use of which applications can be built.
The API is the public face of a framework. A well designed framework only exposes those classes, interfaces, etc that are needed to use the framework. Code that supports the operation of the framework but that is not necessary to users of the framework is kept internal to the framework's assemblies/dlls. This keeps the public face of the framework small and encourages a "pit of success," or the quality of a framework which makes it simple to do the right thing.
(I provide an example from the .NET world)
The SqlConnection class is used to connect to a Sql Server instance. Its public API is pretty simple:
using (SqlConnection connection = new SqlConnection(connectionString))
{
connection.Open();
// Do work here; connection closed on following line.
}
However, this class depends on around 200 methods within the System.Data framework (in this case, an assembly), 3/4 of which are internal and not part of the public API of System.Data. Because the framework's API is kept simple, it becomes easy to use SqlConnection properly. If the user was required to deal with SqlConnectionFactory, SqlDebugContext, DbConnectionPoolGroup or any of the other internal classes required by the SqlConnection class, it would become exponentially more difficult to use SqlConnection properly. Because the API only exposes a small percentage of the framework, it is easier to create and use a connection.
An API is an interface to a (set of) component(s) encapsulating a functionality. For instance, the GoogleMaps API, the DirectX or OpenGL APIs.
A framework is more a set of tools, components aimed at helping the developer to develop his/her project in a given Frame. The framework usually sets some coding standards, provides useful components, ... For instance, Symfony/Cake are PHP web application frameworks. JUnit is a framework for unit tests in Java, ...
Frameworks can often bundle/provide a unified interface to some APIs.
Some APIs can be internally built using a framework.
API - application programming interface -> the contract you must obey when using a library's API
library - a set of classes/modules that solve a specific problem -> has an API
framework - a "bigger" set of libraries with a set of rules on how to use them
Since every library has an API, no point in giving examples.
A popular Java library for time is Joda time.
A popular Java framework is the Spring framework.
You must obey a lot of rules to use Spring well. You don't have to obey as many rules to use Joda time.
An API is something code has, not something it is. A framework has an API, but it is not itself an API.
API "Application Programming Interface" is set of prewritten packages, classes and interfaces with their respective methods. You can use it without much concern about internal implementations. API is used an interface between two or more applications and like REST API.
Framework is a skeleton that contains design patterns, classes, interfaces and libraries that can be used to build applications. Framework provides inversion of control which give the responsibility of program flow to the framework itself, also we can extend the framework without changing its predefined code. For example Spring is a framework that can be used to build web applications.
API's are pre-built-in from SDK (or from which you can include on to). Frameworks are loadable bundles wherein exposed functions of such bundles can be used. You can acquire expose functions of those frameworks by using pointer to functions.
Example:
API:
-stringWithString:
function from framework:
-myExposedMethod:
Framework is use to design an application, ie MVC, MEF. Like a model that you build on, almost a base for a certain set of functionality that you might want in your application.
API is for interaction between applications, your app would use the Facebook API to interact with Facebook.
Hope this is a bit more clear.
Java API simply means ...Application Programming Interface in which all the features describes of product or software.
Java Framework means semi-completed project or code. It provides an architecture to make project . Framework have own classes and methods etc..
An API is simply a library built with a particular language that developers can use to build applications.
Frameworks are a set of libraries, just like APIs however the syntaxes may deffer of the original language. So the developer may be writing a different syntax of PHP for example when using Symphony.
The main or core difference beteen framework and API is that framework allows developer to hook into the life cycle of the objects through lifecycle callback methods mechanism whereas API doesn't do that, API is only intended to perform a functionality only.
Another way to visualize it is this: (true of any programming language)
Any(!) "piece of software that is intended to be used by another piece of software" by-definition must have some "application program interface (API)," which represents the "knobs, switches and dials" that the other piece of software is expected (and, permitted) to use. All of the internal implementation details are not visible and cannot be reached.
"Frameworks" are tools that are designed to make it easier for humans to write a particular, common, type of application – such as a web-page. The framework implements "the stuff that every such application is going to need to be able to do," and does it in one, well-tested way, "precisely so that you (the application author) don't have to." Instead of redundantly writing "the same old thing, one more time, and fretting over whether you did it correctly," you simply leverage what the framework has already done for you.
After all...
Actum Ne Agas: Do Not Do A Thing Already Done.

Is there a Maven plugin to generate AS3 classes from Java for BlazeDS?

I'm looking for a maven plugin that would generate ActionScript3 classes from Java classes in order to access them by object remoting.
I've seen FlexMojo but it uses the GraniteDS generator which create some problems when it comes to map Enum objects (which can be fix through a workaround that is describe here : http://dev.c-ware.de/confluence/display/PUBLIC/Flexmojos+generated+AS3+model+with+Enum+support+using+BlazeDS?focusedCommentId=7634946&#comment-7634946 if you've googled your way here this might be useful) when working with BlazeDS.
Everything that I found so far are people who explain how to generate VO classes on flex side using Flash Builder 4, but this solution can not be used in an industrial development environment.
Take a look also on http://flex-annotations.aixcept.net/examples/actionscript.html
I also found this one, and while it is not a maven plug-in it could possibly be turned into one:
https://sourceforge.net/projects/cleartoolkit/
It was created by the guys who authored the book "Enterprise Development with Flex". Look for the utility DTO2Fx.