Comments (19)
To get rid of the null check you would declare it as lateinit var myButton: Button
. That doesn't ensure you don't reassign it though, and lateinit
is sadly disallowed on val
. Your solution would prevent that, at the cost of synchronization.
I see the value in this, but I think the most annoying bit is the null check, and that's easily avoided. On the other hand, I can't see any harm in adding it, it's up to the user to use it :)
from tornadofx.
I did not know about lateinit modifier and you are right, that solves most of the problem. You could also make the setter private, but that could be verbose. In a multithreaded application, would you still in theory need a volatile modifier on any var property?
I'm a bit biased towards immutability and I was surprised there wasn't a feature like this already in Kotlin library.
Would you see value in making synchronized and non-synchronized versions, just like lazy()?
from tornadofx.
You're right, and an immutable single assign property could be useful to avoid certain bugs related to builders. I think it would make sense to implement sync/non-sync in the same manner as lazy, good call. Will you give it a crack? (I won't be able to get much done before next week myself).
from tornadofx.
For sure, I'd love to.
from tornadofx.
And if you need helping document this stuff before next release please let me know. I'm a writer so I kind of like those tasks.
from tornadofx.
Cool! I'd love some help with documentation. My english isn't all that good, so it would be a great improvement if you'd get involved there as well! I granted you collaborator access to the project now, I think you should be able to edit the wiki directly.
With each release I plan on adding documentation for all the entries in the changelog, including builder examples for all new builders, and some notes where needed, like the vbox thing on the borderpane builder etc.
If you'd give it a go, I'll be forever grateful :) In the meantime, I'll look for forum software, preferably something with github integration.
from tornadofx.
Thanks! I'll definitely help out where I can. In a warped way, I like technical writing. It relaxes me. One of my "documentation projects" without any planning became a book, so this is down my alley.
from tornadofx.
Wow! That's so cool. That's the ultimate goal - a book for TornadoFX :) hehe
from tornadofx.
haha! Who knows we might get there, and we will be electing an animal for the cover before you know it.
from tornadofx.
Long term plan - check! :)
from tornadofx.
Your book looks really nice, btw. What software did you use to write it? Was it hard/expensive to get it published?
from tornadofx.
Thanks! I wrote it in Word but in hindsight I wish I used a Markdown editor. It cost me nothing other than my time and energy which was not bad since I like writing. O'Reilly picked up all the expenses and provided a great editor.
Richard Hipp (creator of SQLite) randomly reached out to me on Twitter and joined the project too, which was enormously helpful since the book uses SQLite heavily for the hands-on stuff.
I wrote the first draft as a guide to help unemployed business professionals in the Dallas area. The other volunteers insisted I publish it, and I'm really glad they talked me into it.
from tornadofx.
Interesting... When the framework has matured a little and we have tested all concepts more thoroughly I'd like to discuss this further with you :)
from tornadofx.
Sure! I look forward to it : )
from tornadofx.
FYI, there is a very similar proposal to implement something like singleAssign()
into Kotlin officially. Feel free to upvote!
from tornadofx.
Cool :) Just voted!
from tornadofx.
.. and saw your comment :))
from tornadofx.
I'm a sucker for product placement haha
from tornadofx.
Haha 👍
from tornadofx.
Related Issues (20)
- TornadoFx ClassCastException HOT 1
- Accessing nodes with less code HOT 4
- Advanced Data Controls Guide Clarification HOT 1
- Unbind TextField text property from non-String property HOT 2
- Font not loading HOT 1
- AsyncKt cannot access class com.sun.glass.ui.Application HOT 5
- EventBus.fire does not check for listeners of superclass types HOT 1
- Set window icons for Alerts
- Hot reload doesn't work with openjdk
- a bug with toggleClass HOT 2
- TornadoFx stackpane overlapping with menubar
- How can i build a native image using tornadofx HOT 1
- Localization of german Double values
- Data Driven TreeView HOT 1
- how to use field()? | and why field() cant' be used without form()? HOT 2
- Tornadofx with Spring security
- Is this not longer maintained? HOT 8
- Looking for maintainers HOT 1
- Guilde is not available HOT 1
- Documentation does not work HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from tornadofx.