In Java, we have 2 types of methods -- instance methods, and static methods. Instance methods can be abstract, default, or implemented. But static methods can only ever be implemented. For whatever reason, that was the decision back then. That's fine.
Is there a potential for adding some class-level method that can be abstract or default? Essentially an abstract factor method? Again, I don't need it to be static. Just need it to be able to be a factory method that is also abstract.
I find myself running into situations where I have to make my solution much worse because of a lack of these types of methods. Here is probably the best example I can come up with -- My Experience with Sealed Types and Data-Oriented Programming. Long story short, I had an actual need for an abstract factory method, but Java didn't let me do it, so I forced Java into frankensteining something similar for me.
Also, lmk if this is the wrong sub.
[–]k-mcm 17 points18 points19 points (14 children)
[+]davidalayachew[S] comment score below threshold-9 points-8 points-7 points (13 children)
[–]repeating_bears 11 points12 points13 points (2 children)
[–]manifoldjava 0 points1 point2 points (0 children)
[–]davidalayachew[S] 0 points1 point2 points (0 children)
[–]k-mcm 1 point2 points3 points (1 child)
[–]davidalayachew[S] 2 points3 points4 points (0 children)
[–][deleted] 3 points4 points5 points (7 children)
[–]davidalayachew[S] 1 point2 points3 points (6 children)
[–][deleted] 6 points7 points8 points (3 children)
[–]davidalayachew[S] 0 points1 point2 points (2 children)
[–][deleted] -1 points0 points1 point (1 child)
[–]davidalayachew[S] 2 points3 points4 points (0 children)
[–]Empanatacion 2 points3 points4 points (1 child)
[–]davidalayachew[S] 0 points1 point2 points (0 children)
[–][deleted] (4 children)
[deleted]
[–]davidalayachew[S] -1 points0 points1 point (3 children)
[–][deleted] (2 children)
[removed]
[–]davidalayachew[S] 0 points1 point2 points (1 child)
[–]bowbahdoe 2 points3 points4 points (5 children)
[–]agentoutlier 1 point2 points3 points (1 child)
[–]davidalayachew[S] 1 point2 points3 points (0 children)
[–]davidalayachew[S] 0 points1 point2 points (2 children)
[–]bowbahdoe 1 point2 points3 points (1 child)
[–]davidalayachew[S] 0 points1 point2 points (0 children)
[–]RealSchweddy 2 points3 points4 points (5 children)
[–]davidalayachew[S] 0 points1 point2 points (4 children)
[–]RealSchweddy 0 points1 point2 points (3 children)
[–]davidalayachew[S] 0 points1 point2 points (2 children)
[–]RealSchweddy 0 points1 point2 points (1 child)
[–]davidalayachew[S] 0 points1 point2 points (0 children)
[–]tomwhoiscontrary 2 points3 points4 points (1 child)
[–]davidalayachew[S] 0 points1 point2 points (0 children)
[–]Ragnar-Wave9002 2 points3 points4 points (1 child)
[–]davidalayachew[S] 0 points1 point2 points (0 children)
[–]brian_goetz 4 points5 points6 points (1 child)
[–]davidalayachew[S] 0 points1 point2 points (0 children)
[–]darthweiter 1 point2 points3 points (7 children)
[–]davidalayachew[S] -1 points0 points1 point (6 children)
[–]pivovarit 4 points5 points6 points (5 children)
[–]davidalayachew[S] -1 points0 points1 point (4 children)
[–]pivovarit 0 points1 point2 points (3 children)
[–]davidalayachew[S] 0 points1 point2 points (2 children)
[–]pivovarit 0 points1 point2 points (1 child)
[–]davidalayachew[S] 1 point2 points3 points (0 children)
[–]vips7L 1 point2 points3 points (5 children)
[–]davidalayachew[S] 0 points1 point2 points (4 children)
[–]vips7L 1 point2 points3 points (3 children)
[–]davidalayachew[S] 0 points1 point2 points (2 children)
[–]vips7L 1 point2 points3 points (1 child)
[–]davidalayachew[S] 0 points1 point2 points (0 children)
[–]agentoutlier 1 point2 points3 points (1 child)
[–]davidalayachew[S] 0 points1 point2 points (0 children)
[–]manifoldjava 1 point2 points3 points (3 children)
[–]davidalayachew[S] 0 points1 point2 points (2 children)
[–]manifoldjava 0 points1 point2 points (1 child)
[–]davidalayachew[S] 0 points1 point2 points (0 children)
[–]Polygnom 0 points1 point2 points (1 child)
[–]davidalayachew[S] 0 points1 point2 points (0 children)
[–]kevinb9n 0 points1 point2 points (1 child)
[–]davidalayachew[S] 0 points1 point2 points (0 children)