You are not logged in.
With normal servicedefine?
aserver.ServiceDefine(TDDDEmailerDaemon,[IDomUserEmailer],sicShared);
aserver.Services.Resolve(IDomUserEmailer, adom); Hi Ab, I am testing your TDDDEmailerDaemon class proposal, it works in a way that I need. There is a way to Inject this Class as a service just like we do with repositories?
Oi Ab,
I am using packed record for dtos, they are all anemic. Which case of api public do you refer to? I am using the standard assembler for the conversion of these data. But even in this way, I have a strong coupling between domain layer and application.
Hi Ab, I was working on my implementation with mormot and I realized that my application layer is strongly attached to my domain layer. I'm using the MormotDDD unit (I think it's incredible) but in my queries and commands I pass as parameter for the aggregates. That is, I need to bring my aggregates to the application layer because queries and commands need their instance. Is there a way to solve this with mormot? A mediator maybe, or don't you see it in a bad way?
I understand AB, the first time I tried to start with domains out of context I really thought about doing it in the application, because in my view with mormot it is perfect and safe. I just thought that it would not be correct to request multiple domains from a single application layer. But analyzing your answer, you may not really choose to use domino events now, but mormot rpc calls that are very safe.
Hi Ab,
I didn't understand when you say "I would create dedicated events in the application layer (as DTO only if several domains are needed to be used at the same time.", most of the time I need to use domain events is because I am communicating domains out of the delimited context. I have a situation, for example, when an order is created in the order domain and I need to communicate the stock domain to separate the merchandise. I see no other way to do it except for events. So there are several domains, right?
I didn't find your article on the blog. Can you give me the link?
Hi ab, I was exploring event notifications via websockets, is that how you commented?
IUserEvent = Interface(IInvokable)
['{1C949DB2-5ECE-4EC6-8609-1B9FF408BDF6}']
procedure UserCreated(const UID,Login:String);
procedure UserDeleted(const UID:string);
end;
IPublisherService = interface(IInvokable)
['{3F3246E9-5B91-443F-A0D4-9159E532B6E8}']
procedure PublishUser(const User:TUserDTO; const callback:IUserEvent);
end; This way, both publishers and subscribers can be in the application layer, right? In this example, the AppUser would publish the user event created and an event handler would call another application, an AppEmail for example, to decide what to do with this information? Or should all of this happen at the domain layer?
Wonderful Ab, I will explore the ways of immediate publication with websocket. Thank you very much.
Hi Ab, I had also thought in this way, with websockets but I thought it would not be the correct one, this way the publisher and the consumer, in some cases, will be inside the same server. Do you think this is a problem? I see that with your tip I can publish events instantly and instant subscribers consume those events, correct? If I want to use an event store the best way would be to use TSQLRecord directly, or consider a domain event as an aggregate and use MOrmotDDD. What do you think?
Hi Ab, I am looking to implement domain events to communicate aggregates out of context. I'm thinking of doing this with mormot but I have no idea how I can do it. I don't know if I use Mormot's two-step verification or if I create a specialized handler. What do you recommend me on the subject?
Hi,
I redid the entire installation on lazarus + fcp recommended in the documentation, updated with the trunk of the mormot but the error persists, I cannot initialize TSQLRecords linked to empty collections. Does anyone have any idea what it might be?
Thanks Ab, I will perform the tests I report here. Doubt, do you still recommend these reviews to use with mormot?
* FPC trunk SVN 40491;
* Lazarus trunk SVN 59757.
hi Ab,
I debugged a little more about the problem and found the error exactly in the method AsynchRecv
result := Recv(sock,buf,buflen,0);in the SynCrtSock unit
Hi Ab,
Thanks for the answer. The problem is happening in the TSQLRestStorageMongoDB.TableHasRows method of the unit mormotmongodb. It happens when he executes the fCollection.IsEmpty method for every collection that is empty.
Yesterday I updated the source of the mormot and started receiving an exception in the StaticMongoDBRegisterAll method for Mongo client. I realized that the error occurs for all collections that are empty. The error message is as follows:
Server did reset the connection: probably due to a bad formatted bson request - > close socket"Ok I modified, this is for array mounting is correct? Is there a way to pass a TVariantDynArray directly?
When you say mime type are you referring to application / json? Is this not standard in every mormot answer?
Hi Ab,
Thanks for the tips, I did as follows put TServiceCustomAnswer as a result of my function and it worked as I wanted.
fTotalRows:= aPagParam.totalrows;
TDocVariant.NewFast(response);
TDocVariantData(response).AddValue('Result',res);
for i:= Low(Data) to High(Data) do
TDocVariantData(response).A_['Data'].AddItem(Data[i]);
Result.Content:= VariantSaveJSON(response);
result.Header:= Trim(
'totalrows: '+IntToString(fTotalRows)); See I'm forming content with DocVariant. My question is if this is the most correct way to format a DocVariant with TVariantDynArray? In this case the variable Data is TVariantDynArray and response is docvariant.
Hi Ab,
I used the server.OnAfterURI method because when I tried to use it by CurrentServiceContext even passing the value to the Request.Call.OutBody property had no effect.
Is it possible to work with TSQLRestServerURIContext different per interface? I would like to pass different headers per interface. I was using the Ctxt.Call.OutHead method but once defined for one interface all other interfaces on the same server will have the same header.
Very good Ab, that's what I needed, I love this framework. It worked well even with use of like. Thanks for the answers.
Thank you Ab for your answer. If I understood what you meant I could only do by opting for SQlite3? I'm currently using Mongodb, and I can do this query using specific MongoDb classes, but I wish I didn't have to opt for one and the other and that I could resolve the query at Mormot level. It's possible? or will I need to choose? I take very much into account what you said in a post "That changing databases by changing only one parameter is priceless"
I wonder if there is any way to query an aggregate through a value from a variant field that contains json objects at the ORM level?
In the case I need to search the record by searching by phone number according to the example below.
{
"_id": {
"$numberInt": "1"
},
"Name": "TRAGUETTA MOTTI",
"Doc": "075017030000113",
"Telephone": [
{
"Number": "4430345675"
},
{
"Number": "443034554445"
}
]
} Hi ab,
I managed to do it using the finddocs method with direct access to a collection but I wonder if there is a way to do this at the ORM level. Using mormotDDD classes or even TSQLRecord?
Thanks Ab for the answer. What section of the doc is this information in? I found something on selfTest but accessing Tmongoclient directly and not using the mormot Framework.
In this collection:
{"_id":{"$numberInt":"2"},"Name":"Fabio T de oliveira","Type":{"$numberInt":"0"},"DataPerson":{"CPF":"001.111.111-11","RG":""}} I can't select from the CPF field of the DataPerson object.
Is it possible with mormot to locate records in a mongodb collection across fields that are stored as variant?
I am wanting to use ICQRSService only on the server side and isolate my domain with DTOs services. This is correct?
I am using only the TDDDRepositoryRestFactory and giving resolve in the ICQRSService server-side interface