B4J Question [BANano] BANanoEssentials Booklet

Mashiane

Expert
Licensed User
Longtime User
Hi Alain

First, thanks a lot for this essential book. I am so glad that I have read it and now have some globe moments to take me through creating beautiful and amazing projects with BANAno. I cant wait for the opportunity of being able to send monthly donations in support of your project. At least last month I was able to send a small certificate of appreciation.

If you dont mind, I have some questions of clarity, at times my mind is like a 5 years old.

Q1. CssSmart

In page 27, you have made reference to JavaScriptSmart. There was once a post about CssSmart, whilst I never got to use it, is it possible to also include an example of using that in the ebook. Thank you.

Q2. var innerConn = ...

In page 31, an example is showing "javascript" and its equivalent "BANano Way" of doing it. Perfect. I know, the eBook is not about javascript, but this example made a lot of sense in terms of how does one transition from javascript to banano and or banano to javascript. IMHO, whilst there is no need to know javascript/html when creating BANano Apps, the greatest challenge I see is the transition for people who know or are coming from the javascript world and want to use BANano. The learning curve will be rather steep because the mindset will be javascript to banano conversion whilst the approach of Banano is b4x to javascript, unless of course the focus is just on this ninche, then no worries. Either way, my two cents is that the line between the two is very very thin. Perhaps more examples on javascript to banano would help. #just a thought.

Anyway, in the section "In B4J, this would become:", the innerConn variable declaration e.g. something like Dim innerConn As???, should it be defined as Dim innerConn As Object or?
Its kinda confusing or there is no need for a variable declaration first? javascript is crazy, a variable defined as 3 dots!!! Phew. Thank you.

Q3. To RunMethod.Result or Not?

What are the conditions of calling .Result at the end of a .RunMethod? This is just to help and clarify my understanding. I sometimes write and sometimes not write it on my code, but I dont really undertstand what it really does? Thank you.

C1. Thanks a lot for the ResumableSub, phew, I cant wait to try those. I have been using the BANanoPromise for a very long while yet it has been so difficult understanding how it really works, and today I decided to do myself a memory map that could help me understand as a reference. I took a long look at the generated source in debug mode of what came up. At least this will boost my confidence in writing correct promises when the need comes to. BTW, BANanoFetch is a BANanoPromise are similar.

1646258467641.png


I will have to school myself from javascript docs about the other methods used like Finally etc, when I cross that bridge. Thank you.

C2. Now I know how to write correct PWA. Thank you.

C3. ImportRaw. Wow. I should explore this due to my Vue explorations. Thank you.

C4. Do not over-create properties, they carry some weight. This was very important for me. Thank you.
When I moved BVAD3 to be based on Custom Views, that was it, no coding approach, done! I now understand why its crucial to have rather a balanced approach. Rather have more code than the abstract designer approach, and then very good documentation. Now I know.

C5. BANanoServer. Thank you. My mind is still grappling with this a lot. I will play around and see. Im sure when it really registers it will be like the ABM Grid aha! moment. All this time it was this easy!!! ;)

I will cross other bridges when I get to them.

Overall, perfect job, congratulations. Very very very informative piece of work!

You are such a great asset to this community.

🙏
 

alwaysbusy

Expert
Licensed User
Longtime User
Q1. CssSmart
#If CSSSmart is not mentioned as it doesn't work properly yet. It will be added when I find a solution that works. With #if JavaScriptSmart, I can use string concatenation to inject the smart variables. This can not be done with CSS. Will be updated when available.

Q2.
the approach of Banano is b4x to javascript
This is correct. Just like very few Java programmers move to B4J, so will also few JavaScript/HTML/CSS programmers move to B4J+BANano, unless they target cross platform with the native B4X tools like B4A or B4i. The target groep of BANano is the ones that already use B4X products that would like to make Web Apps to with the B4X suite.

InnerConn: I wanted to focus on the Initialize7 method so I removed the unneeded code. I will change it to the full code like this if it makes it more clear:

B4X:
var innerConn = new JsStore.Connection();
var query = new innerConn.$sql.Query(SQL);

In B4J this would become:

B4X:
Dim InnerConn As BANanoObject
InnerConn.Initialize2("JsStore.Connection", Null)

Dim Query As BANanoObject
Query.Initialize7(innerConn, "$sql.Query", SQL)

Q3. To RunMethod.Result or Not?
This is a workaround needed to avoid the B4J compilation error where some data type is assigned to another one and is incompatible. Transpiled it does literally nothing.
Most of the time it is not needed as many BANanoObjects are also a B4J Object, but if you run into such a compile error, you can use the .Result to trick B4J.

BANanoServer.
Again, there is absolutely nothing special with BANanoServer, it is just a normal jServer. You've done the same concepts a million times when you worked with ABMaterial.

Alwaysbusy
 
Upvote 0
Top