Split ExprNodes, BoolNodes and StmtNodes

10 views
Skip to first unread message

Adriano dos Santos Fernandes

unread,
Apr 13, 2023, 7:04:54 AM4/13/23
to firebir...@googlegroups.com
Hi!

As these files are huge now, I'm thinking in split them in specific
files per each node in a subdirectory after v5 branch is forked or v5
final is released.

Advantages:
- Better organization
- Easy to work with specific node

Disadvantages:
- Hard to do bulk refactors
- More difficult to backport changes between the versions

What do you think?


Adriano

Vlad Khorsun

unread,
Apr 17, 2023, 6:36:50 AM4/17/23
to firebir...@googlegroups.com
I, personally, prefer to not follow file-per-class approach.
I consider it as not less bad as all classes in one file.
Could we split existing nodes (classes) on some smaller logical coupled groups ?

For example, StmtNodes could be split by :

PSqlNodes
AssignmentNode
BlockNode
CompoundStmtNode
ContinueLeaveNode
CursorStmtNode
DeclareCursorNode
DeclareLocalTableNode
DeclareSubFuncNode
DeclareSubProcNode
DeclareVariableNode
ErrorHandlerNode
IfNode
InAutonomousTransactionNode
InitVariableNode
ExceptionNode
ExitNode
ForNode
HandlerNode
LabelNode
LineColumnNode
LoopNode
MessageNode
OuterMapNode
PostEventNode
ReceiveNode
StallNode
SuspendNode
ReturnNode
SavepointEncloseNode
TruncateLocalTableNode

DmlNodes
EraseNode
ExecProcedureNode
ExecStatementNode
ExecBlockNode
MergeNode
ModifyNode
StoreNode
SelectNode
SetGeneratorNode
UpdateOrInsertNode


SessionNodes
SessionManagementWrapperNode
SessionResetNode
SetRoleNode
SetSessionNode
SetDebugOptionNode
SetDecFloatRoundNode
SetDecFloatTrapsNode
SetBindNode
SetTimeZoneNode

TransactionNodes
SetTransactionNode
CommitRollbackNode
UserSavepointNode

Of course, it is not final distribution, just a first attempt to introduce
some classification.

Regards,
Vlad

Dmitry Yemanov

unread,
Apr 17, 2023, 7:09:22 AM4/17/23
to firebir...@googlegroups.com
17.04.2023 13:36, Vlad Khorsun wrote:
>
>> As these files are huge now, I'm thinking in split them in specific
>> files per each node in a subdirectory after v5 branch is forked or v5
>> final is released.
>>
>> Advantages:
>> - Better organization
>> - Easy to work with specific node
>>
>> Disadvantages:
>> - Hard to do bulk refactors
>> - More difficult to backport changes between the versions
>>
>> What do you think?
>
> I, personally, prefer to not follow file-per-class approach.
> I consider it as not less bad as all classes in one file.

As for me, having 100500 classes inside one file is pretty much the same
PITA as having 100500 files inside the directory.

> Could we split existing nodes (classes) on some smaller logical coupled
> groups ?

This could be a good compromise. Alternatively, we may have
one-class-per-file, but split the files between sub-directories, e.g.
using your naming:

  /dsql/PSqlNodes
  /dsql/DmlNodes
  /dsql/SessionNodes
  /dsql/TransactionNodes

(maybe omitting the Nodes suffix)

Yes, backporting will require manual changes instead of cherry-picking,
but this is how we lived before Git, so this is surely not the end of
the world.


Dmitry

Alex Peshkoff

unread,
Apr 17, 2023, 8:07:28 AM4/17/23
to firebir...@googlegroups.com
On 4/17/23 14:09, Dmitry Yemanov wrote:
> /dsql/PSqlNodes
>    /dsql/DmlNodes
>    /dsql/SessionNodes
>    /dsql/TransactionNodes
>
> (maybe omitting the Nodes suffix)

+1
Very good!

Reply all
Reply to author
Forward
0 new messages